This is a simple terminal game written in JavaScript. The goal of the game is to navigate a field and find your hat without falling into a hole.
- Clone this repository:
git clone https://github.com/laariane/find-your-hat-game
- Navigate to the project directory:
cd yourrepository
- Install the necessary dependencies:
npm install
Run the game with the command: node main.js
-
The game field is represented as a grid. Each cell can be one of the following:
*
represents the player's current position.^
represents the hat. The goal is to reach this cell.O
represents a hole. If the player moves into a hole, they lose.░
represents open field. The player can safely move into these cells.
-
The player starts at the top-left corner of the field and can move one cell at a time in any of the four directions (up, down, left, or right).
-
The game ends when the player either finds the hat (and wins) or falls into a hole (and loses).