Git Product home page Git Product logo

battlesnaketester's Introduction

BattlesnakeTester

There are 2 sets of tests (normal and hard). Normal tests should be cases where failing the test results in you dying or a very high chance of death. Hard tests can be special situations where certain moves might be arguably better than others, but don't necessairly mean certain death. Hard tests often involve more looking ahead or prediction.

Need to add the sleep module first : npm install sleep

To run normal tests: npm --host=localhost --port=8000 run test

or: npm --host=snake.com run test

For hard tests, replace test with hard_test. Eg. npm --host=localhost --port=8000 run hard_test

Open Invite

If you have any questions, or just wish to chat about Battlesnake or programming in general, feel free to reach out! I like talking with people and sharing tips and tricks.

You can reach me at [email protected], or catch me in [Battlesnake Slack][slack] (username: @Nettogrof).

battlesnaketester's People

Contributors

devinc13 avatar nettogrof avatar niecore avatar

Stargazers

 avatar

Watchers

 avatar

battlesnaketester's Issues

Should send a /end request at the end

Several snake keep the "in-memory" a game state by game id, to be able to play several game at the same time.
BattlesnakeTester doesn't send the /end payload at the end, so the "game" remain in memory.

Switch to apiversion 1 answer.

BattleSnake switch to ApiVersion 1 and the old apiversion will be depreceated, see : Ending Support for Battlesnake API Version 0

All boards coordinate are switch upside-down, so there's two possibilities to fix that:

  1. Switch the coordinate in the request
  2. Switch the "correct" answer upside-down

I think the second option is way more easier.

New fields in the request

Battlesnake add new fields in the request .
example from Battlesnake docs
'{ "game": { "id": "game-00fe20da-94ad-11ea-bb37", "ruleset": { "name": "standard", "version": "v.1.2.3" }, "timeout": 500 }, "turn": 14, "board": { "height": 11, "width": 11, "food": [ {"x": 5, "y": 5}, {"x": 9, "y": 0}, {"x": 2, "y": 6} ], "hazards": [ {"x": 0, "y": 0} ], "snakes": [ { "id": "snake-508e96ac-94ad-11ea-bb37", "name": "My Snake", "health": 54, "body": [ {"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 2, "y": 0} ], "latency": "111", "head": {"x": 0, "y": 0}, "length": 3, "shout": "why are we shouting??", "squad": "" }, { "id": "snake-b67f4906-94ae-11ea-bb37", "name": "Another Snake", "health": 16, "body": [ {"x": 5, "y": 4}, {"x": 5, "y": 3}, {"x": 6, "y": 3}, {"x": 6, "y": 2} ], "latency": "222", "head": {"x": 5, "y": 4}, "length": 4, "shout": "I'm not really sure...", "squad": "" } ] }, "you": { "id": "snake-508e96ac-94ad-11ea-bb37", "name": "My Snake", "health": 54, "body": [ {"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 2, "y": 0} ], "latency": "111", "head": {"x": 0, "y": 0}, "length": 3, "shout": "why are we shouting??", "squad": "" } }'

New fields are:

  • ruleset (inside the game field)
  • hazards (inside the board field)
  • head (inside snake and you fields)
  • latency (inside snake and you fields)

Request Delay

Add a delay between request to not overload snake server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.