]]> ]]>

Числа Фибоначчи в LOLCODE

Пример для версий loljs 1.1

Числа Фибоначчи вычисляются итеративно.

HAI
  I HAS A I ITS 0
  I HAS A FIB1 ITS 0
  I HAS A FIB2 ITS 1
  IM IN YR LOOP UPPIN YR I TIL BOTH SAEM I AN 16
    VISIBLE SMOOSH FIB2 ", "!
    I HAS A FIB3 ITS SUM OF FIB1 AN FIB2
    FIB1 R FIB2
    FIB2 R FIB3
  IM OUTTA YR LOOP
  VISIBLE "..."
KTHXBYE

Комментарии

]]>

blog comments powered by Disqus

]]>

Работа программистам