This project will build on the skills that you've learned after your first couple weeks of programming in JavaScript! You will build a command line application that plays a text-based adventure game.
Look here and here for a couple examples of the genre. Be creative!
A fun Google easter egg is to Google search text adventure
. From the results page right click on the page and inspect the console. You should find a game by Google.
This project imports an npm module called readline-sync
that allows the user to enter input to the terminal. The line at the top: const readline = require('readline-sync')
gives you access to this functionality
Use the following line to get user input:
let yourVariableHere = readline.question("Enter your name: ")
- Fork this repo
- Clone the forked repo to your machine
cd
to the cloned folder and typenpm install
in the terminal.- Create a file called
.gitignore
. - Inside of .gitignore write
node_modules/
- Complete the project
- Commit and Push your changes to your fork
- Submit a Pull Request back to the assignment repo
- Paste a link to your Pull Request (not your fork!) on Canvas and submit
- Cloning your project, running
npm install
andYOURPROJECTNAMEHERE.js
will start a game - No errors are logged to the console
- The game displays initial instructions about how to play and a welcome message
- Invalid entires are re-prompted
- There are at least 10 opportunities to make a decision
- The user must enter a string to make a decision
- The user must enter a number to make a decision
- The user is prompted to restart the game and can enter yes or no
- Entering no causes the program to terminate
- Entering yes begins the game again, wiping the previous state
Replace the link below with the link to your Trello project: