This file contains 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 'minitest/autorun' | |
require 'minitest/pride' | |
require './may.rb' | |
class Goat | |
attr_reader :name | |
def initialize(name) | |
end | |
def send(message) |
This file contains 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 'minitest/autorun' | |
require 'minitest/pride' | |
require './names.rb' | |
def names(president) | |
array = [] | |
hash = {} | |
input = gets.chomp.to_s | |
array << input |
This file contains 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 fizzbuzz (num) | |
if num % 3 == 0 | |
p "Fizz" | |
elsif num % 5 | |
p "Buzz" | |
elsif num % 3 == 0 && num % 5 == 0 | |
p "FizzBuzz" | |
else | |
return num | |
end |
This file contains 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
puts "Please enter a number." | |
counter = 0 | |
total = 0 | |
string_total = [] | |
while true | |
input = gets.chomp | |
if input.to_i > 0 | |
puts "Good. How about another?" | |
counter += 1 |
This file contains 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
x = 1 | |
while x <= 100 | |
if x % 3 == 0 | |
puts "Fizz" | |
elsif x % 5 == 0 | |
puts "Buzz" | |
else | |
puts x | |
end | |
x += 1 |
NewerOlder