Skip to content

Instantly share code, notes, and snippets.

@kigiri
Last active July 26, 2018 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kigiri/7ab523c5add824ff9141fed787424731 to your computer and use it in GitHub Desktop.
Save kigiri/7ab523c5add824ff9141fed787424731 to your computer and use it in GitHub Desktop.
initial raiders of nan ai
// code here...
const update = state => {
const { cell } = state
const cells = [
cell + 1,
cell - 1,
cell + 14,
cell - 14,
].filter(_ => _)
return move(cells[Math.floor(Math.random() * 4)])
}
{
"name": "random",
"aiUrl": "https://gist.githubusercontent.com/kigiri/7ab523c5add824ff9141fed787424731/raw/dc2067277a82e18c29af44da353a07a714487913/ai.js",
"distribution": {
"tenacity": 0.5,
"power": 0.5,
"luck": 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment