Commit graph

166 commits

Author SHA1 Message Date
bvanvugt
4df2c65432 Restrict fixed food spawns to only locations further from center. 2022-01-18 20:21:21 +00:00
bvanvugt
020303a8dd Isolate and improve logic to determine default move. 2022-01-11 22:44:37 +00:00
bvanvugt
a1ee890dde Update golangci-lint to 1.43.0 2022-01-10 22:26:45 +00:00
bvanvugt
e1ab986486 Bump to Go 1.17 2022-01-10 22:25:46 +00:00
Ebbe Steenhoudt
ba855a8ab1
Colored board (#59)
* New flag -c to use colors in the cli board view

* Error handeling

* Fix formatting

* Extracted ANSI escape codes into a different file

* Fixed formatting
2021-12-08 10:43:40 -08:00
Simon Agius Muscat
142a5a6ecf
Add export to file (#58)
* Initial addition of a game exporter

* Fix snake state bug, remove test logs, fix final output line being empty

* Ignore test JSONL file

* Added explanation for design decision on the you key in SnakeResponse

* Adjust gitignore to be more generic

* Retain consistency in usage of pointer

* Re-word explanation to refer to requests instead of responses

* Remove unnecessary nil check

* Check error returned by WriteString

* Change file permissions for output file

* Initialise gameexporter regardless of whether output is requested

* Print error and exit if export to file fails

* Added another comment explaining reasoning around export checks

* Fixed broken test due to changed return type
2021-12-02 09:59:20 -08:00
Rob O'Dwyer
4a9dbbcaef
DEV 559: Refactor CLI and add customizations (#57)
* move snake API structs into a new client package

* add customizations to snake objects

* refactor and add support for passing snake customizations in games
2021-11-25 14:07:56 -08:00
Aurora Walker
6140f232c2
Create CONTRIBUTING.md 2021-10-01 15:33:48 -07:00
Rob O'Dwyer
31faba642c
Add missing ruleset params to request body and --debug-requests option (#55)
* fix sending of new params

* add royale and squad settings to requests

* add --debug-requests option

* update test for request body and add helper

Co-authored-by: Penelope Phippen <penelope@hey.com>
2021-09-07 14:58:10 -07:00
Brad Van Vugt
0cba5eff59
Update CODEOWNERS 2021-09-07 09:46:35 -07:00
Brad Van Vugt
85a0edcf74
Update CODEOWNERS 2021-09-07 09:46:17 -07:00
Rob O'Dwyer
2d57653d46
add CLI flags for ruleset settings and update hazardDamagePerTurn (#53) 2021-09-02 15:32:46 -07:00
Rob O'Dwyer
e9f408cdbb
add turn to BoardState and remove it from RoyaleRuleset (#52) 2021-08-27 13:28:12 -07:00
John Oram
17556e15c1
wrapped ruleset (#30)
* wrapped ruleset

* resurrect like brad suggested

* introduce mode to binary

* go fmt

* address edge crossing collision and eating bugs

* Update board_state.go

* removed binary

* rename variable
2021-08-24 12:11:36 -07:00
Rob O'Dwyer
015b681f14
DEV-280: Extract board generation out of rules.Ruleset (#51)
* extract board generation out of rules.Ruleset

* update comment and remove redundant interface check

* clone boardState in constrictor to respect the ModifyBoardState interface
2021-08-23 17:13:58 -07:00
Rob O'Dwyer
e416384007
Refactor RoyaleRuleset and move hazard damage into StandardRuleset (#50)
* move hazard damage into StandardRuleset

* OutOfBounds -> Hazards

* remove "out of bounds" in comment

* add cases for eating food to hazard damage test
2021-08-17 16:47:06 -07:00
Nettogrof
dabbe7dfb5
Remove Eliminated Snake from the send payload (#49) 2021-07-17 13:18:43 -07:00
Luke Mitchell
97fbcb3376
Add new arg "delay" to delay board updates by x milliseconds (#48)
Co-authored-by: Brad Van Vugt <1531419+bvanvugt@users.noreply.github.com>
2021-07-04 13:48:56 -07:00
bvanvugt
d42f5f46cc CLI: Persist hazards in royale games. 2021-07-04 13:41:44 -07:00
Jiri Novotny
0331ea65f8
fixed panic when printing snake out of bounds (#46)
Co-authored-by: Jiri Novotny <hello@jiricodes.com>
2021-07-02 20:42:16 -07:00
bvanvugt
f65f6d65d7 CLI: No longer send /move requests to eliminated snakes. 2021-07-02 20:36:37 -07:00
bvanvugt
bae7a5083c CLI - Send /end request to all Battlesnakes. 2021-07-02 20:12:39 -07:00
bvanvugt
72a74a9628 Remove ruleset versions for GitHub release version (future). 2021-07-02 20:09:55 -07:00
bvanvugt
9dba91619a Fix latency string in unit test. 2021-07-02 20:08:58 -07:00
John Oram
f31bdff4b8
add ruleset data to the calls made by the cli (name and version) (#32)
* add ruleset data to the cli (name and version)
* remove double ruleset tracking with royale mode
2021-07-02 20:00:19 -07:00
Hunter Freyer
d750b08317
Change SnakeResponse.Latency to be a string. (#45)
Convert CLI Latency value from int to string, to match what the current game engine does.
2021-06-21 14:25:31 -07:00
Andrew MacLean
c2c1c8df50
Update README.md 2021-05-18 09:07:03 -07:00
Andrew MacLean
ff355282bc
Create CODE_OF_CONDUCT (#36)
* Create CODE_OF_CONDUCT

* Rename CODE_OF_CONDUCT to CODE_OF_CONDUCT.md
2021-04-05 22:34:36 -07:00
Brad Van Vugt
f98b1e38ec
Remove old API v0 Y-Axis warnings and FAQ
Fixes #29
2021-02-12 13:51:25 -08:00
bvanvugt
d62807774b Invert the Y-Axis to match modern gameplay. 2021-01-19 15:33:05 -08:00
bvanvugt
e1bafaac69 Update CI to Go 1.15 2021-01-19 15:07:25 -08:00
bvanvugt
02b85487f0 Remove MazeRuleset from CLI 2021-01-19 15:02:11 -08:00
bvanvugt
12f9297b8b Rename 'maze' -> 'constrictor', remove use of food 2021-01-19 14:55:49 -08:00
bvanvugt
f9262bc336 go mod tidy 2021-01-19 14:55:07 -08:00
bvanvugt
c8033afb86 Bump to Go 1.15 2021-01-19 14:42:36 -08:00
bvanvugt
08b4fba8e0 Add more output to Build CLI CI test. 2020-12-11 10:10:27 -08:00
bvanvugt
6f6bd03f88 Make Build CLI action consistently named. 2020-12-11 10:08:55 -08:00
bvanvugt
63652d7917 Add CI test for building CLI. 2020-12-11 10:07:50 -08:00
bvanvugt
accb598e29 Add RulesetError test case.
Remove old comments.
2020-12-11 10:05:19 -08:00
md-hexdrive
2cbf8884bf
Add new constants for standard ruleset errors, resolves #5 (#24)
* Convert errors to constant error interfaces.
2020-12-11 09:50:52 -08:00
bvanvugt
f0f2ff5961 Update READMEs for new CLI stuff. 2020-12-11 09:45:07 -08:00
bvanvugt
1cfbd80284 goreleaser github action 2020-12-10 21:11:03 -08:00
bvanvugt
f0045be2f8 Working goreleaser. 2020-12-10 21:08:08 -08:00
bvanvugt
78ca2e09c6 Add goreleaser config. 2020-12-10 21:01:43 -08:00
Brad Van Vugt
8320ef23cd
Update README.md 2020-12-10 16:05:17 -08:00
bvanvugt
f2b52b85d6 Configurable random seed.
Fix food spawning parameters.
Added Solo game result condition.
Added support for 'maze' mode.
Added seed, ruleset to view output.
2020-12-10 15:56:22 -08:00
bvanvugt
8d764e1477 Update build path and docs. 2020-12-10 15:02:29 -08:00
Len Payne
6c1e0d9547
Command Line Interface to Run Games Locally (#25)
* Initial Attempts at Cobra Command
* Update to the README
* Fixes for Linter

Thanks @LenPayne for all your hard work getting this started!
2020-12-10 14:35:52 -08:00
Brad Van Vugt
e01a1bf505
"Feast" -> "Maze". Fix backfill bug. (#26) 2020-12-08 13:20:13 -08:00
bvanvugt
d7ee7b97fb New "feast" game mode (alpha) 2020-12-07 18:11:00 -08:00