Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HAI 1.2
- OBTW
- So I don't want to think up a creative algorithm or something.
- It's the summer after all
- So I decided to get your attention by writing it in lolcode
- TLDR
- I HAS A N ITZ A YARN BTW Sets up Variable "N" as a string
- VISIBLE "HAI GIMME N~!" BTW Prompt for Input
- GIMMEH N BTW Recieve Input
- N IS NOW A NUMBR BTW Cast Variable "N" to an int
- I HAS A R1 ITZ 0 BTW Set up temps
- I HAS A R2 ITZ 0
- I HAS A RES ITZ 0 BTW Set up result variable
- IM IN YR LOOP UPPIN YR CNT TIL BOTH SAEM CNT AN SUM OF N AN 1 BTW Begin the Loop
- BOTH SAEM CNT AN 1, OH RLY? BTW Check if count is 1
- YA RLY BTW If true
- RES R SUM OF RES AN 1 BTW Res += 1
- R2 R RES BTW Set R2 to res
- R1 R 0 BTW set R1 to 0
- NO WAI BTW If False
- RES R SUM OF R2 AN R1 BTW Standard fibonacci calculation
- R1 R R2
- R2 R RES
- OIC
- IM OUTTA YR LOOP BTW Exit loop
- VISIBLE "FIB IS :" BTW Output results
- VISIBLE RES
- KTHXBYE BTW End of Program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement