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
| team_data = [ | |
| { | |
| home_team: "Patriots", | |
| away_team: "Broncos", | |
| home_score: 7, | |
| away_score: 3 | |
| }, | |
| { | |
| home_team: "Broncos", | |
| away_team: "Colts", |
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
| song = "***DON'T STOP...BELIEVIN'!*** | |
| Just a small town girl | |
| Living in a lonely world | |
| She took the midnight train going anywhere | |
| Just a city boy | |
| Born and raised in South Detroit | |
| He took the midnight train going anywhere | |
| A singer in a smoky room |
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
| def dollar_due(change_due) | |
| d_due = (change_due / 1.00).to_i | |
| puts "#{d_due} dollars" | |
| left_overs = (change_due % 1.00).round(2) | |
| if left_overs > 0.25 | |
| quarter_due(left_overs) | |
| elsif left_overs > 0.10 | |
| dimes_due(left_overs) | |
| elsif left_overs > 0.05 |
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 |name,house| | |
| puts "#{name} represents the #{house}" |
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
| require 'pry' | |
| favorite_movies = [ | |
| { title: 'The Big Lebowski', year_released: 1998, director: 'Joel Coen', imdb_rating: 8.2 }, | |
| { title: 'The Shining', year_released: 1980, director: 'Stanley Kubrick', imdb_rating: 8.5 }, | |
| { title: 'Troll 2', year_released: 1990, directory: 'Claudio Fragasso', imdb_rating: 2.5 } | |
| ] | |
| favorite_movies.each do |movies| | |
| puts "#{movies[:year_released]}: #{movies[: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
| def playback(repeat) | |
| repeat | |
| puts "You said: #{repeat}" | |
| end | |
| puts "What do you want to say?" | |
| print "> " | |
| playback(gets.chomp) |
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
| def playback(repeat) | |
| if repeat == "Nothing!" | |
| puts "Ok, fine!" | |
| elsif repeat == "I have a lot to say" | |
| puts " don\'t have time for that right now!" | |
| else | |
| puts "You said: #{repeat}" | |
| 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
| require 'pry' | |
| def playback(repeat) | |
| if repeat == "Nothing!" | |
| puts "Ok, fine!" | |
| elsif repeat == "I have a lot to say" | |
| lot_to_say | |
| else | |
| puts "You said: #{repeat}" | |
| 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
| def playback(repeat) | |
| if repeat == "Nothing!" | |
| puts "Ok, fine!" | |
| elsif repeat == "I have a lot to say" | |
| puts "Ok, let\'s hear it!" | |
| print "> " | |
| lot_to_say | |
| out_put_format(things_to_say) | |
| elsif repeat == "I have something prepared" | |
| puts "Ok, where can I find what you want to say?" |
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
| require 'pry' | |
| class BlackJack | |
| def initialize | |
| @deck = Deck.new.build_deck | |
| @players_hand = {} | |
| @symbol_value = PlayingCards.new.symbols | |
| player | |
| @players_score = Hash.new(0) |