Programming Challenges Reloaded #1 : C64/C128 Screen Wipe
#1
On the former EverythingC64 forum I tried to start an occasional programming contest just for fun...thought I'd do the same thing here.

PCR #1 : C64/C128 Screen Wipe (whoa, just realized the acronym...no, these are not tests.)

Write a program to "wipe" the 40-col screen from right-to-left.  In other words, clear the right-most column (top/down or bottom/up), then the 2nd right-most column, etc. all the way to the left-most (first) column. Finally, set the cursor in the top-left position (HOME) and wait for a key press which will then end the program nicely.  Screen/text color does not matter.

Rules:
  • You may use any flavor of BASIC or Assembly you'd like. 
  • Program size will be counted by the number of bytes the program occupies on disk.
  • The counting of bytes on disk will be done via the BASIC program:
    .prg   bytecounter.prg (Size: 230 bytes / Downloads: 148)
    .d64   bytecounter.d64 (Size: 170.75 KB / Downloads: 155)

Submission:
  • Provide a .prg (or a .d64/.d71/.d81 containing the .prg) file containing your program. 
  • If BASIC was used, please specify what version of BASIC is required to run your program.
  • Put your .prg/.d64/.d71/.d81 online and post a link to it so we don't use up @sysop's disk space.
  • Alternatively, feel free to email your file to living8bit {'a' with a circle} protonmail {you know what here} com

Deadline:

Submissions are to be received by May 1st (I'm not critical on the time or zones...this is just for fun). 

Status/Rank:

I'll maintain a list here of those who have made submissions so you can verify yours was received.  After the deadline, participants will be reordered by bytes used (smallest to largest).

   BASIC versions:
  • (81-C128) Sysop, BASICv7

   Assembly Versions:
  • (264-C64) JJFlash, XC=BASIC*


Good Luck! 

--Living8Bit

*I put this version into the Assembly section because 1) you can't LIST the program on the C64, and 2) it technically requires SYS to execute.  So I figured it qualified as ASM more than BASIC.
Reply
#2
Great idea! 

Participants are welcome to upload their .prg, .d64, .d71, or .d81 here if they so choose.  I have included all of these file types as acceptable attachment formats for forum posts.  You can even post a .t64 file, if you wish to include that as an acceptable format for the competition.
Reply
#3
Hello there! Saw this programming challenge through a post by living8bit on Mastodon :)

I've attached my entry here: it's a machine-code program originally written in XC=BASIC (a cross-compiler for various Commodore platforms, including the C64 of course), so it must be loaded on the C64 with ",8,1". It launches with "SYS 2051".

So this is something in between actual BASIC and pure Assembly.

Thank you so much @sysop for quickly adding a "spoiler mechanism" to the forum!

Here is the source for my entry:
[spoiler]
Code:
OPTION NOBASICLOADER
OPTION STARTADDRESS = $0803 'so that the program starts with SYS 2051
Dim wScreenAddress as WORD : wScreenAddress = $0427 'screen address of the rightmost column, first row
Dim wScreenRowAddress as WORD
do
    wScreenRowAddress = wScreenAddress
    for bRow as BYTE = 1 to 25
        poke wScreenRowAddress, 32
        wScreenRowAddress = wScreenRowAddress + 40 'step to the next row
    next bRow
    wScreenAddress = wScreenAddress - 1 'step to the previous column
loop until wScreenAddress < $0400 'until the first row has been cleared
poke 211, 0 : poke 214, 0 'put the cursor on row 0, column 0, i.e. the "home" position
poke 198, 0 : wait 198, 1 'wait for a keypress
[/spoiler]


Attached Files
.prg   pcr01(sys2051).prg (Size: 264 bytes / Downloads: 127)
Reply
#4
Welcome @JJFlash to the forum!  It's great to have you aboard. 

I have now added the ability to include a "spoiler" to forum entries.  There's no GUI interface for it, so you'll have to click on the "View Source Code" icon (last icon in the tool bar above that looks like a printed page).  Once in this view, you can use the spoiler code like this:

