The Hangman class represents a game of hangman in Ruby, which aims to guess a word randomly chosen by the computer.
- Ruby 3 or higher
- This game have two versions, one in English and another in Portuguese(pt-br)
- The game is played in the terminal
- Insite the class HangmanGame and JogoDaForca you can change the list of the words in @word (us_en) or @palavra (pt_br) that will be used in the game
def initialize
@word = ['ruby', 'rails', 'javascript', 'python', 'java', 'c', 'c++',
'c#', 'php', 'swift', 'kotlin', 'go', 'ruby on rails',
'ruby on rails'].sample.downcase
@wrong_letters = ''
@correct_letters = []
@end_of_game = false
end
def initialize
@palavra = ['ruby', 'rails', 'javascript', 'python', 'java', 'c', 'c++',
'c#', 'php', 'swift', 'kotlin', 'go', 'ruby on rails',
'ruby on rails'].sample.downcase
@letras_erradas = ''
@letras_corretas = []
@fim_de_jogo = false
end
-
Clone the repository
-
Run ./run.sh
git clone
cd HangmanGame
./run.sh