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.159 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.158 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.157 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.156 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.155 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.154 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.153 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.152 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.151 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.150 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.149 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.148 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.147 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.146 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.145 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.144 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.143 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.142 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.141 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java
trackler-2.2.1.140 tracks/java/exercises/spiral-matrix/.meta/src/reference/java/Direction.java