blob: 7834f6fd9ac4e370d323ed7a8b165130650f5c8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env python
import sys
import numpy as np
# Import snake game
from snake import Snake
# Setup QTable
qtable=np.zeros((16, 4))
game=Snake()
def event_handler(game):
if game.snake[0][0]==10:
game.direction=6
for i in range(0,10):
score=game.run()
print("Game ended with "+str(score))
|