{"id":40470404,"url":"https://github.com/barbaraeguche/risk-warzone","last_synced_at":"2026-01-20T18:16:43.585Z","repository":{"id":319948431,"uuid":"1061422022","full_name":"barbaraeguche/risk-warzone","owner":"barbaraeguche","description":"䷆ a simplified implementation of the \"Risk\" computer game in c++ for comp 345.","archived":false,"fork":false,"pushed_at":"2025-12-28T05:35:43.000Z","size":7298,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-30T12:20:37.121Z","etag":null,"topics":["cpp","gamedev","oops-in-cpp","risk-warzone","warzone"],"latest_commit_sha":null,"homepage":"","language":"C++","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/barbaraeguche.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-21T21:43:50.000Z","updated_at":"2025-12-28T05:40:16.000Z","dependencies_parsed_at":"2025-10-21T05:25:48.542Z","dependency_job_id":"dd8037d4-f182-4b74-9d07-48476dad1109","html_url":"https://github.com/barbaraeguche/risk-warzone","commit_stats":null,"previous_names":["barbaraeguche/comp-345","barbaraeguche/risk-warzone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/barbaraeguche/risk-warzone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbaraeguche%2Frisk-warzone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbaraeguche%2Frisk-warzone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbaraeguche%2Frisk-warzone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbaraeguche%2Frisk-warzone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barbaraeguche","download_url":"https://codeload.github.com/barbaraeguche/risk-warzone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbaraeguche%2Frisk-warzone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28608616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: 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":["cpp","gamedev","oops-in-cpp","risk-warzone","warzone"],"created_at":"2026-01-20T18:16:43.406Z","updated_at":"2026-01-20T18:16:43.530Z","avatar_url":"https://github.com/barbaraeguche.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# risk-warzone ䷆\na c++ implementation of a simplified \"risk\" computer game, compatible with the warzone version of risk. this was made \nas part of our **comp 345 cumulative project**.\n\n## game description 🎮\nwarzone is a turn-based strategy game where 2-6 players compete to conquer all territories on a map. the game map is \nrepresented as a connected graph where:\n- each node represents a territory owned by a player\n- edges represent adjacency between territories\n- territories are grouped into continents (connected subgraphs)\n- each continent provides bonus reinforcements when fully controlled\n\n**objective:** conquer all territories on the map by deploying armies and attacking adjacent territories.\n\n## features 👾\n- **map system:** connected graph implementation with conquest map file loader and validation\n- **player strategies:** human, aggressive, benevolent, neutral, and cheater players using strategy pattern\n- **order system:** deploy, advance, bomb, blockade, airlift, and negotiate orders with validation\n- **card mechanics:** deck and hand management with special ability cards\n- **game engine:** complete startup, reinforcement, issuing, and execution phases\n- **command processing:** console and file input with adapter pattern\n- **observer logging:** game events logged to file using observer pattern\n- **tournament mode:** automated multi-game tournaments comparing player strategies\n\n## challenges faced 💢\n- **double-free segfaults:** attempted to free a non-owning object that had already been freed by its destructor.\n\n## what we learned 💭\n- **modern c++:** smart pointers, RAII principles, move semantics, and c++20 features like `std::ranges`.\n- **memory management:** ownership semantics, avoiding memory leaks through proper destructor implementation, and\nunderstanding the rule of three/five for resource management.\n\n## running the project 🏁\n\n### prerequisites\n- **ensure a [c++ compiler](https://en.cppreference.com/w/cpp/20.html) is installed:** this project uses c++20.\n- **ensure [cmake3.10+](https://cmake.org/download/) is installed:** this project uses v3.10.\n\n### setup instructions\n1. **clone the repository**\n```bash\ngit clone https://github.com/barbaraeguche/risk-warzone.git\n```\n\n2. **navigate to the project directory**\n```bash\ncd risk-warzone\n```\n\n3. **generate build files**\n```bash\ncmake . -B ./build\n```\n\n4. **build the project**\n```bash\ncmake --build build\n```\n\n5. **run the program**\n```bash\n./build/Debug/risk_warzone  # windows\n./build/bin/risk_warzone    # mac\n```\n\n## game rules 🎲\n- ### reinforcement\n  - territories ÷ 3 (min 3)\n  - continent bonuses\n\n- ### combat\n  - attacker: 60% kill rate\n  - defender: 70% kill rate\n  - card on conquest (max 1/turn)\n\n- ### execution\n  1. deploy orders first\n  2. other orders round-robin\n  3. validation on execution\n\n## references ⛓️‍💥\n- [warzone](https://www.warzone.com/)\n- [conquest maps](http://www.windowsgames.co.uk/conquest_maps.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbaraeguche%2Frisk-warzone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarbaraeguche%2Frisk-warzone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbaraeguche%2Frisk-warzone/lists"}