-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathgames.sh
executable file
·75 lines (64 loc) · 1.65 KB
/
games.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
dir=$(dirname $0)
echo "[1] Hangman " | lolcat -as 10000
echo "[2] MazeEscape " | lolcat -as 10000
echo "[3] RockPaperScissors " | lolcat -as 10000
echo "[4] Snake " | lolcat -as 10000
echo "[5] TextAdventure " | lolcat -as 10000
echo "[6] TicTacToe " | lolcat -as 10000
echo "[e] Exit" | lolcat -as 10000
#select the game
echo -e "Enter a Choice:\c" | lolcat
read option
case $option in
"1")
echo -e "Python or Javascript/JS version:\c"
read game
case $game in
"js"|"JS"|"Js"|"jS"|"Javascript"|"javascript")
cd $dir/Hangman && node index.js
;;
"py"|"python"|"PY"|"Python")
cd $dir/Hangman && python3 hangman.py
;;
*)
printf "Not valid option"
esac
;;
"2")
cd $dir/MazeEscape && npm run play
;;
"3")
cd $dir/RockPaperScissors && python3 rockpaperscissors.py
;;
"4")
cd $dir/Snake && npm run play
;;
"5")
cd $dir/TextAdventures && npm run play
;;
"6")
echo -e "Python or Javascript/JS version:\c"
read tictactoe
case $tictactoe in
"js"|"JS"|"Js"|"jS"|"Javascript"|"javascript"|"j")
cd $dir/TicTacToe && node index.js
;;
"py"|"python"|"PY"|"Python"|"p")
cd $dir/TicTacToe && python tictactoe.py
;;
*)
printf "Not valid option"
esac
;;
"e")
echo "▄▄▄▄· ▄· ▄▌▄▄▄ . " | lolcat -s 10000
echo "▐█ ▀█▪▐█▪██▌▀▄.▀· " | lolcat -s 10000
echo "▐█▀▀█▄▐█▌▐█▪▐▀▀▪▄ " | lolcat -s 10000
echo "██▄▪▐█ ▐█▀·.▐█▄▄▌ " | lolcat -s 10000
echo "·▀▀▀▀ ▀ • ▀▀▀ ▀ ▀ " | lolcat -s 10000
;;
*)
printf "Invalid argument, just select the game by the number"
exit 1
esac