Can someone "decypher this"?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
stefan bauwens
Posts: 4
Joined: Tue May 21, 2013 8:01 pm

Can someone "decypher this"?

Post by stefan bauwens »

Hi, I'm in a contest where we have to "get" the code seen on a computer in a video from Dragon Ball Z.
But since it's pretty unclear, and I'm not an expert in sinclair basic I'm sure I made plenty of mistakes when writing the code over by hand.

Code: Select all

470		 C+RND16+I|X=RND1639 | Y=RND|199
480		 LINE(320,100)-(X,Y),PSET,C| LINE(320,100)-(X,Y),PSET,O
490		 NEXT I
500		NEXT Z
510		   FOR Z=1 TO 5
520 '|||||<< BOX-Z >>|||||
530		 FOR I=0 TO 50
540		 J=I+2,C+(C+I)MOD8
550		 LINE(319-J,99-I)-(320+J,100+I),PSET,C,D
560		 NEXT I
570		 NEXT Z
580 '|||||<< BOX-Z >>|||||
590		FOR SS=1 TO 1000 STEP 10
600		 FOR I=0 TO 310 STEP SS
610		 J=I/3,3|C=(C+I)MOD7
620		 LINE(319-I,99-J)-(320+I,100+J),PSET,C,D
630		 NEXT I
640		NEXT SS
650 '|||||<< BOX-Z >>|||||
660		 FOR I=0 TO 100
670		 J=I/3,3
680		 LINE(319-I,99-J)-(320+I,100+J),PSET,O,D
690		 NEXT I
700 '|||||<< FLASH-3 >>|||||
710		 FOR J=1 TO 100 | C=RND16+I
720		 CONNECT(320,90)-(318,99)-(300,100)-(318,101)-(320,110)-(322,101)-322,101)-(340,100)-(322,99)-(320,90),C
730		 NEXT J
740		 FOR I=101 TO 319
750		 J=I/3,3
760		 LINE(319-I,99-J)-(320+I,100+J),PSET,O,D
770		 NEXT I
780 '|||||<< FLASH-3>>|||||
790		 FOR J=1 TO 100 | C=RND16+I
800		 CONNECT(320,90)-(318,99)-(300,100)-(318,101)-(320,110)-(322,101)(340,100)-(322,99)-(320,90),C
810		 NEXT J
820 '|||||<< STAR-3 >>|||||
830		 FOR J=1 to 100
840		 I=3,2|J
850		 C=RND16+I
860		 X1=(320-I)+RND|I| X2+RND|I+319
870		 Y1=(100+J)+RND|J|Y2+RND|J+99
880		 PSET(X1,Y1,C)|PSET(X2,Y2,C)|PSET(X1,Y2,C)|PSET(X2,Y1,C)
890		 NEXT J
900		GOTO 400
I'm quite sure I may have mixed 1 and I up. Also I used the '|' symbol, since it was pretty unclear and it looked quite the same. However, maybe someone knows the correct symbol?
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Can someone "decypher this"?

Post by PokeMon »

I am not sure for the Spectrum but I think this is not valid BASIC for the ZX80/ZX81 models. :shock:
stefan bauwens
Posts: 4
Joined: Tue May 21, 2013 8:01 pm

Re: Can someone "decypher this"?

Post by stefan bauwens »

Ah, I was almost sure it was Sinclair BASIC since it has those numbers before each line and most of the commands used seemed to be listed by Sinclair BASIC.

EDIT: Ofcourse, it may look not valid due to my mistakes in copying...
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Can someone "decypher this"?

Post by RWAP »

This is most definitely not Sinclair BASIC of any sort - it looks more similar to Visual BASIC.

The '|||| lines are remarks
The C variable is a colour (0 to 15)
The | line is equivalent to Colon :
PSET is an unknown parameter - this is used in Visual Basic, but then the parameter after this is whether the box / circle etc is filled, so that does not make sense. Oddly it is also used as a function in line 880 - which fits closer with it being equivalent to POINT.

I am not sure what CONNECT is at all -it looks to be a function which connects multiple points to create a polygon.
stefan bauwens
Posts: 4
Joined: Tue May 21, 2013 8:01 pm

Re: Can someone "decypher this"?

Post by stefan bauwens »

Thanks for the reply. I will continue my search. :)
gozzo
Posts: 452
Joined: Fri Jul 08, 2011 8:52 pm

Re: Can someone "decypher this"?

Post by gozzo »

Hmm...that LINE command is very similar to the Dragon 32 syntax (or any Microsoft BASIC, possibly?), but I've never heard of a computer using a CONNECT command..??? Maybe a Tandy color computer( very similar to the Dragon ), possibly the extended BASIC version machine,... maybe the coco-3...??
Last edited by gozzo on Tue May 21, 2013 10:14 pm, edited 1 time in total.
User avatar
1024MAK
Posts: 5116
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Can someone "decypher this"?

Post by 1024MAK »

As it stands, this listing is not valid for a ZX81 or a ZX Spectrum.

First both machines require the LET key word when allocating values to variables.
E.g.

Code: Select all

10 LET A=50
Second, a lot of the key words in your listing are not valid on a ZX81 or a ZX Spectrum, so this is not a ZX BASIC program.
If you want to convert it to run on ZX BASIC, you will need to work out which computer it was designed for, look-up what the key words mean or do on this system. Then work out how to do an equivalent action on ZX BASIC.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Rink
Posts: 165
Joined: Wed Jun 27, 2012 5:48 pm

Re: Can someone "decypher this"?

Post by Rink »

gozzo wrote:Hmm...that LINE command is very similar to the Dragon 32 syntax (or any Microsoft BASIC, possibly?),
Yup, that bit looks similar but the rest won't work on the Dragon.

MSX? That's a Microsoft BASIC with some oddities from other BASIC variants I'm more familiar with.
dr beep
Posts: 2076
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Can someone "decypher this"?

Post by dr beep »

RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Can someone "decypher this"?

Post by RWAP »

I thought that, but PSET is being used as a function not a command....

My guess is that this was not a real program - just something someone made up at the time!
Post Reply