This file contains hidden or 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
| favorite_movies = [ | |
| {title: 'The Big Lebowski', year_released: 1998, director: 'Joel Coen', imdb_ratings: 8.2}, | |
| {title: 'The Shining', year_released: 1980, director: 'Stanley Kubrick', imdb_ratings: 8.5}, | |
| {title: 'Troll 2', year_released: 1990, director: 'Claudio Fragasso', imdb_ratings: 2.5} | |
| ] | |
| favorite_movies.each do |movie| | |
| puts "#{movie[:year_released]}: #{movie[:title]}" | |
| end |
This file contains hidden or 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
| characters = { | |
| "Tyrion Lannister" => "House Lannister", | |
| "Jon Snow" => "Night's Watch", | |
| "Hodor" => "House Stark", | |
| "Stannis Baratheon" => "House Baratheon", | |
| "Theon Greyjoy" => "House Greyjoy" | |
| } | |
| characters.each do |char| | |
| puts "#{char[0]} represents the #{char[1]}" |
This file contains hidden or 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
| commit 370f99e689724371493ff64b3f7bd078b97e460a | |
| Author: adeng21 <[email protected]> | |
| Date: Thu Feb 20 18:54:54 2014 -0500 | |
| made another minor change to test git | |
| commit 954b8edc3ab52a9e38aff268e4d59188646ed000 | |
| Author: adeng21 <[email protected]> | |
| Date: Thu Feb 20 18:53:30 2014 -0500 |
This file contains hidden or 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
| total = [] | |
| while true do | |
| puts "What is the sale price?" | |
| input = gets.chomp | |
| if input == 'done' | |
| break | |
| else | |
| total << input.to_f |
This file contains hidden or 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
| puts "Guess a number between 0 and 1000" | |
| guess = gets.chomp.to_i | |
| number=273 | |
| if guess > 273 && guess <= 1000 | |
| puts "Too high. Try a lower number" | |
| elsif guess < 273 && guess >= 0 | |
| puts "Too low! Try again" | |
| elsif guess > 1000 || guess < 0 | |
| puts "Invalid number. Try again - any number between 0 and 1000" | |
| else guess == 273 |
This file contains hidden or 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
| puts "What is the amount due?" | |
| total = gets.chomp.to_f | |
| puts "What is the amount tendered?" | |
| paid = gets.chomp.to_f | |
| if paid < total | |
| puts "WARNING: Customer still owes $#{format("%.2f", total-paid)}" | |
| puts Time.now | |
| elsif paid > total |
NewerOlder