File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ enum class PieceShape(coordinates: Set<Coordinates>) {
53
53
54
54
/* * Applies all the given transformations. */
55
55
fun transform (rotation : Rotation , shouldFlip : Boolean ): Set <Coordinates > =
56
- coordinates.flip(shouldFlip).rotate(rotation )
56
+ coordinates.rotate(rotation).flip(shouldFlip )
57
57
58
58
companion object {
59
59
val shapes: Map <Int , PieceShape > = ((0 until Constants .TOTAL_PIECE_SHAPES ) zip values()).toMap()
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ class PieceTest: StringSpec({
44
44
PieceShape .PENTO_W .transform(Rotation .MIRROR , false) shouldBe shapes[2 ]
45
45
PieceShape .PENTO_W .transform(Rotation .LEFT , false) shouldBe shapes[3 ]
46
46
PieceShape .PENTO_W .transform(Rotation .NONE , true) shouldBe shapes[3 ]
47
- PieceShape .PENTO_W .transform(Rotation .RIGHT , true) shouldBe shapes[0 ]
47
+ PieceShape .PENTO_W .transform(Rotation .RIGHT , true) shouldBe shapes[2 ]
48
48
PieceShape .PENTO_W .transform(Rotation .MIRROR , true) shouldBe shapes[1 ]
49
- PieceShape .PENTO_W .transform(Rotation .LEFT , true) shouldBe shapes[2 ]
49
+ PieceShape .PENTO_W .transform(Rotation .LEFT , true) shouldBe shapes[0 ]
50
50
}
51
51
" Piece coordination calculation" {
52
52
val position = Coordinates (2, 2)
You can’t perform that action at this time.
0 commit comments