Advertisement
Guest User

I'm so fucking bored

a guest
Sep 3rd, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. HAI 1.2
  2.  
  3. OBTW
  4. So I don't want to think up a creative algorithm or something.
  5. It's the summer after all
  6. So I decided to get your attention by writing it in lolcode
  7. TLDR
  8.  
  9. I HAS A N ITZ A YARN BTW Sets up Variable "N" as a string
  10.  
  11. VISIBLE "HAI GIMME N~!" BTW Prompt for Input
  12.  
  13. GIMMEH N BTW Recieve Input
  14.  
  15. N IS NOW A NUMBR BTW Cast Variable "N" to an int
  16.  
  17. I HAS A R1 ITZ 0 BTW Set up temps
  18. I HAS A R2 ITZ 0
  19.  
  20. I HAS A RES ITZ 0 BTW Set up result variable
  21.  
  22. IM IN YR LOOP UPPIN YR CNT TIL BOTH SAEM CNT AN SUM OF N AN 1 BTW Begin the Loop
  23.  
  24. BOTH SAEM CNT AN 1, OH RLY? BTW Check if count is 1
  25.  
  26. YA RLY BTW If true
  27.  
  28. RES R SUM OF RES AN 1 BTW Res += 1
  29. R2 R RES BTW Set R2 to res
  30. R1 R 0 BTW set R1 to 0
  31.  
  32.  
  33.  
  34. NO WAI BTW If False
  35.  
  36. RES R SUM OF R2 AN R1 BTW Standard fibonacci calculation
  37. R1 R R2
  38. R2 R RES
  39.  
  40. OIC
  41.  
  42. IM OUTTA YR LOOP BTW Exit loop
  43.  
  44. VISIBLE "FIB IS :" BTW Output results
  45. VISIBLE RES
  46.  
  47.  
  48.  
  49. KTHXBYE BTW End of Program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement