Akavall / GoGamesProject

Trying to make some simple games using golang.
1 stars 1 forks source link

Game stalls after what looks like deck ran out #55

Closed Akavall closed 7 years ago

Akavall commented 7 years ago

2017/07/02 05:55:24 Grabbed game state with id: c3fa969d-c6be-4c4f-4098-2bf552acc0a6 2017/07/02 05:55:24 Size of deck : 2 2017/07/02 05:55:24 shot: 1,brains: 10, walks: 1 2017/07/02 05:55:24 http: panic serving 162.244.136.188:47708: runtime error: index out o f range goroutine 200 [running]: net/http.(conn).serve.func1(0xc8200c2600) /usr/local/go/src/net/http/server.go:1389 +0xc1 panic(0x7f0580, 0xc82000a0a0) /usr/local/go/src/runtime/panic.go:426 +0x4e9 github.com/Akavall/GoGamesProject/zombie_dice.simulate_one_roll(0xc820043548, 0xc8200435d 0, 0x1, 0x1, 0x0) /home/kirill/GoStuff/src/github.com/Akavall/GoGamesProject/zombie_dice/ai.go:73 + 0x2e2
github.com/Akavall/GoGamesProject/zombie_dice.SimulationistAI(0x1, 0xa, 0x1, 0xc8201d0258 , 0x3) /home/kirill/GoStuff/src/github.com/Akavall/GoGamesProject/zombie_dice/ai.go:48 + 0x2e7 main.take_zombie_dice_turn(0x7f548cb2b960, 0xc820114750, 0xc82032c000) /home/kirill/GoStuff/src/github.com/Akavall/GoGamesProject/basic_server.go:261 +0 x1217 net/http.HandlerFunc.ServeHTTP(0x92f260, 0x7f548cb2b960, 0xc820114750, 0xc82032c000) /usr/local/go/src/net/http/server.go:1618 +0x3a net/http.(
ServeMux).ServeHTTP(0xc82000d710, 0x7f548cb2b960, 0xc820114750, 0xc82032c000) /usr/local/go/src/net/http/server.go:1910 +0x17d net/http.serverHandler.ServeHTTP(0xc8200c2500, 0x7f548cb2b960, 0xc820114750, 0xc82032c000 ) /usr/local/go/src/net/http/server.go:2081 +0x19e net/http.(conn).serve(0xc8200c2600) /usr/local/go/src/net/http/server.go:1472 +0xf2e created by net/http.(Server).Serve /usr/local/go/src/net/http/server.go:2137 +0x44e

Akavall commented 7 years ago

This should be fixed:

2017/08/06 15:07:18 Size of deck : 1
2017/08/06 15:07:18 shot: 2,brains: 10, walks: 1
2017/08/06 15:07:18 Simulationist AI received Deck of size: 1: prepending for simulation
all_brains 6811
to lose 58740
2017/08/06 15:07:19 Player: You, Score: 6
2017/08/06 15:07:19 Player: AI Player, Score: 16
2017/08/06 15:07:19 Max score: 16
2017/08/06 15:07:19 Deleted GameState associated with 70f19904-4554-42de-6b9b-031f5bc433e9 in DynamoDB table: GameStates
2017/08/06 15:07:19 Put/update GameState associated with 70f19904-4554-42de-6b9b-031f5bc433e9 in DynamoDB table: GameStates

In this pull request: https://github.com/Akavall/GoGamesProject/pull/58