Created
April 14, 2018 10:31
-
-
Save angristan/2f47b2b1274be55ea1294d393e24a8c7 to your computer and use it in GitHub Desktop.
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
# Défi n°1 | |
villes = ['Paris', 'New York', 'Berlin', 'Montréal'] | |
puts "DEFI N°1 - Si j'étais en vacances, j'irais à..." | |
villes.each do |ville| | |
puts ville | |
end | |
# Défi n°2 | |
voyages = [ | |
{ ville: "Paris", duree: 10 }, | |
{ ville: "New York", duree: 5 }, | |
{ ville: "Berlin", duree: 2 }, | |
{ ville: "Montréal", duree: 15 } | |
] | |
puts "DEFI N°2 - Détail de mes vacances de rêve" | |
voyages.each do |voyage| | |
puts "Voyage à #{voyage[:ville]} de #{voyage[:duree]} jours" | |
end | |
# Défi n°3 | |
puts "DEFI N°3 - Mes vacances de rêve (enfin presque)" | |
voyages.each do |voyage| | |
if voyage[:duree] <= 5 | |
puts "Voyage à #{voyage[:ville]} de #{voyage[:duree]} jours" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment