This is a working program to calculate and print the first 10 values in the fibonacci sequence using sjl7678's interpreter.

This sample is horribly convoluted because of the limits of what's supported currently by sjl7678's interpreter. In fact, I had to tweak the interpreter a tiny bit to allow incrementing with negative numbers like this: UP VAR!!-1

Stay, 2007/05/31 02:21

HAI
VISIBLE "oh hai i find ur feebonachos fer u"
I HAS A BUKKIT
I HAS A OLDNUMBR
I HAS A RLYOLDNUMBR
UP OLDNUMBR!!
UP RLYOLDNUMBR!!
VISIBLE "1"
VISIBLE "1"
IM IN YR HOUSE
	I HAS A NEWNUMBR
	I HAS A COUNT
	
	IM IN YR LOOP
		UP COUNT!!
		IZ COUNT BIGGER THAN OLDNUMBR? KTHXBYE
		UP NEWNUMBR!!
	IM OUTTA YR LOOP
	
	I HAS A NEWCOUNT
	IM IN YR LOOP
		UP NEWCOUNT!!
		IZ NEWCOUNT BIGGER THAN RLYOLDNUMBR? KTHXBYE
		UP NEWNUMBR!!
	IM OUTTA YR LOOP
	
	VISIBLE NEWNUMBR
	
	IM IN YR FIX
		IZ RLYOLDNUMBR BIGGER THAN OLDNUMBR? KTHXBYE
		UP RLYOLDNUMBR!!
	IM OUTTA YR LOOP
	UP RLYOLDNUMBR!!-1
	
	IM IN YR FIXER
		IZ OLDNUMBR BIGGER THAN NEWNUMBR? KTHXBYE
		UP OLDNUMBR!!
	IM OUTTA YR FIXER
	UP OLDNUMBR!!-1
	
	IZ BUKKIT BIGGER THAN 10? KTHXBYE
	UP BUKKIT!!
IM OUTTA YR HOUSE
KTHXBYE
contributions/working-fibonacci-sample.txt · Last modified: 2007/05/31 02:33 by stay
Recent changes RSS feed Creative Commons License Donate Driven by DokuWiki