Page 1 of 2

Can someone "decypher this"?

Posted: Tue May 21, 2013 8:07 pm
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?

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 8:10 pm
by PokeMon
I am not sure for the Spectrum but I think this is not valid BASIC for the ZX80/ZX81 models. :shock:

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 8:20 pm
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...

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 8:55 pm
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.

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 9:57 pm
by stefan bauwens
Thanks for the reply. I will continue my search. :)

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 10:09 pm
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...??

Re: Can someone "decypher this"?

Posted: Tue May 21, 2013 10:13 pm
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

Re: Can someone "decypher this"?

Posted: Wed May 22, 2013 9:36 am
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.

Re: Can someone "decypher this"?

Posted: Wed May 22, 2013 12:41 pm
by dr beep

Re: Can someone "decypher this"?

Posted: Wed May 22, 2013 8:27 pm
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!