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
| 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: |
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 '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' } |
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 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:" |