Skip to content

Instantly share code, notes, and snippets.

@100lp
100lp / unsolved_lessons.rb
Last active June 19, 2016 03:22
If you prepend a constant with :: without a parent, the scoping happens on the topmost level. In this exercise, change push to return 10 as per A = 10 in the topmost level, outside the Kata module.module Kata
module Kata
A = 5
module Dojo
B = 9
A = 7
class ScopeIn
def push
ScopIn::A # (why if i write just "::A" - it work too ?)
end
def ctof(g)
#return ((g*9)/5)+32
return ((((g*9)/5)+32)*10).round / 10.0
end
ctof(100.43)
@hiddenpower
hiddenpower / Ejercicio 1
Created April 24, 2013 18:20
Ejercicio 1 Celsius a Fahrenheit y viceversa Imprimir pirámide de asteriscos
def ftoc(degree)
answer = ((degree -32) * 5.0 / 9.0).round(1)
puts answer
end
def ctof(degree)
answer = (degree * 9.0 / 5.0 + 32).round(1)
puts answer
end