Class: Mathangman::Display
- Inherits:
-
Object
- Object
- Mathangman::Display
- Defined in:
- lib/mathangman/display.rb
Class Method Summary collapse
Instance Method Summary collapse
- #complete_disp ⇒ Object
- #difficulty ⇒ Object
- #get_name ⇒ Object
- #greeting ⇒ Object
- #info ⇒ Object
- #invalid_entry ⇒ Object
- #lost(word) ⇒ Object
- #msg(anything) ⇒ Object
Class Method Details
.confirm_quit ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/mathangman/display.rb', line 90 def self.confirm_quit " ****************************************************************\n * Are you sure you want to quit the game? Press Y to confirm *\n ****************************************************************\n EOS\nend\n" |
.no_source ⇒ Object
114 115 116 117 118 119 120 |
# File 'lib/mathangman/display.rb', line 114 def self.no_source " ***************************************\n * No file to source words from. *\n ***************************************\n EOS\nend\n" |
.quit_notice ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/mathangman/display.rb', line 98 def self.quit_notice " *************************************************\n * You have successfully ended the game. *\n *************************************************\n EOS\nend\n" |
.save_notice ⇒ Object
106 107 108 109 110 111 112 |
# File 'lib/mathangman/display.rb', line 106 def self.save_notice " ***********************************************************\n * Would you like to save your game? Press Y to confirm *\n ***********************************************************\n EOS\nend\n" |
Instance Method Details
#complete_disp ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mathangman/display.rb', line 45 def complete_disp "\n ******************************************\n * YOU WIN! *\n * YOU HANGED HANGMAN! *\n YOU ARE THE BOSS! *\n ******************************************\n EOS\nend\n" |
#difficulty ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/mathangman/display.rb', line 20 def difficulty " Choose a difficulty level.\n 7 - for beginner\n 8 - for intermediate\n 9 - for PRO\n EOS\nend\n" |
#get_name ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/mathangman/display.rb', line 37 def get_name " *************************************************\n * Please enter a username *\n *************************************************\n EOS\nend\n" |
#greeting ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mathangman/display.rb', line 6 def greeting " *************************************************\n * HANGMAN *\n * *\n * Press 1 to start a new game *\n * Press 2 to load a saved game *\n * Press 3 for more information *\n * Press * to quit the game at anytime *\n * *\n *************************************************\n EOS\nend\n" |
#info ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mathangman/display.rb', line 74 def info " **************************************************\n * This is HANGMAN game v0.1.0 *\n * By Olaide Ojewale *\n * Enjoy and expect the next version *\n * Press * at anytime to quit the game. *\n * You will be prompted to save a started... *\n * ...game whenever you attempt to quit. *\n * You can also load and continue saved... *\n * ... games by uisng your username. *\n * Press Y to continue with the game. *\n **************************************************\n EOS\nend\n" |
#invalid_entry ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mathangman/display.rb', line 29 def invalid_entry " *************************************************\n * Invalid entry. *\n *************************************************\n EOS\nend\n" |
#lost(word) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/mathangman/display.rb', line 56 def lost(word) " *************************************\n * YOU HAVE BEEN HANGED! *\n * GAME OVER! *\n THE WORD IS: \#{word}\n *************************************\n EOS\nend\n" |
#msg(anything) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/mathangman/display.rb', line 66 def msg(anything) "\n * \#{anything} *\n\n EOS\nend\n" |