Jump to content
IGNORED

Logiker's Vintage Computing Christmas Challenge 2022


carlsson

Recommended Posts

Hi!

 

I finally broke the 90 byte barrier in Atari BASIC, with 86 bytes:

star-basic.gif

 

And 75 bytes in Turbo Basic XL:

star-tbxl.gif

 

Have Fun!

 

PD: could not upload the animated gif to the post, so I linked from another side. Is it possible to simply upload GIF as is?

 

  • Like 3
Link to comment
Share on other sites

57 minutes ago, dmsc said:

I finally broke the 90 byte barrier in Atari BASIC, with 86 bytes:

I think I can do the same if I want to leave the Ready prompt on screen at the end, which would make it 86 bytes also.

I just need to alter my loops so the last plot is at the bottom, rather than the middle (where it currently is).

 

Link to comment
Share on other sites

3 hours ago, dmsc said:

I finally broke the 90 byte barrier in Atari BASIC, with 86 bytes:

 

2 hours ago, MrFish said:

I think I can do the same if I want to leave the Ready prompt on screen at the end, which would make it 86 bytes also.

I just need to alter my loops so the last plot is at the bottom, rather than the middle (where it currently is).

 

Alright, I can only get mine down to 88 bytes (so far) with Ready printed at the bottom (still have screen cleared and no cursor).

Mine would have been 86 bytes, as I said, but one constant needed to be increased by a character; and then changing some terms around left ambiguity between a variable and the TO command, which forces a space there.

 

Edited by MrFish
Link to comment
Share on other sites

22 hours ago, MrFish said:

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...

 

The rules should have been more specific I think... memory/OS. I'm guessing using the OS will help too so perhaps there should have been more categories.

 

10 hours ago, carlsson said:

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.

Perhaps I should try to port my code to the C64 if I can find the motivation!

 

spoiler

Quote

74 bytes with xex header no OS use, I'm feeling that it's not optimal but I've run out of ideas.

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi!

 

And based on the best assembly version for the BBC, here is a 46 byte version for the Atari:

 

    org (256 - (tabend - star))

star

row
    lda #<table
    sta sx

char
sx = *+1
    lda table
sy = *+1
    adc table
    lda #42
    bcc put
    lda #32
put jsr $f2b0
    inc sx
    bne char

    jsr $F661
    inc sy
    bne row
    rts

table
    .byte $F0, $E0, $D0, $C0, $00, $10, $20, $30, $40, $30, $20, $10, $00, $C0, $D0, $E0, $F0
tabend

 

It uses a 17 byte table that prints a star if "TAB(X) + TAB(Y) > 1". It is 15 bytes shorter than the one I submitted 😛 

 

Have Fun!

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hi!

1 hour ago, MrFish said:

Wow... nice job. Interested to see what he did.

 

This is F#READY entry, at 58 bytes:

pl=$f2b0
    org $80
    inc 752
    lda #18
    sta 83
z   lda #144
    :3 lsr
    tax
    rol s, x
    lda #32
    bcc w
    ora #10
w   jsr pl
    pha
    dec z+1
    bne z
c   jsr pl
    pla
    dec k
    bne c
l   beq l

k .byte $90
s .byte $1F, $F0, $7F, $F0, $FF, $F1, $FF, $F7, $FF, $1F, $DE, $3, $1C, $7, $18, $C, $10, $10

 

This was my entry, at 61 bytes:

	org 140

start:

loop

yy = * + 1
    lda #16

    ; get ay = abs(y)
    jsr abs8
    sta ay
    tay

    ; get ax = abs(x)
xx = * + 1
    lda #25
    jsr abs8
    tax

    ; get w = abs(ax-ay)
    sbc ay
    jsr abs0
    cmp #5
    bcs space

    lda #42 ; STAR

    cpx #5
    bcc putch
    cpy #5
    bcc putch

space
    lda #32	; SPACE
putch
    jsr $f2B0

    dec xx
    bpl loop

    ; Init X
    lda #37
    sta xx

    dec yy
    bpl loop
    rts

abs8
    sec
    sbc #8
abs0
    bpl oka
    adc #255
    eor #255
oka rts

ay = *

 

The smallest BASIC entry for the Atari was my Turbo Basic XL code, 75 bytes:

0F.A=-8TO8:F.B=-8TO8:C=ABS(A)/9:D=ABS(B)/9:PUT42-C&D!ABS(C-D)*10:N.B:?:N.A

 

Have Fun!

 

  • Like 2
Link to comment
Share on other sites

2 minutes ago, dmsc said:

The smallest BASIC entry for the Atari was my Turbo Basic XL code, 75 bytes:

