diff --git a/src/main/kotlin/be/nielandt/CrossSolver.kt b/src/main/kotlin/be/nielandt/CrossSolver.kt index 978e690..ee70dff 100644 --- a/src/main/kotlin/be/nielandt/CrossSolver.kt +++ b/src/main/kotlin/be/nielandt/CrossSolver.kt @@ -10,6 +10,9 @@ import java.util.* enum class Move { F, F_, F2, B, B_, B2, L, L_, L2, R, R_, R2, U, U_, U2, D, D_, D2; + /** + * Static methods for the Move object. + */ companion object { /** * Make a random set of moves that makes sense. @@ -28,6 +31,9 @@ enum class Move { return result } + /** + * Use the given counter, which contains digits that correspond with the amount of Moves, to generate a list of Moves. + */ fun combo(counter: Counter): List { val res = mutableListOf() for (i in 0 until counter.size()) { @@ -37,6 +43,10 @@ enum class Move { } } + /** + * Use this as `Move otherFace Move`, a quick way to check if the moves manipulate the same face or not. + * Example: `Move.F otherFace Move.U_ == false` + */ infix fun otherFace(otherMove: Move): Boolean { return this.toString().substring(0, 1) != otherMove.toString().substring(0, 1) } @@ -44,10 +54,8 @@ enum class Move { } /** - * Convert a color into a letter. + * Convert the color into a single digit for print purposes. */ -val COLOR_LETTER = arrayOf("W", "Y", "O", "R", "G", "B") - fun l(c: Color): String { return c.name.first().toString() }