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.38 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.37 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.36 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.35 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.34 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.33 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.32 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.31 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.30 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.29 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.28 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.27 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.26 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.25 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.24 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.23 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.22 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.21 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.20 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java
trackler-2.2.1.19 tracks/java/exercises/spiral-matrix/src/example/java/Direction.java