{"id":20629237,"url":"https://github.com/dcts/battle-bots","last_synced_at":"2026-02-12T03:06:24.999Z","repository":{"id":44982136,"uuid":"512793630","full_name":"dcts/battle-bots","owner":"dcts","description":"battle party 🎉","archived":false,"fork":false,"pushed_at":"2022-07-19T21:44:37.000Z","size":123,"stargazers_count":0,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T23:42:24.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"holochain-immersive/battle-bots","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-11T14:38:16.000Z","updated_at":"2022-07-12T14:04:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"43af7455-7f23-445d-be9b-f47b5751a9d7","html_url":"https://github.com/dcts/battle-bots","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcts/battle-bots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fbattle-bots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fbattle-bots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fbattle-bots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fbattle-bots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcts","download_url":"https://codeload.github.com/dcts/battle-bots/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fbattle-bots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273317746,"owners_count":25084033,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-16T13:42:14.400Z","updated_at":"2026-02-12T03:06:19.970Z","avatar_url":"https://github.com/dcts.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Battle-Bots: a Rust training\n\nThis is a gamified training to introduce Rust in a playful way.\n\n\n## Welcome!\n\nWelcome to the latest edition of Battle-Bots! As always, we have the greatests bots battling each other:\n\n- Yellow\n- Red\n- Grey\n- Blue\n\nLet's go ahead and run the battle:\n\n![Alt Text](battle.gif)\n\nOh-oh... We seem to have technical difficulties... Yellow, Red and Grey are malfunctioning! They appear to be stuck!\n\nWe need your help!\n\n## Your goals\n\nGo in `src/main.rs`, and follow the instructions from top to bottom:\n\n1. Fix the Yellow bot.\n   - Go to `src/yellow.rs`, and follow the instructions.\n2. Fix the Grey bot.\n   - Go to `src/grey.rs`, and follow the instructions.\n3. Fix the Red bot.\n\n   - Go to `src/red.rs`, and follow the instructions.\n\n4. Code your own decision making algorithm for Blue, and beat the other colors!\n   - Go to `src/blue.rs`, and follow the instructions.\n\n## Rules of the game\n\n- At the beginning of the game, there are 3 bots of 4 different colors, battling in a world of 10x30 cells.\n- Each bot has an energy level, starting with 9.\n  - When the energy level of the Bot reaches 0, the bot loses.\n  - The number of the bot in the terminal is its energy level.\n- Each bot has a chainsaw with which to attack the enemies.\n  - The chainsaw is represented as the arrow in the terminal (`↓`, `↑`, `←`, `→`).\n- Each bot has a shield with which to defend itself.\n\n  - The shield is represented by a bar (`|` or `—`).\n  - If both the chainsaw and the shield are in the same direction, then they are represented with an arrow with a bar (`⤈`, `⤉`, `⇷`, `⇸`).\n\n- Each turn, every bot decides to activate some actuators or not. There are 3 actuators:\n\n  - Move: bots can only move to one of its **adjacent positions (up, down, left or right)**.\n    - Each time the bot moves 6 steps, it gets tired and loses 1 energy.\n  - Rotate its chainsaw: clockwise or counterclockwise, a bot can attack an enemy:\n    - The chainsaw only makes damage when it is rotated towards an adjacent enemy, not when it's still in the direction of an enemy.\n  - Rotate its shield: also clockwise or counterclockwise:\n    - If the shield is in the direction of an adjacent attacking chainsaw, it will block the attack.\n    - The shield can resist some attacks from enemy chainsaws, but will be destroyed if it receives too many attacks.\n\n- Each turn, there is a possibility of resources spawning in any cell. Each resource contains an energy level.\n  - **Resources are white**, and its energy level is its number.\n- Whenever a bot moves into a space occupied by a resource, it consumes it and adds its energy gain to its own energy level.\n\n## Running a battle\n\nMake sure you have rust installed.\n\nIf you are running Ubuntu, make sure you have x11 installed: `sudo apt-get install libx11-dev`\n\n```bash\ncargo run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcts%2Fbattle-bots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcts%2Fbattle-bots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcts%2Fbattle-bots/lists"}