Skip to content

Instantly share code, notes, and snippets.

@hiddenpower
Created April 24, 2013 18:20

Revisions

  1. hiddenpower created this gist Apr 24, 2013.
    19 changes: 19 additions & 0 deletions Ejercicio 1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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

    def fact(n)
    for i in 1..n
    (n-i).times{printf " "}
    for j in 1..i
    printf "*"
    end
    puts""
    end
    end