remix logo

Hacker Remix

Ask HN: What's the most creative 'useless' program you've ever written?

82 points by reverseCh 3 days ago | 140 comments

I recently came across the concept of "useless" programs - pieces of code that serve no practical purpose but are fun, creative, or challenging to write. These could be anything from elaborate ASCII art generators to programs that solve imaginary problems. I'm curious to hear about the most interesting or creative "useless" programs the HN community has written. What was your motivation? What unexpected challenges did you face? Did you learn anything valuable from the experience? Some examples to get the ball rolling: 1. A program that prints the lyrics of "99 Bottles of Beer" in binary. A text-based game where you play as a semicolon trying to find its way to the end of a line of code. A script that translates English text into Shakespearean insults. Share your creations, no matter how quirky or impractical. Let's celebrate the joy of coding for coding's sake!

simonsarris 2 days ago

I like inserting art, like the header to https://simonsarris.com

A village pops up. There is no point to it. You can click to make more houses. You can right-click to drag things around. When I touch it again I think I'll add a sun and moon that track the time of day for wherever the user is located. Actually the footer has art too, each page has a semi-randomly assigned illustration from public-domain (old) art that I've found. Like drawings from James McNeill Whistler, for instance. I use his illustrations in 'useful' websites too.

Actually, I experimented with the sun/moon a few years ago, in this version: https://simonsarris.github.io/simeville/

If you left-click drag the sun downwards, you'll see the moon come up. That one is open source, but the code is quite slapdash compared to the new one. Also you have to click ITS TIME TO BUILD to get the buildings.

In general I think websites could be a lot more pretty (gorgeous even), silly, interesting, and a lot less corporate chic than they currently are.

sshine 2 days ago

I like having this kind of animation on my homepage, too.

Currently I just have an animated GIF background, but I've had some animated ASCII art in the past.

I'm currently working on animating a fractal drawn with HTML Canvas.

Your houses and pencil style are very cute, I feel inspired to make something similar.

I'd like if clicking in the same place would grow whatever's there.

gazook89 2 hours ago

For graphics, check out KM Alexander

laksmanv 7 hours ago

I have to agree, I really miss the 90's when websites had more of a fun artistic creative and personality feel than templated. I see the use for both, but I miss it :)

elevatedastalt 2 hours ago

If the moon is rising when the sun sets, it will be a full moon. But your graphic shows a partial phase :)

jinay 3 hours ago

When I was first learning computer vision, I wrote a program that could tell the time from an image of a clock [1]. I had no purpose for it besides the fact that it seemed like a cool problem to try and solve.

Years later, I get an email from a stranger in Korea, asking me how to run my program. Why would he want to use my silly program? Turns out you can adapt the code to read analog pressure gauges which is really useful for chemical plants. Goes to show that there's often a use for most things.

[1] https://github.com/jinayjain/timekeeper

j_bum 6 minutes ago

Thanks for sharing this. The blog article on building your pipeline was a fun read! Your solution has a nice blend of heuristics and DL.

If you’re ever interested in revisiting this click project, you could check out DeepLabCut [0]. A blogpost highlighted a toy example of training a DLC model to recognize clock arms [1], which may or may not be more consistent than your Canny approach :)

[0] https://github.com/DeepLabCut/DeepLabCut

[1] https://guillermohidalgogadea.com/openlabnotebook/training-y...

bambax 2 minutes ago

Cool anecdote!

nasseri 32 minutes ago

That is so frickin cool!

tholman 3 hours ago

I love a good useless program, I may have written more useless ones than useful. Here's a few of my faves from the last 10 years!

- A password strength page that insults you based on strength https://trypap.com/

- Minesweeper with 1 square https://onesquareminesweeper.com/

- Adding elevator music to "go to top" buttons https://tholman.com/elevator.js/

- CSS Animation library of obnoxious over the top animations https://tholman.com/obnoxious/

- A fake mosquito with the web audio api https://tholman.com/mosquito-js/

ZachSaucier 12 minutes ago

I can't believe you didn't even mention your website dedicated to this, Tim! https://theuselessweb.com/

Longer list here: https://tholman.com/

Loughla 3 hours ago

I will admit that I clicked the one square in the mine sweeper.

Not sure what I expected.

gazook89 2 hours ago

Seems to me it would already be solved by Minesweepers rules, the clock should be stopped.

darepublic 3 hours ago

Is it too much to ask that the back to top elevator animate an actual elevator travelling up the side of the web page. The elevator music is good but I need it to sound like it would in an actual elevator too. Thanks for these links, they gave me a chuckle.

karim79 3 hours ago

This stuff is amazing. Thank you! I especially love the mosquito app.

ajxs 4 hours ago

A long time ago I wrote a useless, but fun program that attempts to programmatically recreate a source image by randomly placing randomly sized, randomly coloured rectangles onto a canvas. If the result of this random application of colour is closer to the source image, it's kept, otherwise the changes are discarded. Over time, it gets reasonably close to the source image.

https://ajxs.github.io/pbp/

kristianp 10 minutes ago

I like how the code is just plain javascript, and less than 114 lines of code.

https://ajxs.github.io/pbp/main.js

IAmGraydon 3 hours ago

Isn’t this basically how stable diffusion works?

NotAnOtter 9 minutes ago

This is like the tech reporter's version of stable diffusion.

Does it have some similarities? sure. Is it easier to understand than actual stable diffusion? yes.

Is this basically how stable diffusion works? Not even close.

IshKebab 3 hours ago

No.

IAmGraydon 2 hours ago

I’m pretty sure it is, except instead of comparing the result to a source image, it is analyzed and scored by a model that was trained to recognize images.

Diti 30 minutes ago

Diffusion models are trained to denoise.

msephton 1 hour ago

It's kind of the opposite. Stable Diffusion starts with random noise, changes it, asks the model of it's representative of the goal, repeat. But there's much more to it.

nmax 3 hours ago

This is awesome.

ajxs 1 hour ago

Thank you very much! The browser landscape was very different when the original code was written, around 10 years ago. Maybe I'll revisit it and see if it can be optimised!