Omnimaga

Calculator Community => Contests => Community Contests => Topic started by: pimathbrainiac on June 05, 2015, 07:40:56 pm

Title: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 05, 2015, 07:40:56 pm
Since the main contest in this forum at the current time is Code Golf, this thread will be the place for the information, discussion, and planning of Code Golf.

Rules of Code Golf
Challenge Creator Rotation
To keep the work load off of one person, there will be a rotation of people making Code Golf challenges each week. If you want to be in the rotation, reply in this thread. The current rotation is:
1) @pimathbrainiac <- On deck
2) @c4ooo
3) @Juju
4) @JWinslow23
5) @Ivoah
6) @LDStudios <- Current challenge

Some rules for challenge creators
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Ivoah on June 05, 2015, 07:58:11 pm
Oh, I've an idea for a codegolf, could I host one?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 05, 2015, 07:59:01 pm
Sure! I'll add you after JWinslow.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Ivoah on June 05, 2015, 07:59:30 pm
Sure! I'll add you after JWinslow.
Sweet!
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on June 05, 2015, 08:54:37 pm
I think we should also have rules so counting bytes is consistent between challenge creators, like, convert newlines to UNIX style (you can do that in Notepad++ for you Windows users, one newline is one byte) and no ending newline (substract one for you Linux users I guess).
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Ivoah on June 05, 2015, 08:56:40 pm
I think we should also have rules so counting bytes is consistent between challenge creators, like, convert newlines to UNIX style (you can do that in Notepad++ for you Windows users, one newline is one byte) and no ending newline (substract one for you Linux users I guess).

I agree
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 05, 2015, 09:12:33 pm
There are several ways to score an entry that are generally used:
1) size in chars of source code
2) number of bytes of source code
And finally
3) output size in bytes of final compiled/fully runnable  program. (If your language is interpreted, like windows batch, use method 1 or 2, preferable 2)
I think that the host should have a choice as to what scoring method to use. :)
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 05, 2015, 09:15:13 pm
There are several ways to score an entry that are generally used:
1) size in chars of source code
2) number of bytes in source code
And finally
3) output size in bytes of final compiled program.
I think that the host should have a choice as to what scoring method to use. :)

I don't think number 3 is a good idea, since some languages have distinct advantages over others in binary size.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Ivoah on June 05, 2015, 09:15:50 pm
There are several ways to score an entry that are generally used:
1) size in chars of source code
2) number of bytes in source code
And finally
3) output size in bytes of final compiled program.
I think that the host should have a choice as to what scoring method to use. :)

I don't think number 3 is a good idea, since some languages have distinct advantages over others in binary size.

Yeah, #3 sounds like a bad idea (unless it's assembly language).
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on June 05, 2015, 09:19:04 pm
Number 3 is not pratical if we are to mix interpreted and compild languages, unless we accept assembly. For the newlines, the setup I described is the one we used before with JWinslow23 (I think) and is the one that minimizes the number of bytes. Also, for most purposes, we don't use characters above 127, so pretty much every character is 1 byte, although we should count characters.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 05, 2015, 09:20:44 pm
There are several ways to score an entry that are generally used:
1) size in chars of source code
2) number of bytes in source code
And finally
3) output size in bytes of final compiled program.
I think that the host should have a choice as to what scoring method to use. :)

I don't think number 3 is a good idea, since some languages have distinct advantages over others in binary size.
I recall some one saying over irc (forgot who might have been you) that "choosing your language is part of the puzzle, each has its pros and cons". :P
And no that was not a direct quote from irc, I forgot when the original was said  :P
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 05, 2015, 09:24:27 pm
There are several ways to score an entry that are generally used:
1) size in chars of source code
2) number of bytes in source code
And finally
3) output size in bytes of final compiled program.
I think that the host should have a choice as to what scoring method to use. :)

I don't think number 3 is a good idea, since some languages have distinct advantages over others in binary size.
I recall some one saying over irc (forgot who might have been you) that "choosing your language is part of the puzzle, each has its pros and cons". :P
And no that was not a direct quote from irc, I forgot when the original was said  :P
Yes, but compiled size makes for an unfair advantage. For example, assembly is not efficient in source, but the binaries are extremely small by comparison. We want this fair, although language choice is important.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Geekboy1011 on June 05, 2015, 09:28:28 pm
Case 3 is for competitions which focus on 1 language OR only compiled languages. There for for say basic is not really "acceptable" But with that it is up to the Host to make the rules for there individual contests. IF they choose to count that way they can.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 05, 2015, 09:36:45 pm
-snip-
This shows that balancing is hard. For example, using point one or two would then in turn backfire on asm.
But which method to use is not my main argument, what is is my suggestion that the hoster could chose  :hyper:
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Runer112 on June 05, 2015, 09:43:07 pm
The scoring system I'm most familiar with from other sites, and which I believe is the best, is the better of #2 and #3. So for most languages, it's the size of the source code/file, but for assembly, it's the size of the assembled machine code.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on June 05, 2015, 10:05:07 pm
I made a tool here (along with compiled stats), if it would help anyone. It correctly counts newlines and multi-byte characters.

http://juju2143.ca/golf/
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 06, 2015, 02:38:04 pm
All in favor of making Juju's counter the official counter for all non-calculator languages, say "aye."
All in favor of counting assembly as binary size, say "aye aye."
All in favor of counting TI-Basic and Axe as on-calc source size, say "aye aye aye."
All in favor of counting The Challenge Creator choosing the counting method, say "aye aye aye aye."
(all on separate lines of course)

My response:
aye.
aye aye.
aye aye aye.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 06, 2015, 02:51:50 pm
All in favor of making Juju's counter the official counter for all non-calculator languages, say "aye."
All in favor of counting assembly as binary size, say "aye aye."
All in favor of counting TI-Basic and Axe as on-calc source size, say "aye aye aye."
All in favor of counting The Challenge Creator choosing the counting method, say "aye aye aye aye."
(all on separate lines of course)

My response:
aye.
aye aye.
aye aye aye.
Aye
Idk Idk
Idk IDK
Aye Aye Aye Aye
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on June 07, 2015, 03:18:02 pm
Aye (for reasons I explained above)
Aye aye (it's nearly like writing your code in hex at this point.)
Aye aye aye (If assembly is gonna get counted in binary, then the same goes with BASIC. That's pretty much what we did before IIRC.)
Nay nay nay nay (I'd like if each contest had the same standarized, agreed-upon counting method.)
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Ivoah on June 08, 2015, 07:57:03 am
Aye (for reasons I explained above)
Aye aye (it's nearly like writing your code in hex at this point.)
Aye aye aye (If assembly is gonna get counted in binary, then the same goes with BASIC. That's pretty much what we did before IIRC.)
Nay nay nay nay (I'd like if each contest had the same standarized, agreed-upon counting method.)

I vote exactly the same as Juju
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on June 08, 2015, 10:36:29 am
All in favor of making Juju's counter the official counter for all non-calculator languages, say "aye."
All in favor of counting assembly as binary size, say "aye aye."
All in favor of counting TI-Basic and Axe as on-calc source size, say "aye aye aye."
All in favor of counting The Challenge Creator choosing the counting method, say "aye aye aye aye."
(all on separate lines of course)

My response:
aye.
aye aye.
aye aye aye.
Aye declare that tool as an official byte counter. If somehow not available, this may be used instead (https://mothereff.in/byte-counter), but use the byte count, not character count.
As pre-compilation hex files have a h-aye s-aye-ze, my opinion is that the final binary should be sized.
T-aye BASIC as source s-aye-ze, Axe as comp-aye-led program.
Of course, aye can't dec-aye-de the last one m-aye-self. I'm a bit b-aye-ased. :P
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: LDStudios on June 09, 2015, 05:33:10 pm
I would like to be added to the rotation
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 09, 2015, 06:28:05 pm
Added! Thanks for participating!
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: lirtosiast on June 09, 2015, 08:24:07 pm
The size of the program header for TI-BASIC entries should not be added to the scored size. Source means "length of code", not "file size stored in memory"; most languages have a header hundreds of bytes long on their files, and yet we don't count it. This gives an unfair advantage to non-calculator entries, whose headers are ignored.

I propose that TI-BASIC entries are counted as the size of the program in the [2nd][MEM] menu, minus the length of the name, minus nine bytes.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: TIfanx1999 on June 09, 2015, 09:03:25 pm
   All programs must be PM'd to the challenge creator or one of the Community Contests board moderators by 11:59:59 PM ET the following Saturday.
   

Forgive me if I'm completely missing something, but you cannot do attachments in PMs can you?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on June 10, 2015, 09:20:37 am
   All programs must be PM'd to the challenge creator or one of the Community Contests board moderators by 11:59:59 PM ET the following Saturday.
   

Forgive me if I'm completely missing something, but you cannot do attachments in PMs can you?

Most people either link to dropbox of the source/binary, or use a code bbcode to give their source.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: alberthrocks on June 10, 2015, 04:59:48 pm
I'd like to give it a go!
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 10, 2015, 05:27:14 pm
If somehow not available, this may be used instead (https://mothereff.in/byte-counter), but use the byte count, not character count.
@Juju 's Counter counts in bytes AFIK. :)

The size of the program header for TI-BASIC entries should not be added to the scored size. Source means "length of code", not "file size stored in memory"; most languages have a header hundreds of bytes long on their files, and yet we don't count it. This gives an unfair advantage to non-calculator entries, whose headers are ignored.

I propose that TI-BASIC entries are counted as the size of the program in the [2nd][MEM] menu, minus the length of the name, minus nine bytes.
True, i agree that headers should not count, including headers for shells like Doors and Mirage.

I'd like to give it a go!
No one is holding you back  :-*
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on June 10, 2015, 08:34:37 pm
If somehow not available, this may be used instead (https://mothereff.in/byte-counter), but use the byte count, not character count.
@Juju 's Counter counts in bytes AFIK. :)

The size of the program header for TI-BASIC entries should not be added to the scored size. Source means "length of code", not "file size stored in memory"; most languages have a header hundreds of bytes long on their files, and yet we don't count it. This gives an unfair advantage to non-calculator entries, whose headers are ignored.

I propose that TI-BASIC entries are counted as the size of the program in the [2nd][MEM] menu, minus the length of the name, minus nine bytes.
True, i agree that headers should not count, including headers for shells like Doors and Mirage.
Yes, but if you don't want to use it for some reason, I have used that as an alternative.

And when I did it, headers didn't count.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on June 10, 2015, 09:55:19 pm
And when I did it, headers didn't count.
What? ???
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on June 11, 2015, 01:55:54 pm
And when I did it, headers didn't count.
What? ???
TI-BASIC and Axe? Name and program header didn't count.

EDIT: As a heads-up, my incoming challenge has to do with Keith numbers. Let's hope everyone knows how to do Fibonacci-like sequences.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: lirtosiast on June 13, 2015, 10:48:12 am
Keith numbers. Interesting...

EDIT: I have a program to check if a number is a Keith number in 54 bytes.

Maybe I can be the first entrant to win an Omnimaga code golf contest before it's formally announced.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on June 14, 2015, 03:39:06 pm
I already wrote my announcement for my code golf, gotta be interesting. Gotta post it when it's my turn.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Runer112 on June 19, 2015, 12:11:51 pm
Should the Axe source header count? Every Axe program starts with a line of the format .OUTNAME to signal to Axe that it is an Axe source file and the target compiled file name. My inclination would be that it doesn't count, as the . part of the header is analagous to the file extension of a source file for a computer language and the compiled name part is analagous to, well, the compiled file name for a (compiled) computer language. And neither of those count against computer langauge entries.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: TIfanx1999 on June 19, 2015, 12:57:56 pm
I wouldn't think so either.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Sorunome on June 19, 2015, 02:29:36 pm
Well, but in php entries the header counts too ("<?"), so it's just fair to have the axe header count, too
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on June 19, 2015, 02:54:44 pm
See, the thing is, the name of the OUTNAME program could affect the size, too. But really, what I think should be the sizing for Axe is the binary size. It compiles to Asm anyways.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on July 13, 2015, 07:31:29 am
/me prods @LDStudios to post his code golf challenge for the week.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: LDStudios on July 13, 2015, 07:31:57 am
Hello, I am here. I won't be posting for a few hours because of work, but it will happen today.
EDIT: 28 second response time ^.^
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on July 13, 2015, 07:32:47 am
Cool beans! I'm sure it will be awesome!
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on July 13, 2015, 12:33:41 pm
We should encourage people to post the saturday before the challenge(preferably as closer to 12:00:00AM[last time me and @Juju got within 2 seconds :3] as they can). Being early is better than being late.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: pimathbrainiac on July 17, 2015, 07:33:10 am
Heads Up: Due to band camp, I will be unable to post a challenge next week, so @c4ooo will be next to post a challenge.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on July 17, 2015, 10:53:25 pm
Heard @c4ooo won't be able to host either, so guess it'll be my turn? Well I'm ready.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on July 18, 2015, 02:24:29 am
Actualy @JWinslow23 agreed to sub, so you won't have to host this week.  ;)
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on July 18, 2015, 11:08:08 am
Actualy @JWinslow23 agreed to sub, so you won't have to host this week.  ;)
Well, Juju can do his if he wants. Just to fit the order and stuff. But I have one ready, and am ready if he can't or doesn't want to.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on July 18, 2015, 02:21:25 pm
I also have one ready, but I'm not sure if it can be doable on calc. You have to send a bunch of bytes via the link port, although I could always make them save it to a string/appvar/screen/etc.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on July 18, 2015, 02:25:00 pm
And mine has to do with the SNES port of Family Feud.

More on that Monday.
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on July 18, 2015, 02:36:41 pm
That sounds fun. So who's doing it Monday?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on July 18, 2015, 02:50:17 pm
That sounds fun. So who's doing it Monday?
...I guess I will?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: Juju on July 18, 2015, 03:01:43 pm
Well, according to the OP that should be my turn, right?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: JWinslow23 on July 18, 2015, 03:03:54 pm
Well, according to the OP that should be my turn, right?
You have a point. Go right ahead. :)
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on July 24, 2015, 11:02:48 pm
I am still on my trip and will not be able to host again this weak :/ I guess @pimathbrainiac should go, or if he is still at band camp then @JWinslow23.
Edit: We have had some mix up with people gone, but I presume I will go next?
Title: Re: Code Golf - The Information/Discussion/Planning Thread
Post by: c4ooo on August 11, 2015, 12:46:21 pm
As you can see, there was no code golf this week. Interest has fallen, and until further notice there will be no code golf.  :(
I am currently setting up a group of logic puzzles, maybe I will post them here sometime.