A collection of four simple JavaScript projects for beginners. Each project self-contained and could be ran in terminal.
A simple quiz game that tests your knowledge of computer hardware. Answer three questions and get your score at the end.
How to run:
node project1.js
What is the brain of the computer?
> CPU
You got it correct!
What is better a 3090ti or a 4060?
> 4060
You got it wrong...
What was the reccomend amount of RAM in 2023?
> 16GB
You got it correct!
You got 2 questions correct!
Your score 67%
Try to guess a randomly generated number between 0 and 100. The game will tell you if your guess is too high or too low.
How to run:
node project2.js
Guess a number between 0 and 100:
> 50
Too low!
> 75
Too high!
> 62
Correct! You guessed the number in 3 tries.
Play rock, paper, scissors against the computer. The game keeps track of your wins, losses, and ties.
How to run:
node project3.js
If you win
Choose rock, paper, or scissors:
> rock
Computer chose scissors.
You win!
Play again? (y/n)
> n
Wins: 1, Losses: 0, Ties: 0
If you tie
Choose rock, paper, or scissors:
> paper
Computer chose paper.
It's a tie!
If you lose
Choose rock, paper, or scissors:
> scissors
Computer chose rock.
You lose!
A short text-based adventure game where your choices determine the outcome.
How to run:
node project4.js
If you win
Would you like to play (y/n)?
> y
Would you like to go left or go right (left/right)?
> right
Would you like to cross the bridge, or turn around and find another way (cross/turn)?
> cross
You cross the bridge and reach the end of the game!
If you lose
Would you like to play (y/n)?
> y
Would you like to go left or go right (left/right)?
> left
Oops, you go left and fall of a bridge! You lost!
If you not playing
Would you like to play (y/n)?
> n
That's too bad!