mirror of
https://github.com/d3vyce/Python-Game.git
synced 2025-04-03 12:23:22 +02:00
add test for snake_move function
This commit is contained in:
parent
aa1638cec4
commit
edf549e670
@ -9,20 +9,22 @@ HEIGH = 10
|
||||
WIDTH = 20
|
||||
|
||||
def main():
|
||||
test = snake.List((5, 5), None)
|
||||
test = snake.List.List_add(test, (6, 6))
|
||||
test = snake.List.List_add(test, (7, 7))
|
||||
test = snake.List.List_add(test, (8, 8))
|
||||
print(test)
|
||||
print("Size : ", snake.List.List_size(test))
|
||||
L_snake = snake.List((5, 5), None)
|
||||
L_snake = snake.List.List_add(L_snake, (5, 4))
|
||||
L_snake = snake.List.List_add(L_snake, (5, 3))
|
||||
L_snake = snake.List.List_add(L_snake, (5, 2))
|
||||
print(L_snake)
|
||||
print("Size : ", snake.List.List_size(L_snake))
|
||||
|
||||
|
||||
matrix = level.init_level(HEIGH, WIDTH)
|
||||
matrix[5][5] = 1
|
||||
matrix[5][6] = 2
|
||||
level.spawn_apple(matrix, HEIGH, WIDTH)
|
||||
print(matrix)
|
||||
#print(matrix)
|
||||
|
||||
snake.Snake_move(matrix, test, "left")
|
||||
L_snake = snake.Snake_move(matrix, L_snake, "right")
|
||||
print(L_snake)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
x
Reference in New Issue
Block a user