Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (38 sloc) 670 Bytes
myvar = 'hello world'
johnny = 4000
oh my god = 'lord'
foo = -> johnny
34 + johnny * 3
end
bar = -> johnny
(34 + johnny) * 3
end
Object.puts('Negative johnny is', -johnny)
Object.puts(foo(3))
Object.puts(foo(242))
if bar(3) == 111
Object.puts(bar(3))
end
if bar(242) == 728
Object.puts('wrong!')
else
Object.puts('cool!')
end
foo = 30
while foo > 0
foo = foo - 5
end
add_fun = -> a, b
a + b
end
cool object = Object.clone()
cool object.foo = 'bar'
cool object.bar = -> a
{ b: a, c: 34 }
'baz'
end
Object.puts(cool object.foo)
Object.puts(cool object.bar(3))
Object.puts('Johnny is still', johnny)
Object.puts(oh my god)
Object.puts(myvar)
Something went wrong with that request. Please try again.