Skip to content

Instantly share code, notes, and snippets.

View ciprianna's full-sized avatar

Ciprianna Engel ciprianna

View GitHub Profile
@ciprianna
ciprianna / dinnerclub.rb
Created June 3, 2015 18:19
Dinner Club - Displays four separate files used here; one for CheckSplitter class, one for ClubEvent class, one for DinnerClub class, and App.rb to test
# Check Splitter
# Creates new class called CheckSplitter
class CheckSplitter
# Shows which attributes are accessible
attr_accessor :total_cost, :tip_percentage, :people
# Initializes the attributes as optional; sets default values in the options
# hash and merges the hash with inputs (if given). Uses those defaults as
@ciprianna
ciprianna / DinnerClub_Day3.rb
Created June 3, 2015 21:23
Dinner Club updates without stretches - Still displays four different files (CheckSplitter class, EventClub class, DinnerClub class, and app.rb)
# Check Splitter
# Creates new class called CheckSplitter
class CheckSplitter
# Shows which attributes are accessible
attr_accessor :total_cost, :tip_percentage, :people
# Initializes the attributes as optional; sets default values in the options
# hash and merges the hash with inputs (if given). Uses those defaults as

Dinner Club Explanation

Assignment Task

The program was built to keep track of a dinner club's events. Specifically, it stores and displays club history, as well as members and total member costs during the history of the Dinner Club.

Classes

Three classes were used to accomplish the Dinner Club assignment: CheckSplitter, ClubEvent, and DinnerClub.

CheckSplitter Class

@ciprianna
ciprianna / app.rb
Last active August 29, 2015 14:22
Rock Paper Scissors_Level 1
# Rock Paper Scissors
require "./player.rb"
# This section gets inputs from the user and stores them as player1 and player2.
puts "Let's play Rock-Paper-Scissors."
puts "\n"
puts "Who's player 1?"
name_one = gets.chomp
puts "And who is #{name_one} playing against?"
name_two = gets.chomp
@ciprianna
ciprianna / app.rb
Created June 6, 2015 23:14
Rock Paper Scissors - Level 2
# Rock Paper Scissors
require './game.rb'
# This section gets inputs from the user and stores them as player1 and player2.
puts "Let's play Rock-Paper-Scissors."
puts "\n"
puts "Who's player 1?"
name_one = gets.chomp
puts "And who is #{name_one} playing against?"
@ciprianna
ciprianna / app.rb
Created June 8, 2015 04:40
Rock Paper Scissors - Level 3
# Rock Paper Scissors
require './game.rb'
# This section gets inputs from the user and stores them as player1 and player2.
puts "Let's play Rock-Paper-Scissors."
puts "\n"
puts "Who's player 1?"
name_one = gets.chomp.capitalize
puts "And who is #{name_one} playing against? Or type 'computer' if you'd like to play against the machine."
@ciprianna
ciprianna / app.rb
Last active August 29, 2015 14:22
Mini Projects - Phone Number Formatter
# app.rb
require "./phone_number_formatter.rb"
puts "What's your phone number?"
number_input = gets.chomp
test = PhoneNumber.new(number_input)
@ciprianna
ciprianna / check_splitter_test.rb
Last active August 29, 2015 14:22
Check Splitter Tests
# CheckSplitter Test
require "minitest/autorun"
require_relative "check_splitter.rb"
class CheckSplitterTest < Minitest::Test
# One test will be for the initialize method. It should return an args hash
# with default values. I will test if it returns that hash as expected.
def test_initialize_hash_created
new_check = CheckSplitter.new
@ciprianna
ciprianna / app.rb
Last active August 29, 2015 14:22
Paragraph Truncator
# Driver
require_relative "paragraph_truncator.rb"
puts "What paragraph would you like to truncate?"
paragraph = gets.chomp
puts "Would you like to set your own character length? ('yes' or 'no') The default value is currently set to 50 characters."
set_own_char_length = gets.chomp.downcase
@ciprianna
ciprianna / rock_paper_scissors_explanation.markdown
Last active August 29, 2015 14:22
Rock, Paper, Scissors Explanation

Rock, Paper, Scissors Explanation

Purpose of the Assignment

Rock, Paper, Scissors was created to allow two players, or a single player vs. the computer, to play a game of rock, paper, scissors. Game options include being able to choose how many rounds will be played, and being able to choose Rock, Paper, Scissors, Lizard, Spock.

Classes

To accomplish the assignment, three classes are used: Player, ComputerPlayer, and Game.

Player Class

The Player class was created to create new players in a given game.