dmsc Posted December 11, 2022 Share Posted December 11, 2022 Hi! 5 hours ago, MrFish said: Kind of apples to oranges. @dmsc's assembler version is 87 bytes, which is really close to mine; but maybe one of these assembly whiz kids has one in the 60's... This is the smallest one I have: But it does only work in XL OS, as it calls directly to the E: put-byte routine. I also have a 79 bytes one that writes directly to the screen, and works on any OS, bot does not return to DOS after execution: Have Fun! 4 Quote Link to comment Share on other sites More sharing options...
rensoup Posted December 11, 2022 Share Posted December 11, 2022 (edited) 19 hours ago, Panther said: The screen location depends on memory and other factors. Use SAVMSC ($58/$59). ah right... not exactly fair since we have different models but the C64 doesn't so they can write directly to the screen I guess. The minimum it adds is 4 bytes but then Altirra basic writes over it because the star is plotted on the 1st line. No issue with Atari basic. Just wondering what the other folks using asm do ? hardcode the pointer or read SAVMSC ? I'm thinking I'll just leave it hardcoded... it should work with any A8 with 64+KB with Altirra/Atari OS and Altirra/Atari basic Edited December 11, 2022 by rensoup Quote Link to comment Share on other sites More sharing options...
rensoup Posted December 11, 2022 Share Posted December 11, 2022 (edited) Also to people who posted sizes for asm versions, do you include the 6 bytes xex header ? Do you use the OS ? spoiler Quote 75 bytes including xex header but no screen clear and hardcoded screen addr Edited December 12, 2022 by rensoup Quote Link to comment Share on other sites More sharing options...
dmsc Posted December 12, 2022 Share Posted December 12, 2022 Hi! 4 minutes ago, rensoup said: Also to people who posted sizes for asm versions, do you include the 6 bytes xex header ? At least my sizes include the 6 byte header: it's 68 bytes of code plus 6 bytes of header, 74 bytes total. Have Fun! 2 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 26 minutes ago, rensoup said: I'm thinking I'll just leave it hardcoded... it should work with any A8 with 64+KB with Altirra/Atari OS and Altirra/Atari basic I don't see why not. There's nothing saying you have to code for the entire series of a machine. Although you might get some flak from those who are... Quote Link to comment Share on other sites More sharing options...
xxl Posted December 12, 2022 Share Posted December 12, 2022 (edited) 1F.Y=1TO13:F.X=1TOY:POS.4+x,Y:?"*":POS.13-Y+x,Y:?"*":POS.4+x,18-Y:?"*":POS.13-Y+x,18-Y:?"*":N.X:N.Y:pos.0,18 Edited December 12, 2022 by xxl 3 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted December 12, 2022 Share Posted December 12, 2022 (edited) 38 minutes ago, xxl said: 1F.Y=1TO13:F.X=1TOY:POS.4+x,Y:?"*":POS.13-Y+x,Y:?"*":POS.4+x,18-Y:?"*":POS.13-Y+x,18-Y:?"*":N.X:N.Y:pos.0,18 lol But it doesn't clear the screen. It would have to be: 1GR.0:F.Y=1TO13:F.X=1TOY:POS.4+x,Y:?"*":POS.13-Y+x,Y:?"*":POS.4+x,18-Y:?"*":POS.13-Y+x,18-Y:?"*":N.X:N.Y:pos.0,18 Edit: Lists to disk at 164 bytes and shrinks to 116 bytes. Runs when entered. When listed out, it's 4 lines plus 11 characters. It's interesting BASIC doesn't truncate the line. Very nice. 🙂 Edited December 12, 2022 by reifsnyderb Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 (edited) Alright, I guess if people are going to start letting the cat out of the bag, I'm gonna post mine and move on with life. This is 91 bytes (includes Atari line feeds here), prints on a clear screen, and has a goto at the end to keep the screen clear; and it's not centered. Centered version is 99 bytes. 0GR.0:C.42:POKE755,0:F.A=4TO8:F.B=A-4TO20-A:PL.B,A:PL.B,16-A:PL.A,B:PL.16-A,B:N.B:N.A›8G.8› And here's the expanded version that can be read. I'll probably post a commented one later, if anyone is interested. GRAPHICS 0 COLOR 42 POKE 755 , 0 FOR I = 4 TO 8 FOR J = I - 4 TO 20 - I PLOT J , I PLOT J , 16 - I PLOT I , J PLOT 16 - I , J NEXT J NEXT I 8 GOTO 8 star72.lst [edit] And, btw, @xxl's version above is 109 bytes (in case people are wondering). Edited December 12, 2022 by MrFish 4 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted December 12, 2022 Share Posted December 12, 2022 4 minutes ago, MrFish said: Alright, I guess if people are going to start letting the cat out of the bag, I'm gonna post mine and move on with life. This is 91 bytes (includes Atari line feeds here), prints on a clear screen, and has a goto at the end to keep the screen clear; and it's not centered. Centered version is 99 bytes. 0GR.0:C.42:POKE755,0:F.A=4TO8:F.B=A-4TO20-A:PL.B,A:PL.B,16-A:PL.A,B:PL.16-A,B:N.B:N.A›8G.8› And here's the expanded version that can be read. I'll probably post a commented one later, if anyone is interested. GRAPHICS 0 COLOR 42 POKE 755 , 0 FOR I = 4 TO 8 FOR J = I - 4 TO 20 - I PLOT J , I PLOT J , 16 - I PLOT I , J PLOT 16 - I , J NEXT J NEXT I 8 GOTO 8 star72.lst 91 B · 0 downloads [edit] And, btw, @xxl's version above is 109 bytes (in case people are wondering). Is this in Atari BASIC? I didn't know you could assign an ATASCII value to a color. Very interesting. Quote Link to comment Share on other sites More sharing options...
dmsc Posted December 12, 2022 Share Posted December 12, 2022 Hi! 29 minutes ago, MrFish said: Alright, I guess if people are going to start letting the cat out of the bag, I'm gonna post mine and move on with life. This is 91 bytes (includes Atari line feeds here), prints on a clear screen, and has a goto at the end to keep the screen clear; and it's not centered. Centered version is 99 bytes. 0GR.0:C.42:POKE755,0:F.A=4TO8:F.B=A-4TO20-A:PL.B,A:PL.B,16-A:PL.A,B:PL.16-A,B:N.B:N.A›8G.8› Mmmm... tried something like this, forgot the POKE 755,0 and the result looked horrible with all the cursors drawn everywhere 🙂 This would be about 3 chars less in FastBasic (no line numbers, no variable name after next, terminating with GE.A get key). Have Fun! Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted December 12, 2022 Share Posted December 12, 2022 Ok. Here's my last 2 attempts. The first is 158 bytes and the second is 147 bytes. 😞 2 Quote Link to comment Share on other sites More sharing options...
ClausB Posted December 12, 2022 Share Posted December 12, 2022 I had some trouble with PLOT so I used DRAWTO. 1GR.0:C.32:DR.9,9:C.42:A=8:B=8 2A=A-2:B=B-1 3DR.B,A:DR.16-A,16-B:DR.A,16-B:DR.16-B,A:DR.16-B,16-A:DR.A,B:DR.16-A,B:DR.B-1,17-A: 4IFA THEN2 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 (edited) 1 hour ago, MrFish said: ...I'm gonna post mine and move on with life. Actually, move on with life means working on some interesting variants that I had in mind. 1 hour ago, MrFish said: This is 91 bytes (includes Atari line feeds here), prints on a clear screen, and has a goto at the end to keep the screen clear; and it's not centered. Centered version is 99 bytes. Also, as I said, I can reduce both of these by 1 byte if I replace line #8 with just a GOTO 0. It then just repeats the program over and over. So, still no ready prompt or cursor. So, my final smallest versions are actually 90 bytes and 98 bytes; I just prefer the static-screen versions. Edited December 12, 2022 by MrFish Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 1 hour ago, reifsnyderb said: Is this in Atari BASIC? I didn't know you could assign an ATASCII value to a color. Very interesting. Go ahead and run it in Atari BASIC. It's Pretty well-known, I thought. Interesting fact: when I did my first version, I just stuck a random value into the color statement, intending to change it later to whatever was needed for the asterisk. My random value was 42. Haha... 1 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted December 12, 2022 Share Posted December 12, 2022 (edited) 6 minutes ago, MrFish said: Go ahead and run it in Atari BASIC. It's Pretty well-known, I thought. Maybe I knew at one time and forgot. It's been quite a while since I last programmed anything in Atari BASIC. I had to get the book out. 6 minutes ago, MrFish said: Interesting fact: when I did my first version, I just stuck a random value into the color statement, intending to change it later to whatever was needed for the asterisk. My random value was 42. Haha... 42 is always a good number. Edited December 12, 2022 by reifsnyderb Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted December 12, 2022 Share Posted December 12, 2022 Considering the 'brains' at MIT decided to use cluster computing to solve for 3 cubes problem of 42... I guess they didn't get the answer to life the universe and everything is indeed * sheesh Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted December 12, 2022 Share Posted December 12, 2022 11 minutes ago, _The Doctor__ said: Considering the 'brains' at MIT decided to use cluster computing to solve for 3 cubes problem of 42... I guess they didn't get the answer to life the universe and everything is indeed * sheesh Maybe the 3 cubes problem is why it took Deep Thought 7.5 million years? Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 57 minutes ago, ClausB said: I had some trouble with PLOT so I used DRAWTO. 1GR.0:C.32:DR.9,9:C.42:A=8:B=8 2A=A-2:B=B-1 3DR.B,A:DR.16-A,16-B:DR.A,16-B:DR.16-B,A:DR.16-B,16-A:DR.A,B:DR.16-A,B:DR.B-1,17-A: 4IFA THEN2 I like how yours expands as it draws. I was thinking of drawing in that pattern; but just for the outline. One of the problems with draw compared to plot is that draw abbreviates to 3 characters, whereas plot is just 2 characters. Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted December 12, 2022 Share Posted December 12, 2022 2 hours ago, reifsnyderb said: ............... It's interesting BASIC doesn't truncate the line. Very nice. 🙂 Line Editor is 120 chars. You can poke 82,0 to get a better idea. more could fit. the line buffer allows more and you can monkey with them if need be... Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 4 hours ago, MrFish said: One of the problems with draw compared to plot is that draw abbreviates to 3 characters, whereas plot is just 2 characters. Yikes... I'm wrong about that: plot is 3 characters too (I never looked that closely at my abbreviated code; just paying attention to total bytes). I guess it's print that's 2 characters instead. Seems kinda odd though, because it can already be abbreviated with a question mark. So, I guess the real big difference is that you're using 8 drawto's in your main loop (for the 8 points) and I'm using 4 plots in my main loop. 1 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 7 hours ago, reifsnyderb said: I didn't know you could assign an ATASCII value to a color. It's not assigning anything; it's selecting color #42. Setcolor is for assigning colors (or pokes, if you like). Quote Link to comment Share on other sites More sharing options...
xxl Posted December 12, 2022 Share Posted December 12, 2022 what would it look like in Atari LOGO? to ccc repeat 8[fd 13 rt 135] end ccc 2 Quote Link to comment Share on other sites More sharing options...
ClausB Posted December 12, 2022 Share Posted December 12, 2022 2 hours ago, MrFish said: Yikes... I'm wrong about that: plot is 3 characters too (I never looked that closely at my abbreviated code; just paying attention to total bytes). I guess it's print that's 2 characters instead. Seems kinda odd though, because it can already be abbreviated with a question mark. So, I guess the real big difference is that you're using 8 drawto's in your main loop (for the 8 points) and I'm using 4 plots in my main loop. Yes, I didn't see the double loop that you did. You should submit yours so as to represent our favorite machine. 1 Quote Link to comment Share on other sites More sharing options...
carlsson Posted December 12, 2022 Author Share Posted December 12, 2022 11 hours ago, rensoup said: the C64 [..] can write directly to the screen I guess. Colour memory on the C64 defaults to the background colour so you need two POKEs or a quick flickering of background colour, clear screen and flick the background again. That overhead adds bytes and execution time. Unfortunately there is no native PRINT AT or PLOT method, and going through Kernel calls for printing at a given position adds even more overhead than the two POKEs. Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 12, 2022 Share Posted December 12, 2022 5 hours ago, ClausB said: You should submit yours so as to represent our favorite machine. Yeah, I can represent Atari BASIC there. I have a few, more complex, variations I might submit too. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.