Advertisement
CaiqueONZ

Smart Quiz

Dec 1st, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Quiz"
  3. sleep 5
  4. clear
  5.  
  6. echo "Select Your favorite programming language"
  7. echo """
  8. 1) Python
  9. 2) Javascript
  10. 3) C++
  11. 4) C
  12. 5) C#
  13. 6) Others
  14. """
  15. read -p "[Choose]: " favorite
  16. clear
  17.  
  18. echo "Please select the correct response."
  19. sleep 3
  20. clear
  21.  
  22. echo "How much is 1+1?"
  23. echo """
  24. 1) 11
  25. 2) 21
  26. 3) idk
  27. """
  28. read -p "[Choose]: " Math
  29.  
  30. if [ "$Math" == "1" ]; then
  31.     echo "Correct!"
  32.     math_correct=1
  33.     sleep 2
  34. else
  35.     echo "Wrong Answer"
  36.     lost1=1
  37.     sleep 2
  38. fi
  39. clear
  40.  
  41. echo "Are you alone?"
  42. echo """
  43. 1) Yes
  44. 2) No
  45. """
  46. read -p "[Choose]: " alone
  47.  
  48. if [ "$alone" == "1" ]; then
  49.     echo "Correct!"
  50.     alone1=1
  51.     sleep 2
  52. else
  53.     echo "Wrong Answer.."
  54.     lost2=1
  55.     sleep 2
  56. fi
  57.  
  58. if [ "$lost1" == "1" ] && [ "$lost2" == "1" ]; then
  59.     echo "You lost the quiz, please restart."
  60.     sleep 2
  61.     exit
  62. else
  63.     echo """
  64.    You finished the quiz, thanks for playing!
  65.    """
  66.     sleep 2
  67.     clear
  68.     echo """
  69.    <SMART QUIZ>
  70.    A survey made by CaiqueONZ - Pastebin.
  71.    """
  72.     sleep 2
  73.     exit
  74. fi
  75.  
  76.  
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement