Skip to content

Instantly share code, notes, and snippets.

View TaylorOD's full-sized avatar
😀
pushin code

Taylor Dorsett TaylorOD

😀
pushin code
View GitHub Profile
@TaylorOD
TaylorOD / Hangman.rb
Created August 4, 2020 17:05 — forked from JDLeigh10/Hangman.rb
Hangman game created in Ruby
# Load the dictionary, store it in an array, shuffle it
dictionary = File.open('dictionary.txt')
dictionary_array = dictionary.readlines
dictionary_array.shuffle!
# Intro text, wait for user to type 'start'
puts "\n<<< Terminal Hangman >>>\n\n"
puts "Type \"start\" to begin a new game\n"
turn = 0
rematch = nil
@JDLeigh10
JDLeigh10 / Hangman.rb
Created July 1, 2012 19:51
Hangman game created in Ruby
# Load the dictionary, store it in an array, shuffle it
dictionary = File.open('dictionary.txt')
dictionary_array = dictionary.readlines
dictionary_array.shuffle!
# Intro text, wait for user to type 'start'
puts "\n<<< Terminal Hangman >>>\n\n"
puts "Type \"start\" to begin a new game\n"
turn = 0
rematch = nil
@Kerrick
Kerrick / fizzbuzz.rb
Created April 24, 2012 20:36
Different solutions for Fizz Buzz in Ruby
def fizz_buzz_1(max)
arr = []
(1..max).each do |n|
if ((n % 3 == 0) && (n % 5 == 0))
arr << "FizzBuzz"
elsif (n % 3 == 0)
arr << "Fizz"
elsif (n % 5 == 0)
arr << "Buzz"
else