Bouncing ball

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Bouncing ball

Post by Shaun_B »

Thanks for the tip. I'll have another listing today (unfinished version posted on my Twitter).

Regards,

Shaun.
Crayon21
Posts: 346
Joined: Sun Nov 04, 2018 2:33 am

Re: Bouncing ball

Post by Crayon21 »

reducing your code is a fun challenge.

currently working on that

no such luck :lol:
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
dr beep
Posts: 2060
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Bouncing ball

Post by dr beep »

IF NOT LEN INKEY$ THEN NEXT I
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Bouncing ball

Post by XavSnap »

Dr Beep :

12 IF NOT LEN INKEY$ THEN NEXT I

:lol:

Or

Just one line to wait:
11 RAND SIN SIN SIN SIN SIN SIN PI

Code: Select all

1 LET X=42 
2 LET Y=X 
3 LET X1=PI/PI 
4 LET Y1=X1 
5 FOR I=X1 TO PI STEP 0 
6 LET X=X+X1
7 LET Y=Y+Y1
8 IF X<1 OR X>42 THEN LET X1=-X1
9 IF Y<1 OR Y>62 THEN LET Y1=-Y1
10 PLOT Y,X 
11 RAND SIN SIN PI
12 UNPLOT Y,X 
13 IF INKEY$="" THEN NEXT I
14 REM DONKEYSOFT
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Andre
Posts: 46
Joined: Sat Jun 21, 2008 7:28 pm
Location: Chateauguay-Quebec-Canada
Contact:

Re: Bouncing ball

Post by Andre »

Here are my 2 versions of "BOUNCE" and "BOUNCE" with PLOT. My versions include bytes saving.
OR 227 bytes in 16 lines
AB 150 bytes in 11 lines
OR 217 bytes in 14 lines (PLOT)
AB 176 bytes in 13 lines (PLOT)
All these versions do not run in 1K, but my version with 150 bytes does run in 2K.
>>>>And you will notice the speed the ball bounces.<<<<
I know I made a mistake: I uploaded this reply in the wrong topic. Now it is at its right place.
Have fun!
Attachments
BounABplt.p
(1.06 KiB) Downloaded 146 times
BounceAB.p
(291 Bytes) Downloaded 126 times
The ZX81 pleasure is spreading, ANDRE***
http://zx81.ordi5.free.fr/andre
http://zx81.de/andre
Post Reply