Re: Contest #2... Example Programs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bouncing 1s

201000000000	set reg 0 to 1000000000 
211		set reg 1 to 1 
2210		set reg 2 to 10 
259		set reg 5 to 9 - loop counter 
240		set reg 4 to 1 - RAM address 
 
loop 
560		set reg 6 to reg 0 
661		add reg 1 to reg 6 
??6 
		set RAM to reg 6 
241		set reg 4 to 1 
645		add reg 5 to reg 4 (offsets by 1, so don't use RAM 0) 
964		set ram[4] to reg 6 
275		set reg 7 to 6	-loop destination 
883		set reg 8 to [3] (which is RAM 0 or -1) 
658		add reg 8 to reg 5 
712		multiply reg 1 by reg 2 
075		jump to reg 7, unless reg 5 = 0 
 
		now have ram pattern set up, so count up and down 
		reg 8 subtraction unit 
		reg 0 direction indicator (up or down) 
		reg 5 loop counter 
		reg 4 ram address 
		reg 1 current number 
		reg 2 loop 2 address 
		reg 6, reg 7 delay loops 
 
259		set reg 5 to 9 
201		set reg 0 to 1 - going up 
241		set reg 4 to 1 - first ram address 
 
loop 2 
2232		set reg 2 to 32 (loop2) 
814		get ram in reg[4] 
??1		print it 
2699		set reg 6 delay 
loop delay 1 
279		set reg 7 delay 
loop delay 2 
678		decrement reg 7 
2340		set reg 3 to 40 
037		go reg 3 unless reg 7=0   loop delay 2 
668		decrement reg 6 
2338		set reg 3 to 38 
036		goto reg 3 unless reg 6=0 loop delay 1 
 
640		add direction indicator (reg 0) to ram address (reg 4) 
--?4 
658		decrement loop counter	(or add reg 8 to reg 5) 
025		goto loop 2, unless 0 
259		set reg 5 to 9 
708		flip direction counter 
022		always goto loop 2 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu