Page 1 of 1

1k bouncing ball

Posted: Sat Jan 05, 2019 11:59 am
by Shaun_B
Here's a 1k bouncing ball demo using some useful memory saving techniques.

Code: Select all

   2 SAVE "B"
   3 CLS
   4 PLOT X,Y
   5 LET X=X+A
   6 LET Y=Y+B
   7 IF Y>=CODE "F" OR NOT Y THEN LET B=-B
   8 IF X>=CODE "Z" OR NOT X THEN LET A=-A
   9 GOTO PI
In direct mode, enter

Code: Select all

LET X=NOT PI
LET Y=X
LET A=NOT X
LET B=NOT Y
GOTO 2
Regards,

Shaun.

Re: 1k bouncing ball

Posted: Sat Jan 05, 2019 1:37 pm
by Dim_75
Small, simple, cool ! ;) :P

Re: 1k bouncing ball

Posted: Sat Jan 05, 2019 11:26 pm
by dr beep

Re: 1k bouncing ball

Posted: Tue Feb 05, 2019 12:22 am
by Crayon21
Very well done. what are the Not statements for though?

Re: 1k bouncing ball

Posted: Wed Feb 06, 2019 3:05 pm
by dr beep
NOT A will test if A=0

NOT 0 will give 1 as result
When A<>0 then NOT A will return 0 (false)

NOT A is 2 bytes, the shortest (bytesaving) test.

Re: 1k bouncing ball

Posted: Fri Mar 22, 2019 12:40 pm
by thedevworks
https://youtu.be/EJCFu95eAxI


Nice :) Fun.. Thanks!