Skip to content

Commit

Permalink
Automatically backed up by Learn
Browse files Browse the repository at this point in the history
  • Loading branch information
slaloggia committed Aug 3, 2020
1 parent 6fe6ff9 commit d848a93
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
9 changes: 9 additions & 0 deletions demo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def duplicate-hash(array)
hash = {}
array.each {
|i| if hash.has_key?(i) hash[:i] += 1
else hash[:i] = 1
end
}

end
30 changes: 30 additions & 0 deletions learning-if-end.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#run_code_inside = false
#puts "Code before if...end"
#if run_code_inside
# puts "code inside"
# end
# puts "Code after if...end"

chance_of_rain = -23
# puts "Let's go outside!"
# if chance_of_rain <= 0.25
# puts "Pack a sun shelter!"
# elsif (chance_of_rain > 0.25 && chance_of_rain < 0.75)
# puts "Pack an umbrella!"
# else
# puts "Stay home and read Hegel."
# end

# puts "You know what year it is??"
# this_year = Time.now.year
# puts "Hey, it's 2019!" if
# this_year == 2019

greeting = "friendly_greeting"

case greeting
when "unfriendly_greeting"
puts "What do you want!?"
when "friendly_greeting"
puts "Hi! How are you?"
end

0 comments on commit d848a93

Please sign in to comment.