Last active
February 2, 2021 12:38
-
-
Save dennisvink/e128fb1f029618a0325bf2c406010473 to your computer and use it in GitHub Desktop.
Practice Spanish: seasons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Practice the seasons in Spanish | |
es_seasons = %w( | |
primavera | |
verano | |
otono | |
invierno | |
) | |
en_seasons = %w( | |
spring | |
summer | |
fall | |
winter | |
) | |
while loop do | |
season = rand(0..3) | |
cat = rand(2) | |
question = "" | |
answer = "" | |
if(cat == 0) | |
question = "Que es #{es_seasons[season]} en Ingles?" | |
answer = en_seasons[season] | |
else | |
question = "What is #{en_seasons[season]} in Spanish?" | |
answer = es_seasons[season] | |
end | |
puts question | |
response = gets.chomp | |
if response == answer | |
puts "Correct!" | |
else | |
if(cat == 0) | |
puts "Incorrecto! La respuesta fue #{answer.inspect} :(" | |
else | |
puts "Incorrect! The answer was #{answer.inspect} :(" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment