Sha256: bbde7957baf74dcfc3e7169972c57efec28d83ed8577edee534aec384462cac0

Contents?: true

Size: 437 Bytes

Versions: 188

Compression:

Stored size: 437 Bytes

Contents

enum Direction {

    UP   ( 0, -1),
    RIGHT( 1,  0),
    DOWN ( 0,  1),
    LEFT (-1,  0);

    private final int dx;

    private final int dy;

    Direction(int dx, int dy) {
        this.dx = dx;
        this.dy = dy;
    }

    int getDx() {
        return dx;
    }

    int getDy() {
        return dy;
    }

    Direction turnRight() {
        return Direction.values()[(ordinal() + 1) % Direction.values().length];
    }

}

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
trackler-2.2.1.18 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.17 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.16 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.15 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.14 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.13 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.12 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.11 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.10 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.9 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.8 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.7 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.6 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.5 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.4 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.3 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.2 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.1 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.0 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.0.6 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java