IMO, this challenge could have been more fun...

Add a reply

Posted by taleinat 771 days ago:
... if usage of built-in date functions was somehow disabled.
This would have required "golf"-ing some quirky calculations, rather than just wrestling with output formatting and annoying date APIs.

(In Python this could be acheived by disallowing importing of the "time" module and friends. Probably possible in other languages as well.)

Just my 2 cents.
Posted by Mark Byers 771 days ago:
Importing the time module is allowed ? ! ? !

D'oh!!

I did it by hardcoding the names of the days of the week, the names of the months, the number of days in each month (checking for leap years, etc)... in an efficient format of course. I managed to get a solution of 359 bytes this way!

Now I will have to have another go at this challenge using 'import time' to see if it makes it any shorter.

Does anyone have a complete list of the python modules that you are allowed to import? All I can find is this message:

A quick message to say that the re, zlib and most encode codecs are now all available.
Posted by carldr 770 days ago:
Mark, you can import all modules which are "builtin" to Python (os and sys, for example) as well as zlib and re.
Posted by marmalade 769 days ago:
Mark, you can import all modules which are "builtin" to Python (os and sys, for example) as well as zlib and re.

this may or may not be a good explanation of how you think it works. it is not how it works.

on my system, sys is builtin whereas time is loaded from disk only when the script imports it.

on your system, time is allowed. so is calendar. calendar is written in python.

what we need is a complete list of the python modules that you are not allowed to import!
Posted by carldr 767 days ago:
Modules like time, calendar and hashlib shouldn't be available, it was a problem with Code Golf that they were. Their availability has been removed.

Since their use wasn't permitted, and in the interests of fairness across all the languages, I've removed all entries which used these modules when entering the SHA-256 and Calendar challenges. If you've noticed that your entries have disappeared, this is why.

It may be that I've removed legitimate entries, but I was over-cautious to ensure I got all the ones I had to - Simply re-submit your entries, they'll be accepted as normal.

Sorry for the inconvenience this has caused, and I apologise for wasting the time of the users who have had their entries removed, especially if you didn't realise that the use of these modules were not permitted.
Posted by Mark Byers 767 days ago:
Thanks for fixing this, Carl.

I am glad you removed the modules and the solutions that use them, even though I was winning with a 102 byte solution!

Add a reply