{"id":20287130,"url":"https://github.com/devcsrj/mazerunner","last_synced_at":"2025-04-11T09:40:41.579Z","repository":{"id":51426358,"uuid":"170037724","full_name":"devcsrj/mazerunner","owner":"devcsrj","description":"🏃‍♀️🏃WebSocket maze - TORO Cloud's 2019 IT Elite Challenge Backend","archived":false,"fork":false,"pushed_at":"2021-05-11T23:24:58.000Z","size":4914,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T06:40:35.475Z","etag":null,"topics":["competitive-programming","maze","websocket"],"latest_commit_sha":null,"homepage":"https://www.torocloud.com/it-elite","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devcsrj.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}},"created_at":"2019-02-10T23:04:39.000Z","updated_at":"2024-02-29T08:03:26.000Z","dependencies_parsed_at":"2022-09-25T01:40:12.874Z","dependency_job_id":null,"html_url":"https://github.com/devcsrj/mazerunner","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fmazerunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fmazerunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fmazerunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devcsrj%2Fmazerunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devcsrj","download_url":"https://codeload.github.com/devcsrj/mazerunner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248369033,"owners_count":21092511,"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":["competitive-programming","maze","websocket"],"created_at":"2024-11-14T14:38:24.257Z","updated_at":"2025-04-11T09:40:41.554Z","avatar_url":"https://github.com/devcsrj.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mazerunner\n\n![](demo.png)\n\nA websocket-based maze application.\n\nGiven a websocket endpoint, a websocket client can connect and navigate across the maze, in search for the trophy room. \n\n## Running\n\n### Server\n\nLike any other Maven-based application, build the project with:\n\n```bash\n$ ./mvnw install\n```\n\nThis produces a jar file under `target/` directory, which you can also run as a standalone server:\n\n```bash\n$ cd target/\n$ java -jar mazerunner-1.0.1.jar\n```\n\nThen access the maze at [localhost:8999/maze](localhost:8999/maze).\n\nIf you're using Docker, you can also spin up an instance with:\n\n```bash\n$ docker run -p 8999:8999 devcsrj/mazerunner:1.0.1\n```\n\n### Client\n\nThis project also provides various solutions to the maze, [written in Go](https://golang.org/).\n\n```bash\n$ cd solutions/\n$ go run ./ --alg=\"pledge\"\n```\n\nThe start script also provides various flags:\n\n* `--addr` (localhost:8999) - The server address\n* `--id` (ninja) - The runner id\n* `--name` (TOGO) - The runner name\n* `--alg` (headless) - The algorithm to use: \n    * `dijkstra` - [Dijkstra](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)\n    * `headless` - [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) with Random heuristics\n    * `a*man` - [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) + [Manhattan](https://en.wiktionary.org/wiki/Manhattan_distance)\n    * `a*diag` - [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) + [Diagonal](https://en.wikipedia.org/wiki/Chebyshev_distance)\n    * `a*euc` - [A*](https://en.wikipedia.org/wiki/A*_search_algorithm) + [Euclidian](https://en.wikipedia.org/wiki/Euclidean_distance)\n    * `pledge` - [Pledge](https://en.wikipedia.org/wiki/Maze_solving_algorithm#Pledge_algorithm)\n    * `dfs` - [Depth-First Search](https://en.wikipedia.org/wiki/Depth-first_search)\n* `--verbose` (true) - Whether to print the moves taken\n\nYou can also run all of the available solutions using the shell script:\n\n```bash\n$ cd solutions/\n$ ./run_all.sh\n```\n\n### Mechanics\n\nClients can connect to the server by specifying the header `x-runner-tag`. Using \n[wscat](https://github.com/websockets/wscat), I can connect with:\n\n```bash\n$ wscat --header x-runner-tag:devcsrj:Reijhanniel --connect ws://localhost:8999/maze/move\n```\n\nNavigating around the maze is done by exchanging coordinates in the form of `(x,y)`:\n\n```\n\u003e (-1,-1)\n\u003c (32,0)[(32,1)]\n```\n\nSending `(-1,-1)` as coordinates sends the current position. In the above response, \n`(32,0)` is the current position, while `(32,1)` is the neighboring room. Sending \n`(32,1)` moves the runner to the next room:\n\n```\n\u003e (32,1)\n\u003c (32,1)[(32,0),(32,2)]\n```\n\nThe goal is to reach the room containing the trophy, determined at [localhost:8999/maze/goal](localhost:8999/maze/goal).\n\nMoving to a coordinate unreachable from the current position disconnects the runner.\n\n## Developing\n\nThe server side is based on Spring-Boot. Start the server with:\n\n```bash\n$ ./mvnw spring-boot:run\n```\n\nThe client side is powered by Vue. Start the server with:\n\n```bash\n$ cd src/main/frontend\n$ npm run serve\n```\n\n## Background\n\nThis project is a maze-based competition application built for TORO Cloud's 2019 [IT Elite Challenge](https://www.torocloud.com/it-elite), \nrecently held last February 15, 2019, at the University of Assumption, San Fernando, Pampanga, Philippines.\n\nThe event is an annual challenge tailored for the universities and colleges in the region. The participating teams are \nthose who have made it passed an earlier qualifying round.\n\nAlso, I needed an excuse to write in:\n* [Kotlin](https://kotlinlang.org/) + [Spring Reactive](https://docs.spring.io/spring-framework/docs/5.0.0.M1/spring-framework-reference/html/web-reactive.html)\n* [Vue.js](https://vuejs.org/)\n* [Go](https://golang.org/)\n\n## Credits\n\n* Sprite assets from https://www.models-resource.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcsrj%2Fmazerunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcsrj%2Fmazerunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcsrj%2Fmazerunner/lists"}