Skip to content

Instantly share code, notes, and snippets.

View Joeventures's full-sized avatar

Joe Winter Joeventures

View GitHub Profile
This part of downtown is within walkable distance to many lunch options, many of them good
enough to call "lunch."
** Yumm Terriyaki
This place is disgusting terriyaki. The most common conversation I have had when going there
begins when someone asks "What is that?" and I answer "It's chicken." And they say, "Noooo...
really?" Once the substance is identifiably chicken, it becomes much better. If you're ever
in the mood for greasy hole in the wall terriyaki, this is your spot.
-- Turn right out of the building. Walk up to Peachtree St and Yumm Terriyaki is across the
street.
@Joeventures
Joeventures / guess.rb
Last active September 22, 2015 02:57
num = rand(100)
guess = 0
count = 0
puts "Guess a number between 1 and 100!"
until guess == num
count += 1
guess = gets.to_i
if guess > num && guess.between?(1,100)
puts "Your guess was too high! Try again."
elsif guess < num && guess.between?(1,100)
# This does more than you were asking for.
# Two fundtions:
# => get_array has the user input each array item
# => destutter has two conditions: the array and the mode
# If the mode is seq it will return the array with sequential
# duplicates removed. If the mode is unique it will return
# the array with all duplicates removed
def get_array
r = []
require "pry"
word_list = [
"chicken", "duck", "dog", "cat", "clown",
"brick", "bananas", "totalitarianism",
"coffee", "metacircular", "interpreter",
"wednesday", "ruby", "evaluation", "consternation",
"chicanery"
]
@Joeventures
Joeventures / hangman.rb
Created September 23, 2015 20:38
Wk 1 Wednesday Normal Mode
require "pry"
require "set"
word_list = [
"chicken", "duck", "dog", "cat", "clown",
"brick", "bananas", "totalitarianism",
"coffee", "metacircular", "interpreter",
"wednesday", "ruby", "evaluation", "consternation",
"chicanery"
]
@Joeventures
Joeventures / hangman.rb
Created September 24, 2015 12:01
Hangman for 1 or 2 players
require "pry"
require "set"
word_list = [
"acres", "adult", "advice", "arrangement", "attempt",
"august", "autumn", "border", "breeze",
"brick", "calm", "canal", "casey",
"cast", "chose", "claws", "coach",
"constantly", "contrast", "cookies", "customs",
"damage", "danny", "deeply", "depth",
@Joeventures
Joeventures / hangman.rb
Created September 24, 2015 12:20
Hard Mode answer
require "pry"
require "set"
word_list = [
"acres", "adult", "advice", "arrangement", "attempt",
"august", "autumn", "border", "breeze",
"brick", "calm", "canal", "casey",
"cast", "chose", "claws", "coach",
"constantly", "contrast", "cookies", "customs",
"damage", "danny", "deeply", "depth",
@Joeventures
Joeventures / tic-tac-toe.rb
Created September 27, 2015 12:23
Tic-Tac-Toe Easy Mode
# The board is laid out as a simple array 0..8
#all_guesses is a hash: {"x"=>[1,2,3,4], "o"=>[5,6,7,8]}
WIN_SET = [
[0,1,2], [3,4,5], [6,7,8],
[0,3,6], [1,4,7], [2,5,8],
[0,4,8], [2,4,6]
]
def winning_set?( player_guesses )
winner = false
@Joeventures
Joeventures / tic-tac-toe.rb
Created September 27, 2015 12:45
Tic-Tac-Toe Normal Mode
# The board is laid out as a simple array 0..8
#all_guesses is a hash: {"x"=>[1,2,3,4], "o"=>[5,6,7,8]}
WIN_SET = [
[0,1,2], [3,4,5], [6,7,8],
[0,3,6], [1,4,7], [2,5,8],
[0,4,8], [2,4,6]
]
def winning_set?( player_guesses )
winner = false
@Joeventures
Joeventures / tic-tac-toe.rb
Created September 28, 2015 03:33
Semi-Intelligent Computer Player
# The board is laid out as a simple array 0..8
#all_guesses is a hash: {"x"=>[1,2,3,4], "o"=>[5,6,7,8]}
WIN_SET = [
[0,1,2], [3,4,5], [6,7,8],
[0,3,6], [1,4,7], [2,5,8],
[0,4,8], [2,4,6]
]
def be_intelligent_or_something( all_guesses, available_spaces )
available_spaces.each do |o|