Class: Mathangman::Display

Inherits:
Object
  • Object
show all
Defined in:
lib/mathangman/display.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.confirm_quitObject



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_sourceObject



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_noticeObject



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_noticeObject



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_dispObject



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"

#difficultyObject



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_nameObject



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"

#greetingObject



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"

#infoObject



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_entryObject



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"