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
require 'rspec' | |
################creating the world class#################### | |
class World | |
attr_reader :cells, :cells_with_neighbors, :living_neighbors, :dead_neighbors | |
def initialize | |
#@cells = Array.new(10, Array.new(10, Cell.new)) optional method for creating multidimentional array | |
@cells = Array.new(10) { Array.new(10) {Cell.new}} | |
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
# Horse Racing Application by Jeff Scholen. Iron Yard Rails Engineering Class 4/3/14 | |
################################HORSE CLASS################################## | |
class Horse | |
def initialize | |
@whisper = 0 | |
@whip = 0 | |
@kick = 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
#personality quiz by jeff scholen. Iron Yard Rails Engineering Class 4/1/2014 | |
#refactored 4/2/2014 | |
multi_user = {} | |
calm_questions = {question1: "I like living on the Beach.", question2: "I like living in a mountain cabin.", question3: "I prefer a walk on the beach versus going to a bar.", question4: "I like to be alone with my thoughts.", quesiton5: "I prefer working in an office rather than a coffee shop."} | |
party_questions = {question1: "I like living in the city.", question2: "When staying at a hotel, I prefer staying on the very high floors.", question3: "I like hanging out at a party with lots of people.", question4: "I like owning a high performance car.", question5: "I like working for start-ups rather than a large stable company.", } | |
5.times{puts " "} | |
def check_integer_value(value_to_check) | |
print "#{value_to_check} -- How would you score yourself?" |
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
#Guessing Game for user to guess the items in the array by Jeff Scholen with user feedback. Iron Yard Rails Engineering 3/31/2014 | |
@n = 0 | |
@atv_values = ["Be Nice.", "Dream Big.", "Pay It Forward.", "Work Hard. Play Hard."] | |
@atv_guess = ["Be ----.", "----- Big.", "Pay It -------.", "Work-------Play Hard."] | |
@atv_hints = ["---- guys finish last.", "I have a -----.", "Kevin Spacey, Haley Joel Osment Movie", | |
"A serious and fun work culture motto." ] | |
@atv_missing_values = ["nice", "dream", "forward", "hard"] | |
def match_answer(user_input) | |
case user_input |
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
#BlackJack Game created by Jeff Scholen. Iron Yard Rails Engineering Class 3/31/2014 | |
puts "Would you like to play blackjack? Yes or No" | |
playtime = gets.chomp | |
exit if playtime.downcase == "no" | |
my_cards = [] | |
my_cards.push(base_card = rand(10)) | |
puts "Your first card is #{base_card}." |
NewerOlder