ioccc-src / temp-test-ioccc

Temporary test IOCCC web site that will go away
Creative Commons Attribution Share Alike 4.0 International
28 stars 6 forks source link

Add alt versions to 1991/cdupont #1543

Closed xexyl closed 6 months ago

xexyl commented 6 months ago

There are three alt versions. One has a comment and an unused goto label removed that are warned against being removed; another has this done and is also beautified (which is also warned against) and the third is one that is just beautified.

This involved changing the 's' macro to be 'FILE' because otherwise it would read in the original code and not show the problem.

xexyl commented 6 months ago

This one is fun! I wondered what would happen and now everyone can see it easily.

lcn2 commented 6 months ago

3 alt versions seems a bit excessive ..

xexyl commented 6 months ago

3 alt versions seems a bit excessive ..

Well I can delete one or two or three. Probably just have two: one for with it beautified and one with the label removed. Which is how I was planning on it but the order I did things in caused the third. I will change that when I am at the laptop later on.

xexyl commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

lcn2 commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

The question was if those versions reflected the intent of the author.

xexyl commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

The question was if those versions reflected the intent of the author.

I thought it did because it shows what would happen if those things were removed. It shows how clever the code was. That to me was a bonus. But I don't know.

lcn2 commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

The question was if those versions reflected the intent of the author.

I thought it did because it shows what would happen if those things were removed. It shows how clever the code was. That to me was a bonus. But I don't know.

We was the "... and the cdupont.alt2.c is beautified" that went to far as being well outside of the original intent of the author. There were 3 alt versions, of which (if we recall correctly) one was "beautified": and it was that beautification which seemed well outside of the original intent (or are we mistaken: we don't think the author supplied a beautified version).

Perhaps instead of the beautification alt code, the other 2nd alternate could be left in the directory?

xexyl commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

The question was if those versions reflected the intent of the author.

I thought it did because it shows what would happen if those things were removed. It shows how clever the code was. That to me was a bonus. But I don't know.

We was the "... and the cdupont.alt2.c is beautified" that went to far as being well outside of the original intent of the author. There were 3 alt versions, of which (if we recall correctly) one was "beautified": and it was that beautification which seemed well outside of the original design.

Perhaps instead of the beautification version, remaining the other 2nd alternate could be left behind?

Hmm .. maybe just the one with the goto label and comment removed then? I can do that but not today I fear. Half asleep.

Or alternatively just go back to suggesting it is done I guess. Seems more fun to have it but up to you.

xexyl commented 6 months ago

Fixed. I think it's a shame though as it showed different output.

The question was if those versions reflected the intent of the author.

I thought it did because it shows what would happen if those things were removed. It shows how clever the code was. That to me was a bonus. But I don't know.

We was the "... and the cdupont.alt2.c is beautified" that went to far as being well outside of the original intent of the author. There were 3 alt versions, of which (if we recall correctly) one was "beautified": and it was that beautification which seemed well outside of the original design. Perhaps instead of the beautification version, remaining the other 2nd alternate could be left behind?

Hmm .. maybe just the one with the goto label and comment removed then? I can do that but not today I fear. Half asleep.

Or alternatively just go back to suggesting it is done I guess. Seems more fun to have it but up to you.

It should be noted that the beautified version doesn't really give anything away but I can see the point even though it also shows the brilliance of it (without sacrificing things I think but again I see the point). I'm too tired to address it now but tomorrow I'll remove that version - or maybe both depending on how it seems at the time. I'm somewhat inclined towards that but I woke up today not feeling well so maybe that's part of it.

Hope you have a good rest of your day.

lcn2 commented 6 months ago

Deobfuscating code, unless the original author supplied such a version or unless the original author wanted such code to be added, seems to be a level tampering that goes too far.

It is one thing for the judge's of author's remarks to discuss internals of the code (and even present code fragments that help illustrate the explanation), and it is quite another to turn the code into a less obfuscated version for the same of "code cleanup".

And one does NOT want to try and explain everything about the code: such complete explanations should left to the reader to try. And deobfuscating code should be left as an exercise to the reader unless the author wants to supply such code.

There is far too much work left to be done to get the IOCCC restarted than to spend time beautifying code in our option.

We recommend, if it seems reasonable, to leave behind the 2 obfuscated alternatives, and to try to resist going into exploring the winning code.

xexyl commented 6 months ago

Deobfuscating code, unless the original author supplied such a version or unless the original author wanted such code to be added, seems to be a level tampering that goes too far.

It is one thing for the judge's of author's remarks to discuss internals of the code (and even present code fragments that help illustrate the explanation), and it is quite another to turn the code into a less obfuscated version for the same of "code cleanup".

And one does NOT want to try and explain everything about the code: such complete explanations should left to the reader to try. And deobfuscating code should be left as an exercise to the reader unless the author wants to supply such code.

There is far too much work left to be done to get the IOCCC restarted than to spend time beautifying code in our option.

We recommend, if it seems reasonable, to leave behind the 2 obfuscated alternatives, and to try to resist going into exploring the winning code.

I'll just worry about trying commands to make sure things work then. But there's no deobufscating going on here. Nor would I do that. As for time taken it took about only a few seconds so there's no harm there. Anyway I'll remove the alt versions - tomorrow.

xexyl commented 6 months ago

Decided to just do it now. Leaving for the day. Will do more tomorrow. No idea how much but I guess I would finish 2011 in no more than two or three days. Have a great afternoon.

xexyl commented 6 months ago

... even so I do want to reiterate that there was no deobfuscation going on. I would not do that. Of course not. There was no tampering. I just removed the label so that one could see what would happen easier rather than making them do it themselves. This would allow one to enjoy the brilliance of the entry.

It's okay if that's not wanted whether due to a misunderstanding or something else (my guess is the latter) but I do want to clarify that part as it's important to me that I'm not doing this. I would agree with the idea that it would be tampering. But there was none of that at all.

Also I am not really exploring the entries at all. The only reasons I'll open the code is to make sure (for clang) that main() has the right number of args or if I can't get it to work. The latter is to make sure that I can write a proper bug description or if it's immediately obvious then fix it (if easy fix).

I feel that it's important to clarify that too esp as it's important that it's done.

I'm hoping I can do a bit here in a bit but not sure .. not feeling well today either. Hard night is one of the things but whether there's anything else I don't know. I certainly will work at some entries today but not sure if I can finish 2011. I have something to run by you in the other thread but for later on.

lcn2 commented 6 months ago

I'm hoping I can do a bit here in a bit but not sure .. not feeling well today either. Hard night is one of the things but whether there's anything else I don't know. I certainly will work at some entries today but not sure if I can finish 2011. I have something to run by you in the other thread but for later on.

Thanks for doing what you can here and best wishes for feeling better @xexyl

xexyl commented 6 months ago

I'm hoping I can do a bit here in a bit but not sure .. not feeling well today either. Hard night is one of the things but whether there's anything else I don't know. I certainly will work at some entries today but not sure if I can finish 2011. I have something to run by you in the other thread but for later on.

Thanks for doing what you can here and best wishes for feeling better @xexyl

Thank you very much - for the best wishes and also for the opportunity to help! I got a few more entries done. I have four to go for 2011 but right now I don't have the energy. If I don't finish them today I imagine I can finish them tomorrow.

I think I know part of the problem with 'not feeling well' but there's not much I can do about that one. Still I'm happy I got done today what I got done.