Skip to content

Instantly share code, notes, and snippets.

View featherart's full-sized avatar
🎯
Focusing

Feather featherart

🎯
Focusing
View GitHub Profile
# create an Array of 4 shoes
shoes = ["flip flops", "cowboy boots", "galoshes", "clogs" ]
# iterate through your Array using each and {}'s
# and show a list of your shoes
shoes.each { |s| puts s }
# create an Array of 4 outfits using Array.new
@featherart
featherart / gist:6745715
Last active December 24, 2015 04:39
Some more practice with Arrays
# create an Array of 4 shoes
# iterate through your Array using each and {}'s
# and show a list of your shoes
# create an Array of 4 outfits using Array.new
@featherart
featherart / gist:6736829
Created September 27, 2013 23:55
Solution to week one !Quiz
# ,o888888o. 8 8888 88 8 8888 8888888888',8888'
# . 8888 `88. 8 8888 88 8 8888 ,8',8888'
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888'
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888'
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888'
@featherart
featherart / gist:6734826
Last active January 9, 2019 16:56
Week one: !Quiz This isn't a chance to "fail a test", it's a way of letting us all (including you) know what you know.
# ,o888888o. 8 8888 88 8 8888 8888888888',8888'
# . 8888 `88. 8 8888 88 8 8888 ,8',8888'
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888'
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888'
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888'
@featherart
featherart / gist:6678157
Last active December 23, 2015 18:49
conditionals lab
# in irb, evaluate the following:
4 < 5
4 == 5 # note the == is different from =
4 != 5
1 <= 2
0 > 1
1 > 1
1 >= 1
@featherart
featherart / euler.rb
Created April 4, 2013 19:25
Solutions to project Euler problems
# Euler problem #1: If we list all the natural numbers below 10 that are multiples of 3 or 5,
# we get 3, 5, 6 and 9. The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
def find_multiples num
multiples = Array.new
(1...num).each do |i|
if( (i % 3 == 0) || (i % 5 == 0) )
multiples << i
end