Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by dimava

6 hours ago

Since I know russian well, here's a proper translation for y'all

    FUNC FACT (N);
       NAMES: P;           (* variable names *)
       1 -> P;
       FOR I FROM 1 TO N ::
          P * I -> P
       DONE                (* endif *)
    RET: P                 (* return value *)
    END;                   (* end of function *)
    
    FOR N FROM 0 TO 6 ::
       ? "FACT(", N, ") = ", FACT(Н)   (* print *)
    DONE;

0 comments

dimava

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities