#1✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfOn 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?
Posted
#3✎ 270NeatNitFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthNight PersonI like the quiet night and sleep late.Express Yourself
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
Posted
#4✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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.
Posted
Edited
by 12Me21
#5✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfAnyway, 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 [email protected]
Posted
Edited
by 12Me21
#6✎ 214ColeslawProductionsWell, I don't know how to make a program read itself as it executes.
Posted
#7✎ 270NeatNitFirst WeekJoined in the very first week of SmileBASIC SourceWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthNight PersonI like the quiet night and sleep late.Express Yourself
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).
Posted
#8✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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.
' is the same thing as REM. Why would you count one as being different from the other?
Posted
#10✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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.
Posted
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?
Posted
Edited
by SquareFingers
#12✎ 960Y_ackHead AdminREM 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.
Posted
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
Posted
#14✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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 '
Posted
Edited
by 12Me21
#15✎ 214ColeslawProductionsDo carriage return (13) and/or line feed (10) characters need to be included in the count?
Posted
#16✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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.
Posted
#17✎ 180phil_ScholarReceived for knowing a great deal about programming topicsAchievementsosu! Is Awesome!I love osu!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteI 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.
Posted
#18✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfI 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.
Posted
Edited
by 12Me21
#20✎ 166012Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
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
Posted
Edited
by 12Me21