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 './deck' | |
require './card' | |
class Hand | |
attr_accessor :cards, :total | |
def initialize(name) | |
@name = name | |
@cards = [] | |
@cards << Deck.deal_cards |
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
class Bob | |
def hey(remark) | |
# Note: I needed help getting the "remark.downcase != remark" solution. | |
if remark == remark.upcase && remark.downcase != remark | |
"Whoa, chill out!" | |
elsif remark.end_with?("?") | |
"Sure." | |
elsif remark.to_s.strip.empty? | |
"Fine. Be that way!" | |
else |
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
# MATRIX FORMAT: (PLAYER, COMPUTER) | |
# | |
# | PLAYER | |
# | rock | paper scissors | |
# ------------------------------------------------------------------------ | |
# | (rock,rock) | (paper,rock) | (scissors,rock) | | |
# C rock | TIE | PLAYER | COMPUTER | | |
# O | | WINS | WINS | | |
# M----------------------------------------------------------------------- | |
# P | (rock,paper) | (paper,paper) | (scissors,paper) | |
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
#Normal Mode | |
# | |
# Good news Rubyists! | |
# We have a week of records tracking what we shipped at Planet Express. | |
# I need you to answer a few questions for Hermes. | |
# | |
# 1. How much money did we make this week? | |
# 2. How much of a bonus did each employee get? | |
# (bonuses are paid to employees who pilot the Planet Express) | |
# 3. How many trips did each employee pilot? |
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
#DAY-3 ASSIGNMENT | |
# | |
# Robot | |
# Define a Robot class | |
# A robot has a name | |
# A robot should have a method called say_hi and it should return "Hi!" | |
# A robot should have a method called say_name and it should return "My name is X" where X is the robot's name | |
# | |
# BendingUnit | |
# Define a BendingUnit class |
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
# Assign "Hello World" to a variable message | |
# Added "puts """ for spacing and organization to assignment answers. | |
puts"" | |
greeting_1 = "Hello World" | |
puts greeting_1 | |
# Assign a different string to a different variable | |
greeting_2 = "Hello Houston" | |
puts greeting_2 |
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
# Assign "Hello World" to a variable message | |
# Added "puts """ for spacing and organization to assignment answers. | |
puts"" | |
greeting_1 = "Hello World" | |
puts greeting_1 | |
# Assign a different string to a different variable | |
greeting_2 = "Hello Houston" | |
puts greeting_2 |