Simple BASIC 'DATA Statement' Query.

Page 3/3
1 | 2 |

By wolf_

Ambassador_ (10076)

wolf_'s picture

03-08-2022, 19:30

But for a computer "0f" is the same as "f". So if you would abbreviate ff to a single f, then how would the computer know you want f (15) rather than ff (255)?

I really wouldn't put all this trouble into making your data a character less big.

By wolf_

Ambassador_ (10076)

wolf_'s picture

03-08-2022, 20:23

If you are bothered by commas, you can always go for something like this, the data fits one line @ width 80.

100 COLOR,0,0:SCREEN 5,2
110 FOR CH=0 TO 1
120  SP$=""
130  READ S$
140  FOR T=0 TO 31
150   SP$=SP$+CHR$( VAL("&H"+MID$(S$,1+T*2,2)) )
160  NEXT T
170  SPRITE$(CH)=SP$
180 NEXT CH
190 '
200 PUTSPRITE 0,(20,20),11,0
210 PUTSPRITE 1,(70,70),9,1
220 A$=INPUT$(1)
230 END
240 '
250 DATA "0F1F3060C6C6C0C0D0DCCFC360301F0FF0F80C06636303030B3BF3C3060CF8F0"
260 DATA "0101030307070F0F9EBEFFFF333303018080C0C0E0E0F0F0797DFFFFCCCCC080"

By Manuel

Ascended (19220)

Manuel's picture

03-08-2022, 20:51

2 is the same as 02 or 002, but not the same as 20 or 200.

Also, 22 is not the same as 2.

But 00, 000, 0000, is all the same as just 0.

Right?

By Hit-Biter

Master (166)

Hit-Biter's picture

04-08-2022, 11:23

Right,

BUT what I'm trying to figure is. 00 is still 0 but you have a right and left column At least that's the way i think about it and i believe the computer goes top left bottom left top right bottom right. Right? Meh its too early. I think I've got the just of it. Ive hand drawn all the data info in spaceman.bas out on graph paper plotting all the 1's and 0's and understand how a sprite is built which was my initial goal.I'm now starting to investigate how multi sprite sprites are assembled in the right order. One example was like this :-

1 3 while another example was like this 1 3 9 11
2 4 2 4 10 12
5 7 13 15
6 8 14 16

*NB i hope this Forum preserves 'space' data or my little table above will be a mess.

This makes no sense to me. Why not follow the per-existing convention of the sprite data and plot the sprites themselves from top left down the column and then move one column to the right. I will study this today so i can get a grasp on how the data info is plotted. Ive ignored this side of it up to now.

Another related question is that in the Spaceman.bas listing there are 4 sprites that are repeated. Exactly. i thought it was some oversight or corruption or perhaps id copied the listing down incorrectly but I've checked the original and its there too. So i tried removing the 'DUPLICATE' sprite data and it totally garbles all the sprite data ^^. Its lines 1430-1460. Again there's more for me too learn in how data lines are handled.

EDIT Well it looks like i cant tabulise figures in the posts but i also forgot to thank you all for your time and efforts to educate me. Its much appreciated. Thank You All.Cheers.

By wolf_

Ambassador_ (10076)

wolf_'s picture

04-08-2022, 13:04

For tables 'n such fixed-width things, use the code tags, that's the button above this reply frame that looks like [<>].

Page 3/3
1 | 2 |