All successful programmers work hard. But they need to relax too. A way to get relaxed is to play computer games. In this project, I created a question game with the help of the curl utility.
The game will not work on any machine, unless authorized and configured for JetBrains Academy.
The game was developed on an internal network using an interal API.
# clone the repo
$ git clone https://github.com/bltomlin/trueOrFalse
# change the working directory to trueOrFalse
$ cd trueOrFalse
# run trueOrFalse
$ bash trueOrFalse
Example 1:
Welcome to the True or False Game!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 2
File not found or no scores in it!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 3
File not found or no scores in it!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 0
See you later!
Example 2:
Welcome to the True or False Game!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 1
What is your name?
> hyper
Pong is the first commercially successful video game
True or False?
> True
You are a genius!
The first mechanical computer - The Babbage Difference Engine - was designed by Charles Babbage in 1922
True or False?
> False
Wonderful!
Rihanna is a rugby player
True or False?
> False
Awesome!
Bright brothers had invented the first successful airplane
True or False?
> False
You are a genius!
The heaviest land mammal is the African bush elephant
True or False?
> False
Wrong answer, sorry!
hyper you have 4 correct answer(s).
Your score is 40 points.
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 1
What is your name?
> jet
The International Space Station circles the globe every 900 minutes
True or False?
> False
You are a genius!
The Sun is 109 times wider than Earth
True or False?
> True
Wonderful!
John Bardeen - Walter Brattain - William Shockley invented the first working transistors at Bell Labs
True or False?
> False
Wrong answer, sorry!
jet you have 2 correct answer(s).
Your score is 20 points.
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 0
See you later!
Example 3:
Welcome to the True or False Game!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 2
Player scores
User: hyper, Score: 40, Date: 2022-05-08
User: jet, Score: 20, Date: 2022-06-19
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 0
See you later!
Example 4:
Welcome to the True or False Game!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 3
File deleted successfully!
0. Exit
1. Play a game
2. Display scores
3. Reset scores
Enter an option:
> 0
See you later!