LoginLogin

Cont​est idea

Root / Site Discussion / [.]

12Me21Created:
On the PTC wiki, someone had a contest to create a game that was less than a kilobyte (1024 bytes!) I like these kind of contests, because it mainly tests your programming skills, and not how good you are at making a story, or anything like that. However, I think 1024 characters might not be enough (maybe 2048?) Is anyone interested in this contest, or have a better idea?

This is called "Code Golf" and I think this is a great idea! Computerphile made a video about a code golf program just 4 days ago. https://www.youtube.com/watch?v=MqZgoNRERY8

This is called "Code Golf" and I think this is a great idea! Computerphile made a video about a code golf program just 4 days ago. https://www.youtube.com/watch?v=MqZgoNRERY8
Sorry for going off topic, but speaking of that video, do you think it's possible to recreate that same tune and code in SB? Me, I don't know the first thing about MML, but some of you gotta know.... DiscordStew? :P Back on topic: Code golf is fun, I might participate. Would you accept submissions in plain text without a public code, that have not been tested? :P

This is called "Code Golf" and I think this is a great idea! Computerphile made a video about a code golf program just 4 days ago. https://www.youtube.com/watch?v=MqZgoNRERY8
Sorry for going off topic, but speaking of that video, do you think it's possible to recreate that same tune and code in SB? Me, I don't know the first thing about MML, but some of you gotta know.... DiscordStew? :P Back on topic: Code golf is fun, I might participate. Would you accept submissions in plain text without a public code, that have not been tested? :P
Well, yes, I guess. If I can get petit modem to work. Maybe instead of having a size limit, we would have a task to complete, and whoever does it with the smallest program wins. That would work well for a smaller contest, because you wouldn't need to worry about uploading the program to the servers, since you could just type it. So now we have 2 potential ideas: Create a game that is less than _ bytes, and the best game wins, or Solve a task, and the smallest program wins.

Anyway, here is the first contest Make a program to run in SLOT 1, that will tell you the size of the program in SLOT 0 not including comments. For example: BEEP 69'MEOW counts as 6 characters Rules:
  • Smallest program wins (comments will not be included in the count)
  • Must be faster than removing comments by hand
  • Needs to work 100% of the time*
  • It is NOT allowed to modify SLOT 1 (you can use SLOT 2 though)
*things to be careful of:
  • ' in a string
  • skipping the CR after a comment
note: REM doesn't count as a comment Example output:
RUN 1
6
[NAME]OK
for the MEOW example. Send code to 12Me21.MC@gmail.com

Well, I don't know how to make a program read itself as it executes.

Make a program to run in SLOT 0, that will tell you the size of the program in SLOT 0 not including comments.
I think you made a typo (bolded).

Well, I don't know how to make a program read itself as it executes.
Oops, I meant to say SLOT 1
Make a program to run in SLOT 0, that will tell you the size of the program in SLOT 0 not including comments.
I think you made a typo (bolded).
Fixed

REM does not count as a comment!
' is the same thing as REM. Why would you count one as being different from the other?

REM does not count as a comment!
' is the same thing as REM. Why would you count one as being different from the other?
REM is just a statement that makes smilebasic ignore the code after it. It doesn't even make the text green like ' And no one uses it.

REM is just a statement that makes smilebasic ignore the code after it. It doesn't even make the text green like ' And no one uses it.
All right, besides colour, ' is the same thing as REM. Is this enough reason to count one as being different from the other?

REM is more of a comment than ' will ever be. :^) Also, I have seen remarks used in Japanese programs. And I think in the samples as well.

REM is just a statement that makes smilebasic ignore the code after it. It doesn't even make the text green like ' And no one uses it.
All right, besides colour, ' is the same thing as REM. Is this enough reason to count one as being different from the other?
*whispers* sshh if we have to include that our programs will have to be longer//slapped

REM is just a statement that makes smilebasic ignore the code after it. It doesn't even make the text green like ' And no one uses it.
All right, besides colour, ' is the same thing as REM. Is this enough reason to count one as being different from the other?
*whispers* sshh if we have to include that our programs will have to be longer//slapped
Yes. No one is going to use REM in programs that are supposed to be as short as possible, anyway. EDIT: I think SmileBoom is trying to "phase out" usage of REM, since it's not in the suggestions when you type, and it doesn't have green syntax highlighting like '

Do carriage return (13) and/or line feed (10) characters need to be included in the count?

Do carriage return (13) and/or line feed (10) characters need to be included in the count?
Yes. (this makes it simpler) All characters are included in the count, even control characters.

I will be participating in this contest. I'll probably have a program in on Friday since I either have work, school, or Judo before then.

I have discovered some amazing code compacting methods. I don't want to reveal all of them, but I will say: If the syntax highlighting works, then the code will work too (as long as it worked before compacting) X=1Y=1 is valid I'm going to make a new thread for this.


http://www016.upp.so-net.ne.jp/Khnum/petitcom/SBReduce.html
Cool, but it's not perfect: S=S XOR L$[I]==STR$(34) can be S=ASC(L$[I])==34XOR S (saves 2 bytes) It also gives tons of errors with my shortened code For some reason it removes : even though that doesn't impact size