Smooth Snake, fix Play again and Carry on, and blend the Arcade logo (0.76.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,4 +62,15 @@ class SnakeGameTest {
|
||||
assertFalse(start.food in start.body)
|
||||
assertTrue(start.alive)
|
||||
}
|
||||
|
||||
@Test fun theSnakeGlidesBetweenSteps() {
|
||||
val before = listOf(SnakeCell(3, 5), SnakeCell(2, 5), SnakeCell(1, 5))
|
||||
val moved = game(3 to 5, 2 to 5, 1 to 5).step(random)
|
||||
val halfway = snakeLine(moved, before, .5f)
|
||||
assertEquals(3.5f to 5f, halfway.first())
|
||||
assertEquals(3f to 5f, halfway[1])
|
||||
assertEquals(1.5f to 5f, halfway.last())
|
||||
assertEquals(4f to 5f, snakeLine(moved, before, 1f).first())
|
||||
assertEquals(4f to 5f, snakeLine(moved, null, .5f).first())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user