]]> ]]>

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

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

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

HAI
  HOW DUZ I FIBONACCI N
    BOTH SAEM 1 AN BIGGR OF N AN 1, O RLY?
      YA RLY
        FOUND YR 1
      NO WAI
        FOUND YR SUM OF FIBONACCI DIFF OF N AN 1 AN FIBONACCI DIFF OF N AN 2
    OIC
  IF U SAY SO
  
  I HAS A N ITZ 0
  IM IN YR LOOP UPPIN YR N WILE N SMALLR THAN 16
    VISIBLE SMOOSH FIBONACCI N ", "!
  IM OUTTA YR LOOP
  VISIBLE "..."
KTHXBYE

Комментарии

]]>

blog comments powered by Disqus

]]>

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