I hereby claim:
- I am bricejlin on github.
- I am bricelin (https://keybase.io/bricelin) on keybase.
- I have a public key whose fingerprint is 86E0 79D3 CC35 BBCC E86E 1BCA 24DA 2552 3448 07FF
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var multiArr = [[3,4],[4,1],[1,1]]; | |
var sum = multiArr.map(function (arr) { | |
return arr.reduce(add, 0); | |
}).reduce(add, 0); | |
function add (a, b) { | |
return a + b; | |
} |
age = 979_000_000 / (60 * 60 * 24 * 365.0) | |
puts "%.2f" % age |
s = <<-STRING | |
Line 1: Welcome to the forum. | |
Line 2: Here you can learn Ruby. | |
Line 3: Along with other members. | |
STRING | |
puts s |
def leap_year?(year) | |
if year % 100 == 0 | |
year % 400 == 0 ? true : false | |
else | |
year % 4 == 0 ? true : false | |
end | |
end | |
def minutes_in_year(year) | |
if leap_year?(year) |
def prompt(question) | |
puts question | |
answer = gets.chomp | |
end |
def leap_year?(year) | |
if year % 100 == 0 | |
true if year % 400 == 0 | |
else | |
true if year % 4 == 0 | |
end | |
end | |
def minutes_in_year(year) | |
if leap_year?(year) |
def reverse_string(string) | |
string.split(' ').reverse.join(' ') | |
end | |
puts reverse_string('this is a string!') |
def fizz_buzz | |
(1..100).map do |num| | |
f = num % 3 == 0 ? 'Fizz' : nil | |
b = num % 5 == 0 ? 'Buzz' : nil | |
f || b ? "#{f}#{b}" : num | |
end | |
end | |
puts fizz_buzz |
string = 'this is a string' | |
arr = string.split(' ') | |
print arr.reverse.join(' ') |