Module: MSG
- Included in:
- ConnectFour, GameEngine, MPGameEngine
- Defined in:
- lib/msg.rb
Constant Summary collapse
- ONEPLAYER_TWOPLAYER =
"1P || 2P"
- WELCOME_MSG =
"Let's play **** CONNECT FOUR **** Connect four of your checkers in a row while preventing your opponent from doing the same.\n press 'p' to play; 'q' to quit:"
- PLAY_MSG =
"#{ENV["USER"]} says we're playing Connect Four!!"
- BYE_MSG =
"Sucka’s only see what’s in front of them while real game playa’s see the whole board, – 777\nDeuces!"
- P_OR_Q_ERR_MSG =
"Sorry, I didn't understand that selection. press 'p' to play; 'q' to quit:"
- PLAYER_TURN_MSG =
"Choose where you want to drop your token"
- TIE_GAME_MSG =
"The board is full!! It's a draw!"
- WAITING_MSG =
"Waiting for opponent to join"
- OPP_FOUND =
"Opponent found...establishing connection"
Instance Method Summary collapse
- #INPUT_ERR_MSG(input) ⇒ Object
- #LOADER_MSG(i) ⇒ Object
- #TIMES_UP_MSG(column) ⇒ Object
- #VICTORY_MSG(plyr_name) ⇒ Object
- #WAITING_FOR_PLYR_MSG(plyr_name) ⇒ Object
Instance Method Details
#INPUT_ERR_MSG(input) ⇒ Object
46 47 48 |
# File 'lib/msg.rb', line 46 def INPUT_ERR_MSG(input) "#{input} is an invalid selection" end |
#LOADER_MSG(i) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/msg.rb', line 30 def LOADER_MSG(i) i.times do sleep 1.6 print " . " end puts "" end |
#TIMES_UP_MSG(column) ⇒ Object
22 23 24 |
# File 'lib/msg.rb', line 22 def TIMES_UP_MSG(column) "Time's up: you randomly chose column #{column}" end |
#VICTORY_MSG(plyr_name) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/msg.rb', line 38 def VICTORY_MSG(plyr_name) if plyr_name == "HAL" "HAL won!! You just lost to an unliving being!! Boom!!" else "#Hot Dog, we have a Winner! Congratulations #{plyr_name}!!!" end end |
#WAITING_FOR_PLYR_MSG(plyr_name) ⇒ Object
26 27 28 |
# File 'lib/msg.rb', line 26 def WAITING_FOR_PLYR_MSG(plyr_name) "Waiting for #{plyr_name} to make a move" end |