{"id":19736276,"url":"https://github.com/arnauld/codingame-code-buster","last_synced_at":"2026-05-10T12:37:21.858Z","repository":{"id":138356570,"uuid":"62511844","full_name":"Arnauld/codingame-code-buster","owner":"Arnauld","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-03T19:26:10.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T18:59:20.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arnauld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2016-07-03T19:25:46.000Z","updated_at":"2016-07-03T19:26:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c3496bf-ee4a-46f8-b5dd-745a5d4ceb85","html_url":"https://github.com/Arnauld/codingame-code-buster","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/Arnauld%2Fcodingame-code-buster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnauld%2Fcodingame-code-buster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnauld%2Fcodingame-code-buster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnauld%2Fcodingame-code-buster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arnauld","download_url":"https://codeload.github.com/Arnauld/codingame-code-buster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241062534,"owners_count":19902907,"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":[],"created_at":"2024-11-12T01:06:12.165Z","updated_at":"2026-05-10T12:37:21.806Z","avatar_url":"https://github.com/Arnauld.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# code-buster\n\nA Clojure library designed to ... well, that part is up to you.\n\n# Rules\n\n\nThe game is played on a map 16001 units wide and 9001 units high. \nThe coordinate X=0, Y=0 is the top left pixel.\n\nEach player controls a team of several busters. The teams start out at opposite corners of\nthe map, near their base. Ghosts are scattered across the map, and need to be trapped and \nbrought back to a player's base. Each ghost inside the base or trapped by a buster is worth\na point for the owner. However, you may lose a point if one of your busters releases \na ghost outside of your base.\n\n**The map works as follows:**\n\n* There are always 2 teams in play.\n* At the start of the game, each player is given a team id. This indicates on which corner their base is positioned. The top left corner (X=0, Y=0) is for team 0. The bottom right corner ( X=16000, Y=9000) is for team 1.\n* Fog makes it impossible to know the positions of ghosts and rival busters unless they are within 2200 units from one of your own busters.\n* Each buster has a unique id. Each ghost has a unique id. Ghosts and busters with the same id are not correlated.\n\n**Busters work as follows:**\n\n* Every turn, a buster may do one of the following actions: `MOVE`, `BUST`, `RELEASE` or `STUN`\n* `MOVE` followed by map coordinates will make the buster advance 800 units towards that point. The position will be rounded to the nearest integer.\n* `BUST` followed by a ghost's id will cause the buster to suck that ghost into his ghost trap if he is within a range of 1760 units around the target ghost but not closer than 900 units. Trapped ghosts are no longer visible on the map.\n* A buster may carry no more than 1 ghost at a time.\n* `RELEASE` will cause the buster to drop the ghost he is carrying back onto the map. If this is done within 1600 units of a corner of the map on which a base is positioned, the ghost is removed from play and secures a point for the base's owner.\n* `STUN` followed by a buster's id will make the buster shoot a bolt of lightning that will stun the target buster. A stunned buster cannot do anything for 10 turns. The buster's stun ability must recharge for 20 turns before it can be used again. Being stunned or attempting to stun will cause a buster to release any ghost he may be carrying.\n* A buster may only stun opponents within a 1760 unit radius.\n\n**Ghosts work as follows:**\n\n* Ghosts remain stationary unless busters are within 2200 units of them and they are not in the process of being trapped. In this case, they will move 400 units away from the mean position of the near busters.\n* If several busters attempt to trap a ghost with 0 stamina, the team with the most busters will take priority. Within that team, the closest buster will take the ghost. If both teams have an equal number of busters attempting to trap the ghost, it will not be trapped on that turn.\n* A ghost being carried by a buster will escape if that buster attempts to trap a different ghost.\n* Stamina does not regenerate.\n* The game ends once all ghosts have been captured or after the time limit of 400 turns.\n\nThe game state of every turn is given to you as a list of entities, each with an id, position, type, state and value.\n\nThe type will be:\n\n* 0 for a buster from team 0.\n* 1 for a buster from team 1.\n* -1 for a ghost.\n\nThe state will be:\n\n* For busters:\n  * 0: idle or moving buster.\n  * 1: buster carrying a ghost.\n  * 2: stunned buster.\n  * 3: buster in the process of trapping a ghost.\n* For ghosts, it is equal to the ghost's current stamina.\n\nThe value will be:\n\n* For busters:\n  * If the buster is carrying a ghost, that ghost's id.\n  * If the buster is stunned the number of turns until he can move again.\n* For ghosts, it is 0 unless several busters tied in trying to trap it, in which cas it is equal to the amount of busters that attempted to trap it on that turn.\n \n**Victory Conditions**\n\nHave captured more ghosts than the rival team at the end of the game.\n \n**Lose Conditions**\n\n* Your program provides unrecognized output.\n* Your program times out.\n* You have less ghosts than the opponent at the end of the game.\n \n## Note\n\nThe program must first read within an infinite loop, read the contextual data from the standard input and provide to the standard output the desired instructions.\n \tGame Input\n\n**Initialization input**\n\n* Line 1: an integer bustersPerPlayer for the amount of busters each team controls.\n* Line 2: an integer ghostCount for the amount of ghosts available on the map.\n* Line 3: an integer myTeamId for the team you are playing as.\n\n**Input for one game turn**\n\n* Line 1: an integer entities for the amount of entities on the map that are visible to you.\n* Next entities lines: 6 space separated integers entityId, x, y, entityType, state \u0026 value. \n\nRepresents a buster or a ghost.\n\n**Output for one game turn**\n\nOne line for each buster: one of the following:\n\n* `MOVE` followed by two integers x and y\n* `BUST` followed by one integer ghostId\n* `RELEASE`\n* `STUN` followed by one integer busterId\n\nYou may append text to your instructions, it will be displayed in the viewer.\n\nConstraints\n\n* 2 ≤ bustersPerPlayer ≤ 5\n* 8 ≤ ghostCount ≤ 28\n\nResponse time per turn ≤ 100ms\n\nWhat is in store for me in the higher leagues ?\nThe extra rule available in higher leagues is:\nGhosts with endurance, who take several turns to successfully trap.\n\n## Developers\n\n    (require '[clojure.test :refer [run-tests]])\n    (require 'Player-test)\n    (run-tests 'Player-test)\n    (Player-test/do-think-case-3)\n    \n    \n* [Using Potential Fields in a Real-time Strategy Game Scenario](http://aigamedev.com/open/tutorials/potential-fields/)\n* \n\n## License\n\nCopyright © 2016 FIXME\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnauld%2Fcodingame-code-buster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnauld%2Fcodingame-code-buster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnauld%2Fcodingame-code-buster/lists"}