fork download
  1. x = 10
  2. y = 25
  3. z = x+y
  4.  
  5. console.log("Sum of ", x , " and ", y , " is ", z)
  6. paridade = (x) -> if (x%2==0) then return "Par" else return "Impar";
  7. console.log(paridade(2521));
  8. factorial = (y) -> if (y==1) then return 1; else return y*factorial(y-1);
  9. console.log(factorial(6));
  10.  
Success #stdin #stdout 0.16s 319616KB
stdin
Standard input is empty
stdout
// Generated by CoffeeScript 1.12.3
(function() {
  var factorial, paridade, x, y, z;

  x = 10;

  y = 25;

  z = x + y;

  console.log("Sum of ", x, " and ", y, " is ", z);

  paridade = function(x) {
    if (x % 2 === 0) {
      return "Par";
    } else {
      return "Impar";
    }
  };

  console.log(paridade(2521));

  factorial = function(y) {
    if (y === 1) {
      return 1;
    } else {
      return y * factorial(y - 1);
    }
  };

  console.log(factorial(6));

}).call(this);