Skip to content

ziaroque/codecademy-find-your-hat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find Your Hat

An interactive terminal maze-solving game.

Overview

This project is one of Codecademy's challenge projects within their Intermediate JavaScript course.

Project

Scenario

The player has lost their hat (^) in a field full of holes (O), and they must navigate back to it without falling down one of the holes or stepping outside of the field.

Status

In Progress..

Requirements

  • The project is centered on a Field class. The Field constructor should take a two-dimensional array argument representing the “field” itself.
  • Give the Field class a .print() method that prints the current state of the field.
  • The game should be playable by users. They should be prompted input and be able to indicate which direction they'd like to move.
  • 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.
  • When any of the below occur, let the user know and end the game:
    • The player wins by finding their hat.
    • The player loses by landing on (and falling in) a hole.
    • The player attempts to move “outside” the field.
  • Add a .generateField() static method to the Field class. This 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. Add a third percentage argument used to determine what percent of the field should be covered in holes.
  • Give the Field class a static .generateField() method that takes arguments for height and width of the field, and returns a randomized two-dimensional array representing the field with a hat and one or more holes.

Extensions

  • Have the character start on a random location that’s not the upper-left corner.
  • Create a “hard mode” where one or more holes are added after certain turns.
  • Improve game graphics and interactivity in the terminal.
  • Create a field validator to ensure that the field generated by Field.generateField() can actually be solved.

Technologies Used

About

An interactive terminal maze-solving game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published