1 | package com.adventofcode.day12 | |
2 | ||
3 | ||
4 | enum class Orientation(cardinality: Int) { | |
5 | N(0), | |
6 | E(1), | |
7 | S(2), | |
8 | W(3); | |
9 | ||
10 | fun nextClockWise(): Orientation { | |
11 |
1
1. nextClockWise : negated conditional → KILLED |
if(this == W) return N |
12 |
1
1. nextClockWise : Replaced integer addition with subtraction → KILLED |
return Orientation.values()[this.ordinal + 1] |
13 | } | |
14 | ||
15 | fun previousClockWise(): Orientation { | |
16 |
1
1. previousClockWise : negated conditional → KILLED |
if(this == N) return W |
17 |
1
1. previousClockWise : Replaced integer subtraction with addition → KILLED |
return Orientation.values()[this.ordinal - 1] |
18 | } | |
19 | } | |
Mutations | ||
11 |
1.1 |
|
12 |
1.1 |
|
16 |
1.1 |
|
17 |
1.1 |