Building Games in SC#: Snake
12 passed3 failed |
80.0% |
IN479 477
OUT81 376 |
| ✓ |
SnakeThe model builds a Snake game from the task as an agent; this item passes when the app compiles and can be exported, and each hidden test is its own item.1 AI query
14 tool calls |
Passed |
IN479 477
OUT81 376 |
| ✓ |
Hidden_ArrowKeysTurnAn arrow key turns the snake, and the next step goes in the new direction.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_BodyEndsTheGameStepping onto the snake's body ends the game.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| × |
Hidden_EatingGrowsEating the food makes the snake one cell longer, adds 10 points and places new food on a free cell.0 AI queries
0 tool callsHiddenTestAssertion expression evaluated to false: snakeX.Count == 4 && snakeX[3] == 9
Context: after the next step the snake keeps its new length
Values:
snakeX.Count = 4
snakeX[3] = 8 (line 707) |
Failed |
IN0
OUT0 |
| ✓ |
Hidden_FoodNeverOnTheSnakeNew food always appears on a board cell that is not part of the snake.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_GameOverAndRestartWhile the game is over nothing moves and arrow keys are ignored; Enter starts a new game.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_GetsFasterThe snake gets faster: stepFrames never grows, is at most 4 after 10 foods, never below 2, and the snake really steps every stepFrames frames.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| × |
Hidden_HeadMayFollowTheTailThe head may step onto the tail's cell, because the tail leaves it in the same step.0 AI queries
0 tool callsHiddenTestAssertion expression evaluated to false: snakeX[0] == 10 && snakeY[0] == 11 && snakeX[3] == 11 && snakeY[3] == 11
Context: head (10, 11)
Values:
snakeX[0] = 10
snakeY[0] = 11
snakeX[3] = 10
snakeY[3] = 11 (line 795) |
Failed |
IN0
OUT0 |
| ✓ |
Hidden_InitialStateAfter AppInit, the snake, the direction, the speed, the score and the food have their starting values.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_KeyInTheStepFrameA key pressed in the frame of a step already turns that step.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| × |
Hidden_MovesEveryStepFramesThe snake takes its first step in the 6th frame and then one step every 6 frames, and the body follows the head.0 AI queries
0 tool callsHiddenTestAssertion expression evaluated to false: snakeX[1] == 10 && snakeX[2] == 9 && snakeX.Count == 3
Context: the body follows
Values:
snakeX[1] = 10
snakeX[2] = 8
snakeX.Count = 3 (line 642) |
Failed |
IN0
OUT0 |
| ✓ |
Hidden_ReverseIsIgnoredThe key opposite to the last step is ignored, also after another turn before the next step.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_ScreenAfterEatingAfter eating and after the eating effect ends, the screen shows the longer snake and the new score.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_ScreenShowsTheSceneThe screen shows the background, the food, the body, the head and the score text.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |
| ✓ |
Hidden_WallEndsTheGameStepping out of the board ends the game, and the snake stays where it was.0 AI queries
0 tool callsHiddenTest |
Passed |
IN0
OUT0 |