Skip to content

Instantly share code, notes, and snippets.

View richkuo's full-sized avatar
🎯
Focusing

Rich Kuo richkuo

🎯
Focusing
View GitHub Profile
def sort(width, height, length, mass):
# Calculate volume
volume = width * height * length
# Determine if the package is bulky or heavy
is_bulky = (volume >= 1000000) or (width >= 150) or (height >= 150) or (length >= 150)
is_heavy = mass >= 20
# Determine the stack based on the criteria
if is_bulky and is_heavy:
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = '[email protected]'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@richkuo
richkuo / tictactoe
Created July 25, 2013 06:24
One of the very first programs I wrote - Tic Tac Toe in Ruby.
class TicTacToe
def initialize
puts "This is a two(2) player game. Players are set as CPU by default."
puts "Please type 'yes' or 'no' for best results."
@player1 = "CPU 1"
puts "Is player 1 a human? (yes/no)"
c1 = gets.chomp()
if c1.to_s.downcase == 'yes'
puts "Please enter your name for Player 1:"