{"id":13693169,"url":"https://github.com/xtagon/battlesnake-rules-wasm","last_synced_at":"2026-01-12T07:35:40.967Z","repository":{"id":139001339,"uuid":"340160591","full_name":"xtagon/battlesnake-rules-wasm","owner":"xtagon","description":"WebAssembly port of the Battlesnake rules.","archived":false,"fork":false,"pushed_at":"2021-09-18T18:08:57.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"edge","last_synced_at":"2025-05-02T19:11:49.573Z","etag":null,"topics":["ai","battlesnake","battlesnake-community","competitive-games","game-development","game-logic","game-rules","gamedev","golang","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtagon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-02-18T19:49:16.000Z","updated_at":"2021-09-18T18:08:59.000Z","dependencies_parsed_at":"2024-04-08T02:31:54.147Z","dependency_job_id":null,"html_url":"https://github.com/xtagon/battlesnake-rules-wasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtagon%2Fbattlesnake-rules-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtagon%2Fbattlesnake-rules-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtagon%2Fbattlesnake-rules-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtagon%2Fbattlesnake-rules-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtagon","download_url":"https://codeload.github.com/xtagon/battlesnake-rules-wasm/tar.gz/refs/heads/edge","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252108806,"owners_count":21696139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","battlesnake","battlesnake-community","competitive-games","game-development","game-logic","game-rules","gamedev","golang","webassembly"],"created_at":"2024-08-02T17:01:06.484Z","updated_at":"2026-01-12T07:35:40.939Z","avatar_url":"https://github.com/xtagon.png","language":"Go","funding_links":[],"categories":["Game Rules and Logic"],"sub_categories":[],"readme":"# Battlesnake Rules Wasm\n\nThis is a WebAssembly port of the [Battlesnake rules][rules].\n\nThe goal is to enable executing [Battlesnake][battlesnake] game rules in\nenvironments such as web browsers, Node.js, and Electron.\n\n## Status\n\nThis project is experimental and your milage may vary.\n\n## Supported Rulesets\n\n- [x] Standard\n- [x] Solo\n- [x] Constrictor\n- [ ] Squad\n- [ ] Royale\n\n## Known Issues\n\n- Poor memory management\n- Large WASM binary size\n- Use of Go's `syscall/js` which is also marked as experimental\n- Lack of automated tests\n\nContributions welcome!\n\n## How to Use\n\n### Prerequisites\n\n- Go 1.15\n- GNU Make (Optional)\n\n### Compiling\n\nIf GNU Make is available:\n\n```shell\nmake\n```\n\nIf GNU Make is not available, read `Makefile` to know how to build without it.\n\n### Loading WebAssembly\n\nAfter compiling, copy the files in `/dist` to your project, including\n`main.wasm` and `wasm_exec.js`, so that you can instantiate it using\nWebAssembly. See `examples/index.html` for a basic example.\n\nAfter it is loaded, a `window.BattlesnakeRules` or `global.BattlesnakeRules`\nwill be set which is an object containing the exported functions. Typically the\nglobal will be scoped to `window` in browsers, or `global` in environments such\nas Node.js and Electron.\n\n### Exported Functions\n\nAll functions require a single argument, which is expected to be a JSON-encoded\nstring. The JSON fields are interpreted as options for each function.\n\nLikewise, the return value will be a JSON-encoded string in the case of\nsuccess, or null in the case of an error.\n\nSee `examples/index.html` for some examples of the option signature for each\navailable function. That example page also loads `main.wasm` file if you have\ncompiled it, which means you can try out those functions straight from that\npage using your browser's JavaScript console.\n\nDocumentation is currently sparse, so you may need to read the source code of\n`main.go` and possibly even the types defined upstream in the\n[BattlesnakeOfficial/rules][rules] source code.\n\n## Open Invite\n\nIf you have any questions, or just wish to geek out and chat about Battlesnake\nfeel free to reach out!\n\nIf you're using this library for a project, I'd love to hear about it.\n\nYou can reach me at [xtagon@gmail.com](mailto:xtagon@gmail.com), or catch me in\n[Battlesnake Discord][battlesnake-discord] (username: `@xtagon`).\n\n## License\n\nThis project is released under the terms of the [MIT License](LICENSE.txt).\n\n[battlesnake]: https://play.battlesnake.com/\n[battlesnake-discord]: https://play.battlesnake.com/discord/\n[rules]: https://github.com/BattlesnakeOfficial/rules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtagon%2Fbattlesnake-rules-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtagon%2Fbattlesnake-rules-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtagon%2Fbattlesnake-rules-wasm/lists"}