Minor changes

This commit is contained in:
Loic Guegan 2022-11-01 17:15:18 +01:00
parent d2f75ae502
commit e386840172

View file

@ -67,8 +67,9 @@ def event_handler(game,event):
elif event==-1:
reward=-10
state=2048*snake_go_up
# This come from me I do not now if it is the best way to identify a state
state=2**11*snake_go_up+2**10*snake_go_right+2**9*snake_go_down+2**8*snake_go_left+2**7*apple_up+2**6*apple_right+2**5*apple_down+2**4*apple_left+2**3*obstacle_up+2**2*obstacle_right+2**1*obstacle_down+obstacle_left
if game.snake[0][0]==10:
game.direction=6