Smooth Snake, fix Play again and Carry on, and blend the Arcade logo (0.76.1)
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m43s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m32s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-02 14:31:02 +00:00
co-authored by Claude Opus 5.5
parent 2630215430
commit aa4337de22
9 changed files with 65 additions and 21 deletions
@@ -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())
}
}