def lucky_seven(array)
i = 0
while i < array.length
if array[i] + array[i + 1] + array[i + 2] == 7
puts "True"
else
puts "False"
end
i += 1
lucky_seven([2,1,5,1,0])
=begin
This function checks if any 3 consecutive elements within an array sum to the integer value of 7. The 3 elements need not be in sequential value.
For example:
lucky_sevens?([2,1,5,1,0]) == true # => 1 + 5 + 1 == 7
lucky_sevens?([0,-2,1,8]) == true # => -2 + 1 + 8 == 7
lucky_sevens?([7,7,7,7]) == false
lucky_sevens?([3,4,3,4]) == false
We wanted a way for people to experience some Ruby in the browser, as well as have a platform that can send cool Ruby scripts to one another.
What does this mean?
In Github, forking is a way that you can build upon someone else's code.
Once the project you have forked the code, you can update it from that point on.
RubyFiddle grew up a little bit on June 14, 2012.
We execute in a restricted environment on Heroku and unfortunately, system calls and Ruby classes cause problems.
Due to such security concerns, we had to disable things like