Code:
[spoiler=Spoiler Demo] There is now a "spoiler" format for forum posts.[/spoiler]

Which gives you this:

[spoiler=Spoiler Demo]There is now a "spoiler" format for forum posts[/spoiler]

I hope this helps!
Reply
#5
(04-07-2023, 08:37 AM)sysop Wrote: Great idea! 

Participants are welcome to upload their .prg, .d64, .d71, or .d81 here if they so choose.  I have included all of these file types as acceptable attachment formats for forum posts.  You can even post a .t64 file, if you wish to include that as an acceptable format for the competition.


Thank you, and thanks for the spoilers adjustment.  I was thinking about the submission/src code issues.  Email is the best to keep the sources "private" until after the deadline, but I wasn't sure if it was really necessary for "fun" challenges.  Figured I'd feel it out first.



After the deadline, I'll have all programs available via Codeberg; figured that'd be a nice place to consolidate submissions.



By the way, in the code view of a post, is there a "tag" to indent?  For example when I put a heading and body:


Quote:Some Heading:
Body of section...
Line 2...


Can the body be auto-indented, like what the      icon does in office documents, to get:

Quote:Some Heading:
     Body of section...
     Line 2 also automatically indented...

Just curious...

--Living8Bit
Reply
#6
You're most welcome.  I'm happy to provide what ever tools/resources I can that the group will find useful.  Of course I'm limited. however, to what the platform can support.

As for indenting text, I'll have to do some investigating.

Update:

Code:
  Some code indented by starting the line off with two spaces.
    Some more code that is indented further by beginning with four spaces.  However this line will only indent on the first line and not for the entire paragraph.

That's about as best as I can figure out about indenting within the code block.  Don't forget, code is supposed to really be just that.... "code". Wink
Reply
#7
Question: by "any flavor of BASIC", does this mean this is also open to BASIC 7.0 on the C128? Or is this just for programming on the C64?
Reply
#8
(04-07-2023, 11:06 PM)sysop Wrote: You're most welcome.  I'm happy to provide what ever tools/resources I can that the group will find useful.  Of course I'm limited. however, to what the platform can support.

As for indenting text, I'll have to do some investigating.

Update:

Code:
  Some code indented by starting the line off with two spaces.
    Some more code that is indented further by beginning with four spaces.  However this line will only indent on the first line and not for the entire paragraph.

That's about as best as I can figure out about indenting within the code block.  Don't forget, code is supposed to really be just that.... "code". Wink

Yeah, that's what I figured.  And by code, I didn't mean the source code icon "<>", I meant the "post code icon" you spoke of - the document icon on the far right which reveals the formatting code of the post.

(04-08-2023, 12:13 AM)sysop Wrote: Question: by "any flavor of BASIC", does this mean this is also open to BASIC 7.0 on the C128?  Or is this just for programming on the C64?

I thought about that.  Since I called it "C64 Screen Wipe", I figured most would just do C64.  I'm fine with C128 submissions, but those should probably go into a 3rd section of submissions/ranks.
Reply
#9
(04-08-2023, 01:55 AM)living8bit Wrote: Yeah, that's what I figured.  And by code, I didn't mean the source code icon "<>", I meant the "post code icon" you spoke of - the document icon on the far right which reveals the formatting code of the post.

Ah, right.... I'm with you now. I tried a few things, but I couldn't get it to indent paragraphs like you described. The MyBB user forum wasn't much more help. I guess the editor is somewhat limited in that way. I might be able to do something like allow html code in the posts, but that opens up a whole new can of worms.

living8bit Wrote:I thought about that.  Since I called it "C64 Screen Wipe", I figured most would just do C64.  I'm fine with C128 submissions, but those should probably go into a 3rd section of submissions/ranks.

Great! Thanks! I have something for that category, but I might be the only one submitting for the 128. Wink
Reply
#10
I'm not a programmer.... but hey, I'm going to make a fool of myself and submit my solution to this challenge.  I wrote it in BASIC 7.0 on my C128.

The bytecounter program says it's 75 in size.



.d64   screenwipe.d64 (Size: 170.75 KB / Downloads: 148)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)