diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-11-01 17:15:18 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-11-01 17:15:18 +0100 |
| commit | e386840172a60085219770c0daeb780685011b60 (patch) | |
| tree | b928b895d448fae3b3d4fb24f372b1aebbb673bc | |
| parent | d2f75ae50247c8dbe8fff338066658134a8043af (diff) | |
Minor changes
| -rwxr-xr-x | qlearning.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qlearning.py b/qlearning.py index a1770b6..bbe9127 100755 --- a/qlearning.py +++ b/qlearning.py @@ -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 |
