{"id":49651383,"url":"https://github.com/bmd007/code-wars","last_synced_at":"2026-05-06T04:34:50.269Z","repository":{"id":252403772,"uuid":"838538568","full_name":"bmd007/code-wars","owner":"bmd007","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-29T22:43:42.000Z","size":1027,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T23:31:32.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmd007.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-05T21:11:22.000Z","updated_at":"2024-11-22T19:45:18.000Z","dependencies_parsed_at":"2024-08-09T15:12:14.938Z","dependency_job_id":"8ad12896-df3d-4cce-ab0d-0642a5ee88f9","html_url":"https://github.com/bmd007/code-wars","commit_stats":null,"previous_names":["bmd007/code-wars"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bmd007/code-wars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmd007%2Fcode-wars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmd007%2Fcode-wars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmd007%2Fcode-wars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmd007%2Fcode-wars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmd007","download_url":"https://codeload.github.com/bmd007/code-wars/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmd007%2Fcode-wars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32678766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-05-06T04:34:49.379Z","updated_at":"2026-05-06T04:34:50.255Z","avatar_url":"https://github.com/bmd007.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CODE WARS\nA game platform for learning programming, datastructures and algorithms.\nYou can code your own player and compete with others.\n\n### Playing the game manually locally:\n    1- Clone the repository\n    2- Make sure you have Java 22 installed + docker\n    3- Run `docker-compose -f kafka-compose.yml up`\n    4- cd engine\n    5- Run `./gradlew bootRun --args='--spring.profiles.active=local'`\n    6- open localhost:8080 in your browser\n\n## Writing code to play the game:\nYou need to make changes to the [player-client](player-client) project to write your own player.\nWhat your player code needs to do:\n\n    1- Get the latest state of the game from the engine by calling the REST API. `GET http://${gameEngineHost}:8080/games/current`.\n    2- Decide on the next move.\n    3- Send a GameCommand.java to the game engine as a kafka message. PlayerClient.java has an example of how to send a message to the game engine. \n\nAs long as you can send commands to the Kafka topic and read the latest state of the game from the REST API, you can write your player in any language you want.\nYou just need to provide a Docker image name to the [game-orchestra-compose.yml](game-orchestra-compose.yml) file.\nThe real tournament will also be played using Docker images/containers.\n\nThere is no limitation on what method and technology you use to decide the next move. Just keep in mind that the engine tries it's best to keep the game fair.\nFor example, the engine will only process one command from each player at a time.\nThe rest API to fetch the latest state of the game is also rate limited to prevent spamming (TODO!).\nThe rules about resource (CPU, memory, etc.) usage will be defined in each tournament. But there should be no strange limitations. \nThis is not going to be an efficiency contest.\n\n## Game story:\nThe game is a 2D grid where each cell can be empty, a wall, or a tank (player).\nThere are only two tanks in the game and destruction of one of the tanks ends the game.\nOne hit is enough to destroy a tank.\nThe tanks can move in 4 directions (up, down, left, right) and can shoot in 4 directions.\nThe walls can be destroyed by shooting at them as well. \nOne hit is enough to destroy a wall.\n\n### Running your code against itself:\n    1- In the player-client/build.gradle file, change bootBuildImage.imageName to your desirable docker image name\n    2- Replace `bmd007/codewars-player` in the game-orchestra-compose.yml file with your docker image name (corresponding to the previous step)\n    3- Finish the implementation of player-client\n    4- Run `./gradlew bootBuildImage` in the engine directory\n    4- Run `./gradlew bootBuildImage` in the player-client directory\n    6- Run `docker-compose -f game-orchestra-compose.yml up`\n    7- Now your code will be playing against itself\n    8- Watch the game on localhost:8080 (do not use the buttons on the UI meaning do not interfere with the game, just watch! :)) )\n\n## Tournament:\nIn order to register for the tournament, add a comment to https://github.com/bmd007/code-wars/issues/1\n\n#TODO\n - application ([tournament-orchestrator](tournament-orchestrator)) that fills the [tournament-orchestrator-compose.yml.template](tournament-orchestrator%2Fsrc%2Fmain%2Fresources%2Ftournament-orchestrator-compose.yml.template) and starts games\n - [engine](engine)\n - sample player [player-client](player-client)\n - [leaderboard](leaderboard) app\n - game visualizer\n - map maker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmd007%2Fcode-wars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmd007%2Fcode-wars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmd007%2Fcode-wars/lists"}