Excuse the lateness; I was off being a drunken lout and then I fell asleep in the garden.
Language is perl, because I basically only write in perl and C, and C's already been done in this thread. I'm also licensed to perpetrate COBOL, but that's no longer the firehose of money that it once was.
The biggest reason it looks ugly (outside of one-lining the whole thing) is the regexps used for numerical validation, which are just re-written forms of what Scalar::Util uses. One could simply use Scalar::Util qw(looks_like_number);
and then replace $x =~ m/^[+-]?\d+$/ || $x =~ m/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/
with looks_like_number($x)
but that's the beauty of the ol' Swiss Army Chainsaw: There Is More Than One Way To Do It.
Doesn't care about making it look nice for a human
Hey, now. What I committed there was perfectly nice! I could've done something like this: http://www.99-bottles-of-beer.net/language-perl-737.html
Thanks, it's perl then. It looks very close to PHP.
I got into website building and web design (mostly just write CSS now if not other light coding) roughly 11-12 years ago. Many times I've seen files on the server look like the image below.
https://cdn.ttgtmedia.com/digitalguide/images/Misc/custom_owa_10.jpg
CSS file - not easy to read for humans, but the server reads it just fine. It's just not designed to look pretty just for a server more or so to be able to read. Nothing to do with being nice and/or not being nice. It's just designed for a server and not for human eyes for the most part.
Bottles of beer website looks like some coder was bored and having a bit of fun with code. I think I've seen that one before myself. Someone shared it with me a long time ago.
(post is archived)