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
#Guess the Number | |
#Coded by: Anthony Ross, Greg Sheppard, Dan Clark | |
MAX = 1000 | |
puts "Guess a number between 0 and #{MAX}: " | |
guess_num = -1 | |
winning_num = rand(MAX) | |
while guess_num != winning_num |
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
=begin | |
As a cashier | |
I want to enter the sale price of each item | |
So that the program will calculate the amount due | |
Developed by: Anthony Ross, Dan Clarke, and Greg Sheppard | |
=end | |
item = '' | |
trans = [] | |
subtotal = 0 |
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
commit acde6f45925d826a55b9e2e3164531706520a4f0 | |
Author: Gregory Sheppard <gregory.sheppard@live.com> | |
Date: Thu Feb 20 18:16:54 2014 -0500 | |
Add new list item | |
commit 55c13e12b78cb3f2ef316267f94e80c479c74a12 | |
Author: Gregory Sheppard <gregory.sheppard@live.com> | |
Date: Thu Feb 20 18:15:31 2014 -0500 |
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
characters = { | |
"Tyrion Lannister" => "House Lannister", | |
"Jon Snow" => "Night's Watch", | |
"Hodor" => "House Stark", | |
"Stannis Baratheon" => "House Baratheon", | |
"Theon Greyjoy" => "House Greyjoy" | |
} | |
characters.each {|k,v| puts "#{k} represents the #{v}"} |
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
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 |movie| | |
puts "#{movie[:year_released]}: #{movie[:title]}" | |
end |
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
# report average, lowest, and highest scores | |
require 'pry' | |
def bubble_sort scores | |
bubbled = scores | |
outer = 0 | |
while outer < bubbled.length - 1 | |
inner = 0 | |
while inner < bubbled.length - 1 |