{"id":23869478,"url":"https://github.com/fredwu/xplor_robot","last_synced_at":"2026-06-20T17:32:04.581Z","repository":{"id":192011199,"uuid":"217455098","full_name":"fredwu/xplor_robot","owner":"fredwu","description":"Xplor Child Care Robot.","archived":false,"fork":false,"pushed_at":"2019-10-26T05:58:51.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T17:32:45.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/fredwu.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-25T05:06:22.000Z","updated_at":"2023-09-01T06:51:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe572653-f166-49ce-8cd7-f1e1b25be107","html_url":"https://github.com/fredwu/xplor_robot","commit_stats":null,"previous_names":["fredwu/xplor_robot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fredwu/xplor_robot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fxplor_robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fxplor_robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fxplor_robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fxplor_robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredwu","download_url":"https://codeload.github.com/fredwu/xplor_robot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredwu%2Fxplor_robot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34580039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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":"2025-01-03T12:35:38.419Z","updated_at":"2026-06-20T17:32:04.574Z","avatar_url":"https://github.com/fredwu.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xplor Robot\n\n## Intro\n\nWe are inventing an Xplor child care robot that could take care of the basic\ntasks an educator does on a daily basis, such as nappy changes and sleep checks, etc.\n\n## Rules\n\n- Given a baby room in a grid layout, shown below\n- There is one and only one Xplor robot in the room\n- There are multiple babies in the room\n- The babies all have different needs, i.e. the robot needs to perform different tasks on them\n\n### Robot’s Movement Rules\n\n- The robot starts at origin (bottom left of the grid), i.e. `0, 0`\n- The robot moves on the grid to perform tasks, it can only move in left, right, up and down, no diagonal movements are allowed\n- Each movement from one grid cell to another takes one turn\n- Each task takes one turn to complete, e.g. moving from one grid cell to another, then performing a task, in this case would consume two turns\n- Switching between different types of tasks to perform also takes one turn, e.g. after having completed nappy change, moving from cell `1, 1` to `2, 2` to perform sleep check will take a total of 4 turns - 2 turns for movement, 1 turn for task switching and 1 turn for performing the task itself\n\n## The Baby Room\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"20%\"\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\n      \u003cstrong\u003eBaby\u003c/strong\u003e\n      \u003cul\u003e\n        \u003cli\u003eSleep check\u003c/li\u003e\n        \u003cli\u003eFood\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\n      \u003cstrong\u003eBaby\u003c/strong\u003e\n      \u003cul\u003e\n        \u003cli\u003eNappy change\u003c/li\u003e\n        \u003cli\u003eSleep check\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"20%\"\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\n      \u003cstrong\u003eBaby\u003c/strong\u003e\n      \u003cul\u003e\n        \u003cli\u003eNappy change\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"20%\"\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\n      \u003cstrong\u003eBaby\u003c/strong\u003e\n      \u003cul\u003e\n        \u003cli\u003eNappy change\u003c/li\u003e\n        \u003cli\u003eSleep check\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"20%\"\u003e\u003cstrong\u003eROBOT\u003c/strong\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"20%\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## The Challenge\n\nCalculate the number of turns required for the robot to complete all tasks for\nall babies.\n\nBonus: Calculate the most optimal path for the robot to complete all tasks, i.e.\nthe robot completes all tasks using the least amount of turns.\n\n### Required Outputs\n\n1. The number of turns\n2. The path that the Xplor robot walked\n\n\u003e Note: there is no defined structure for how the path should be output or displayed, as long as it clearly demonstrates __how__ you got to the number of turns result.\n\n---\n\n## Reference Solution\n\nBrute Force.™\n\n### Run test suite\n\n```\nmix test\n```\n\n### Run test suite with the shortest path output\n\n```\nmix test --include report\n```\n\n## Copyleft\n\nLicensed under [MIT](http://fredwu.mit-license.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredwu%2Fxplor_robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredwu%2Fxplor_robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredwu%2Fxplor_robot/lists"}