fix for rivers and bridges snake start positions (#85)

* fix for rivers and bridges snake start positions

* update max player count, add unit test

* set player count to 12 (max for smallest size)

* fix: one of the 19x19 spawn points

* randomize snake placement at start positions

* randomly choose starts in quadrants

* fix: check that start positions are valid

* modify food placement to avoid hazards
This commit is contained in:
Torben 2022-06-28 14:41:01 -07:00 committed by GitHub
parent f58df66e69
commit 9d6b1147cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 298 additions and 25 deletions

View file

@ -103,13 +103,13 @@ func TestRiversAndBridgetsHazardsMap(t *testing.T) {
// check all the supported sizes
for _, size := range []int{11, 19, 25} {
state = rules.NewBoardState(size, size)
state.Snakes = append(state.Snakes, rules.Snake{ID: "1", Body: []rules.Point{}})
editor = maps.NewBoardStateEditor(state)
require.Empty(t, state.Hazards)
err = m.SetupBoard(state, settings, editor)
require.NoError(t, err)
require.NotEmpty(t, state.Hazards)
}
}
func TestSpiralHazardsMap(t *testing.T) {