0F.A=-8TO8:F.B=-8TO8:C=ABS(A)/9:D=ABS(B)/9:PUT42-C&D!ABS(C-D)*10:N.B:?:N.A

 

What about your Atari BASIC program? It looks like you got it down from 86 to 84?

Similar to your TBXL code, or different?

 

Link to comment
Share on other sites

Hi!

52 minutes ago, MrFish said:

What about your Atari BASIC program? It looks like you got it down from 86 to 84?

Similar to your TBXL code, or different?

 

Similar, but larger as it can´t use bit operations:

 

0F.A=-8TO8:F.B=-8TO29:C=ABS(A):D=ABS(B):PUT#16,42-(C>4ANDD>4ORABS(C-D)>4)*10:N.B:N.A

 

Have Fun!

 

Edited by dmsc
Replaced PUT#0 with PUT#16
  • Like 1
Link to comment
Share on other sites

On 12/29/2022 at 5:17 PM, dmsc said:

And, after looking at the code again, here is an Atari version at 82 bytes (83 if you count the EOL):

 

0F.A=-8TO8:F.B=-8TO29:PUT#16,42-(B*B>16ANDA*A>16ORABS(ABS(B)-ABS(A))>4)*10:N.B:N.A

 

On 12/30/2022 at 3:27 AM, Preppie said:

This is the best I come up with.  The main loop is only 61 characters but it requires some setup so ended up being 89 characters.

 

Somewhat similar to mine, except you're using Drawto to draw your lines, whereas I'm using a loop for a continuous series of Plots; plus you're drawing diagonally, whereas I'm drawing vertically and horizontally.

 

In both cases here, I'd say you need to include the EOL in your character count; because it's supposed to be the file size; and you can't ENTER a LISTed file that doesn't have an EOL.

 

 

Link to comment
Share on other sites

11 hours ago, dmsc said:

And, after looking at the code again, here is an Atari version at 82 bytes (83 if you count the EOL):

 

0F.A=-8TO8:F.B=-8TO29:PUT#16,42-(B*B>16ANDA*A>16ORABS(ABS(B)-ABS(A))>4)*10:N.B:N.A

I was looking at your program earlier, and wondering if the ABS statements could all be inlined too.

 

Well, I think you win for the smallest Atari BASIC program (unrestricted); but how many bytes do you end up with if you clear the screen first, and keep the "Ready" and cursor from showing up at the end?

 

Link to comment
Share on other sites

On 12/12/2022 at 4:23 PM, MrFish said:

Alright, I can only get mine down to 88 bytes (so far) with Ready printed at the bottom (still have screen cleared and no cursor).

Mine would have been 86 bytes, as I said, but one constant needed to be increased by a character; and then changing some terms around left ambiguity between a variable and the TO command, which forces a space there.

Here's my 88 bytes version, which still clears the screen but leaves "Ready" (and no cursor) at the bottom (my version that suppresses the "Ready" prompt is 91 bytes - already posted above).

 

0GR.0:C.42:POKE755,0:F.A=8TO12:F.B=12-A TOA+4:PL.B,16-A:PL.B,A:PL.16-A,B:PL.A,B:N.B:N.A›

 

GRAPHICS 0
COLOR 42

POKE 755 , 0

FOR I = 8 TO 12

    FOR J = 12 - I TO I + 4
        PLOT J , 16 - I
        PLOT J , I 
        PLOT 16 - I , J 
        PLOT I , J 

    NEXT J

NEXT I

 

star80a.thumb.png.0528dd56b610ef5e5e9ab9e059559d90.png

 

star80a.lst

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, MrFish said:

Unfortunately you haven't replicated the screen here.

 

Maybe Logo can do the same thing in text mode, and let you choose the right character to draw with, and fill the object?

 

ah thanks, I totally thought we were doing an 8 pointed star.

 

I don't really know Logo, but you can add words, I suppose you could teach it the shape asterisk and then it would eventually come up with an approximation, but being as it is late to actually enter the contest with a funny entry...not much point :)  

  • Like 1
Link to comment
Share on other sites

Hi

8 hours ago, MrFish said:

Somewhat similar to mine, except you're using Drawto to draw your lines, whereas I'm using a loop for a continuous series of Plots; plus you're drawing diagonally, whereas I'm drawing vertically and horizontally.

 

In both cases here, I'd say you need to include the EOL in your character count; because it's supposed to be the file size; and you can't ENTER a LISTed file without an EOL.

Yes, I did not include it because I noticed that the C64 people reported "code size" instead of the full PRG size, to make the entries appear shorter 😛 This is the best C64 BASIC program, basically the same as my Atari BASIC one: https://files.scene.org/view/parties/2022/vccc22/christmas_star_challenge/serato_c64_basic_vc3-2022-68.zip

 

Have Fun!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...