{"id":23307298,"url":"https://github.com/simonapiz/find-your-hat","last_synced_at":"2026-04-29T00:34:43.665Z","repository":{"id":116029946,"uuid":"460815487","full_name":"SimonaPiz/Find-Your-Hat","owner":"SimonaPiz","description":"An Interactive Terminal Game with JavaScript and User Input","archived":false,"fork":false,"pushed_at":"2023-05-11T14:11:56.000Z","size":2213,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T00:48:28.267Z","etag":null,"topics":["codecademy-solutions","javascript","node","terminal-game"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/SimonaPiz.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":"2022-02-18T10:53:07.000Z","updated_at":"2023-06-22T10:35:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b816f70-b1fa-44af-9257-25fd00d9bec7","html_url":"https://github.com/SimonaPiz/Find-Your-Hat","commit_stats":null,"previous_names":["simonapiz/find-your-hat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FFind-Your-Hat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FFind-Your-Hat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FFind-Your-Hat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonaPiz%2FFind-Your-Hat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonaPiz","download_url":"https://codeload.github.com/SimonaPiz/Find-Your-Hat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574095,"owners_count":20960495,"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":["codecademy-solutions","javascript","node","terminal-game"],"created_at":"2024-12-20T12:29:52.499Z","updated_at":"2026-04-29T00:34:43.582Z","avatar_url":"https://github.com/SimonaPiz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Find Your Hat\n\u003e An interactive terminal game with JavaScript classes and user input\n\n### Demo\n![find-your-hat-demo](https://github.com/SimonaPiz/Find-Your-Hat/assets/91121660/23b54cf1-bc10-4991-ad13-da72becfde89)\n\n## Table of contents\n* [About this project](#about-this-project)\n* [Objective](#objective)\n* [Technologies](#technologies)\n* [Setup](#setup)\n\n## About this project\n\nIn this project, I build an interactive terminal game. The scenario is that the player has lost their hat in a field full of holes, and they must navigate back to it without falling down one of the holes or stepping outside of the field.\n\n## Objective\n### Implement Field\nThe project is centered on a Field class. Use a two-dimensional array representing the “field” itself. A field consists of a grid containing:\n- “holes” (`O`)\n- one “hat” (`^`)\n- a neutral background character (`░`) to indicate the rest of the field itself.\n- The player will begin in the upper-left of the field, and the player’s path is represented by (`*`).\n\n`.generateField()` static method should at least take arguments for height and width of the field, and it should return a randomized two-dimensional array representing the field with a hat and one or more holes.\n\u003e extra: add a third argument used to determine what percent of the field should be covered in holes.\n\n### Implement User Input\nThe game should be playable by users:\n  - When a user runs **main.js**, they should be prompted for input and be able to indicate which direction they’d like to “move”.\n  - After entering an instruction, the user should see a printed result of their current field map with the tiles they have visited marked with `*`. They should be prompted for their next move.\n\nThis should continue until the user either:\n\n  - Wins by finding their hat.\n  - Loses by landing on (and falling in) a hole.\n  - Attempts to move “outside” the field.\n\n## Technologies\n- JavaScript\n- Node.js\n- prompt-sync 4 - (*A sync prompt for node*)\n\n## Setup\nTo run this project, install it locally using npm:\n\n```\n$ cd ../[directory]\n$ npm install\n$ node main.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonapiz%2Ffind-your-hat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonapiz%2Ffind-your-hat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonapiz%2Ffind-your-hat/lists"}