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 <<-EOS **************************************************************** * Are you sure you want to quit the game? Press Y to confirm * **************************************************************** EOS end |
.no_source ⇒ Object
114 115 116 117 118 119 120 |
# File 'lib/mathangman/display.rb', line 114 def self.no_source <<-EOS *************************************** * No file to source words from. * *************************************** EOS end |
.quit_notice ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/mathangman/display.rb', line 98 def self.quit_notice <<-EOS ************************************************* * You have successfully ended the game. * ************************************************* EOS end |
.save_notice ⇒ Object
106 107 108 109 110 111 112 |
# File 'lib/mathangman/display.rb', line 106 def self.save_notice <<-EOS *********************************************************** * Would you like to save your game? Press Y to confirm * *********************************************************** EOS end |
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 <<-EOS ****************************************** * YOU WIN! * * YOU HANGED HANGMAN! * YOU ARE THE BOSS! * ****************************************** EOS end |
#difficulty ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/mathangman/display.rb', line 20 def difficulty <<-EOS Choose a difficulty level. 7 - for beginner 8 - for intermediate 9 - for PRO EOS end |
#get_name ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/mathangman/display.rb', line 37 def get_name <<-EOS ************************************************* * Please enter a username * ************************************************* EOS end |
#greeting ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mathangman/display.rb', line 6 def greeting <<-EOS ************************************************* * HANGMAN * * * * Press 1 to start a new game * * Press 2 to load a saved game * * Press 3 for more information * * Press * to quit the game at anytime * * * ************************************************* EOS end |
#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 <<-EOS ************************************************** * This is HANGMAN game v0.1.0 * * By Olaide Ojewale * * Enjoy and expect the next version * * Press * at anytime to quit the game. * * You will be prompted to save a started... * * ...game whenever you attempt to quit. * * You can also load and continue saved... * * ... games by uisng your username. * * Press Y to continue with the game. * ************************************************** EOS end |
#invalid_entry ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mathangman/display.rb', line 29 def invalid_entry <<-EOS ************************************************* * Invalid entry. * ************************************************* EOS end |
#lost(word) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/mathangman/display.rb', line 56 def lost(word) <<-EOS ************************************* * YOU HAVE BEEN HANGED! * * GAME OVER! * THE WORD IS: #{word} ************************************* EOS end |
#msg(anything) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/mathangman/display.rb', line 66 def msg(anything) <<-EOS * #{anything} * EOS end |