{"id":21135532,"url":"https://github.com/mrrobb/eda-game","last_synced_at":"2026-04-24T08:32:02.033Z","repository":{"id":98850344,"uuid":"112020692","full_name":"MrRobb/EDA-Game","owner":"MrRobb","description":"El juego de EDA","archived":false,"fork":false,"pushed_at":"2017-12-19T12:44:23.000Z","size":640,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T04:20:28.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/MrRobb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-25T17:09:10.000Z","updated_at":"2020-07-24T11:47:37.000Z","dependencies_parsed_at":"2023-05-25T20:45:36.944Z","dependency_job_id":null,"html_url":"https://github.com/MrRobb/EDA-Game","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MrRobb/EDA-Game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobb%2FEDA-Game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobb%2FEDA-Game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobb%2FEDA-Game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobb%2FEDA-Game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrRobb","download_url":"https://codeload.github.com/MrRobb/EDA-Game/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrRobb%2FEDA-Game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32216171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T08:24:32.376Z","status":"ssl_error","status_checked_at":"2026-04-24T08:24:26.731Z","response_time":64,"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":"2024-11-20T06:56:21.541Z","updated_at":"2026-04-24T08:32:02.017Z","avatar_url":"https://github.com/MrRobb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EDA-Game\n\n## Game Rules\n\n### Map\n\nSquare board made of cells of type:\n\n- Water: you can't walk through water\n- Grass\n- Forest\n- Sand\n- City\n- Path\n\nThe board is surrounded with water.\n\nCities are rectangles of cells of type CITY.\n\nPath are sequences of cells of type PATH.\n\n\u003e Paths connect cities and never cross each other.\n\n### Objective\n\nAt each round you have to command your orks.\n\nIf you try to give \u003e 1000 instructions ---\u003e game over\n\n### Orks\n\n#### Habilities\n\nOrks can:\n\n- Remain still\n- Move one cell (N, S, W, E)\n\nIf an ork receive more than one instruction, only the first one matters.\n\nIf you walk ---\u003e your health decreases.\n\nIf health negative ---\u003e ork dies and you have to regenerate them.\n\n#### Fight\n\n- Between orks of the **same player** ---\u003e the **instruction of moving is ignored**.\n\n\n- Orks of different players AND **(A_health - movement) \u003e B** ---\u003e **B dies**\n- Orks of different players AND **(A_health - movement) \u003c B** ---\u003e **A dies**\n- Orks of different players AND **(A_health - movement) == B** ---\u003e **random dies** (50%, 50%) and when it regenerates **the ork belongs to the winner player**.\n\n#### Death\n\nAn ork regenerates in a random position adjacent to the sea (GRASS, FOREST, SAND)\n\n### Points\n\nAt the end of the round:\n\n- Count the number of orks for earch player for each city\n- A_orks_on_city \u003e B_orks_on_city ---\u003e A conquers the city\n- A_orks_on_city \u003c B_orks_on_city ---\u003e B conquers the city\n- A_orks_on_city == B_orks_on_city ---\u003e nothing changes\n\n\u003e **points = bonus_per_city_cell() * size_of_the_city**\n\u003e\n\u003e **points = bonus_per_path_cell() * size_of_the_path**\n\u003e\n\u003e\n\u003e Graph of conquered cities (for each connected component):\n\u003e\n\u003e **points = factor_connected_component * (2 ^ cities)**\n\n### Workflow\n\n1. Register instructions of all players\n2. Execute them randomly\n3. Regenerate dead orks\n4. Computer points\n\n## Game Parameters\n\n```cpp\nint nb_players () const;    // number of players (4)\nint rows () const;          // number of rows of the board (70)\nint cols () const;       // number of columns of the board (70)\nint nb_rounds () const;     // number of rounds of the match (200)\n\nint initial_health () const;    // initial health of each ork (100)\nint nb_orks () const;           // number of orks each player controls initially\n\nint cost (CellType t) const;\nint cost_grass () const;        // cost in health of moving to a cell of type GRASS (1)\nint cost_forest () const;       // cost in health of moving to a cell of type FOREST (2)\nint cost_sand () const;         // cost in health of moving to a cell of type SAND (3)\nint cost_city () const;         // cost in health of moving to a cell of type CITY (0)\nint cost_path () const;         // cost in health of moving to a cell of type PATH (0)\n\nint bonus_per_city_cell () const;   // bonus in points for each cell in a conquered city (1)\nint bonus_per_path_cell () const;   // bonus in points for each cell in a conquered path (1)\nint factor_connected_component () const;    // factor multiplying the size of the connected components (2)\n\nbool player_ok (int pl) const;      // is playerid okay?\nbool pos_ok (int i, int j) const;   // is position inside the board\nbool pos_ok (Pos p) const;          // is position inside the board\nint me ();                          // returns my id\n```\n\n## State.hh\n\n```cpp\n// GENERAL\nint round () const;                 // current round\nint total_score (int pl) const;     // score of a player\ndouble status (int pl) const;       // percentage of cpu time used in the last round (0..1) if \u003c 0 ---\u003e user is dead\nvector\u003cint\u003e orks(int pl);           // returns the ids of all the orks of a player\n\n\n// CELL\nCell cell (int i, int j) const;     // copy of the cell (i, j)\nCell cell (Pos p) const;            // copy of the cell p\n\n\n// UNIT\nUnit unit (int id) const;           // returns information about the unit (0..nb_units())\nint nb_units () const;              // total number of orks in the game\n\n\n// CITY\ntypedef vector\u003cPos\u003e  City;          // CITY\nCity city(int id) const;            // returns information about the city (0..nb_cities())\nint nb_cities () const;             // total number of cities in the game\nint city_owner(int id) const;       // city owner\n\n\n// PATH\ntypedef pair\u003c pair\u003cint,int\u003e, vector\u003cPos\u003e \u003e  Path;   // PATH\nPath path(int id) const;            // returns information about the path (0..nb_paths())\nint nb_paths () const;              // total number of paths in the game\nint path_owner(int id) const;       // path owner\n```\n\n## Action.hh\n\n```cpp\n// COMMAND\nCommand (int id, Dir dir);          // create command (ork --\u003e direction)\nvoid execute(Command m);            // add command to the action (fails if a command is already present for this unit)\n```\n\n## Structs.hh\n\n```cpp\n// DIR\nenum Dir {\n  BOTTOM,    // South\n  RIGHT,     // East\n  TOP,       // North\n  LEFT,      // West\n  NONE,      // No direction\n  DIR_SIZE   // Artificial value, for iterating.\n};\ninline bool dir_ok (Dir dir);       // is_valid(direction)\n\n\n// POS\nPos (int i, int j);                                         // create position\nfriend ostream\u0026 operator\u003c\u003c (ostream\u0026 os, const Pos\u0026 p);     // print\nfriend bool operator== (const Pos\u0026 a, const Pos\u0026 b);        // equal\nfriend bool operator!= (const Pos\u0026 a, const Pos\u0026 b);        // not equal\nfriend bool operator\u003c (const Pos\u0026 a, const Pos\u0026 b);         // less than (sorting)\nPos\u0026 operator+= (Dir d);                                    // Increment to direction\nPos operator+ (Dir d) const;                                // Add direction\nPos\u0026 operator+= (Pos p);                                    // Increment position\nPos operator+ (Pos p) const;                                // Add position\n\n\n// CELL\nenum CellType {\n  WATER,\n  GRASS,\n  FOREST,\n  SAND,\n  CITY,\n  PATH,\n  CELL_TYPE_SIZE  // Artificial value, for iterating.\n};\nCell (CellType t, int unit, int city, int path);            // create cell\n/*\n    CellType type; // The type of cell.\n    int   unit_id; // The id of the unit on the cell if any, -1 otherwise.\n    int   city_id; // If type == CITY, the id of the city, -1 otherwise.\n    int   path_id; // If type == PATH, the id of the path, -1 otherwise.\n*/\n\n\n// UNIT\nUnit (int id, int pl, Pos p = Pos(0, 0), int health = 0);   // create unit\n/*\n    int id;        // The unique id for this unit during the game.\n    int player;    // The player that owns this unit.\n    Pos pos;       // The position on the board.\n    int health;    // The health of the unit.\n*/\n```\n\n## Settings.hh\n\n```cpp\nstatic string version ();   // game name and version\nint nb_players () const;    // number of players\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrobb%2Feda-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrrobb%2Feda-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrrobb%2Feda-game/lists"}