Constructor-Word-Guess
About the Code
- This is a Command Line app.
- Javascript is the main language used for coding.
- I have used Constructor Functions and Prototypal Inheritance to connect the various objects in the code.
- npm inquirer package is used for asking questions in the command line.
Things to do before you clone/download
- If you plan to clone this app then make sure you have the current/recommended version of node.js installed in your computer.
- You will need to run
npm init -y
in your terminal to install the package.json
file
- Then run
npm install inquirer
to install the npm inquirer package which is the core of this app.
Part One Shapes
- To run this file, go to the folder of this project in your terminal and type
node part1-shape.js
- This commmand logs the name, area, perimeter and number of sides of a square and rectangle in the terminal.
Part Two Survivor-Monster
- To run this file, go to the folder of this project in your terminal and type
node part2-monster.js
- This command prompts you to guess a number between 1 and 30.
- If your guess matches the pre-selected number by the app then, you win the game.
- If your guess is wrong then you are attacked by a monster and you are notified of your loss of health which is equal to the attack power of the monster.
- If your health goes below 0 then you lose the game.