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!
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.
Thank you for sharing.
But apparently this planet has some very strong radiation protection, possibly synthetic, that blocks out the strong ultraviolet light from their second Sun. That ultraviolet is reflected back in the visible spectrum from the surface of their moon though - thus giving the appearance of a crescent during the entire cycle. The "dark side" is still lit, just lit less.
That was fun ))
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.
I like to draw on my websites too. I write a gpu-rendered background for basically any website I make for fun.
https://gtblank.org
https://ungut.at
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
It might be cool adapt for a mobile office setup where you’re only present in one location for a few days but still want some automated creature comforts.
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...
Offer from some "big" business with digital / connected gauges and motorized valves were too much for customer. He wanted much, much cheaper.
There were special modems, which use pipe as data line (think something like 150 baud shared between all stations).
So, solution implemented by my friend was like:
1) Electric motor with gearbox to motorize valves, it was cheap, as standard electric motors are cheap and customer has its own mechanical shop, so everything was cobbled in-house from standard of-the-shelf components.
2) Modem for each station (it was inevitable)
3) Laptop with B/W web cam on each station.
4) Software which can read gauges from webcam shots.
5) Software which transmit values from all stations to central station and allows to manipulate valves from central station (no automation here, 24/7 human operators)
Laptops and cameras were not cheap from personal point of view, but like x100 cheaper than special gauges and valves offered by gas-pipe equipment manufacturer.
It was not called "computer vision" at this time.
(Although I don't know how it would compare to the latest generalist vision models... Clocks are pretty well labeled in photographs online, one would expect.)
This was back in the early 1990s when we worked at a company making Macintosh utility software. My friend, another coder, liked to arrange his Finder windows so that they reflected the underlying folder hierarchy and were perfectly aligned. I mean pixel perfect.
So one day I wrote an extension to patch the OS on his machine to randomly nudge a window by just a single pixel. But only rarely, maybe just two or three times a day.
It had the wanted effect. Every once in a while, I'd hear him huff or mumble "what?" to himself. A couple of days later he asked the room, "Have any of you guys been using my machine? I know someone has. They messed up a few of my windows." Everybody professes innocence and manages not to laugh.
A few more days and he's at his wits' end. He finally says he's going to take the morning to wipe his machine and reinstall the OS.
At this point, we can't contain our mirth, and he catches a couple of us trying to hide our laughter. It's over.
I confess. He's pretty pissed and lets me have it. But he's a hacker, and I know deep down he respects it just a little.
After lunch, we're back at our desks. We're working. It's quiet. Then, I hear him chuckling. "Yeah, that was pretty good."
Edited to add: As penance, I ended up modifying my OS hack to help my friend perfectly align his Finder windows. All he had to do was hold down the control key when he opened a folder, and its window would be perfectly snapped to its parent. A bunch of us started using it. I ended up releasing it as freeware under the name WindowStacker: https://info-mac.org/viewtopic.php?t=14300
I think I originally encountered it from one of Andrew Hussie’s works.
- 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/
Longer list here: https://tholman.com/
Not sure what I expected.
1: https://factorio.com/
Deleted Comment
YouTube playlist: https://youtube.com/playlist?list=PLkG32PHxWoJaetjKUMVRONWLg...
Language specification: https://esolangs.org/wiki/Funciton
Interpreter: https://codeberg.org/Timwi/Funciton
Deleted Comment
Dead Comment
https://ajxs.github.io/pbp/
I don’t remember what language he wrote it in, but I converted it to a react app that handled everything client side using html canvas and bitmap images. Not to publish or anything, just for fun.
https://github.com/callummcdougall/computational-thread-art
Is it? :)
https://ajxs.github.io/pbp/main.js
UPD: found one of them, https://axe312ger.github.io/sqip/ (look at the “SQIP primitive art” column in that page's examples table)
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.
I like to experiment with home automation things, and recently I added a feature to my system where I could push notifications with images to my phone (pretty much everything I do is entirely self-hosted btw). Then a Valetudo update came out - Valetudo is a FOSS replacement for the cloud services usually required for supported robot vacuums. You root your robot, block it from phoning home, install Valetudo, and now you have a robot that won't spy on you unless you specifically tell it to.
So the update introduced a feature where photos with obstacles recognized by the robot are available via the UI/API. So I put something together where I'll get the pic sent as a notification immediately.
In effect, it's like I've subscribed to the most boring instagram feed of the world. Just random low-quality pictures of items in my apartment. The low quality and weird perspective actually makes it look intentional or filtered, as if a mouse is being forced to make a collage for photography class but doesn't feel inspired at all.
I love my robot vacuum but I dare never run it when I’m not at home for fear or smearing poop all over my floor on accident. Sadly I didn’t shell out enough money for a bot with superior object detection.
https://www.youtube.com/watch?v=uWZu3rnj-kQ
I am curious though if I can model a dog turd out of something and have the robot recognize it properly....
Now you could probably attach a raspberry pi with a camera and a coral tpu to a cheaper robot, spend a week trying to get the TPU to work with its dependency hell (or use one of those cameras with object detection built in), and then probably not have much more control other than to pause the robot just in time. That might end up costing more than just to upgrade to a robot with poop detection that can automatically circumnavigate them.
My coworker and I created a GUI application in IDL (similar to FORTRAN), that would allow the user to open up several images of various wavelengths and combine them into a cylindrical map of the planet, showing its entire surface at a given point in time. After working on this for several months and creating a functional, and actually useful program, we realize that there was a blank space in the toolbar and we had no button that needed to be there. So we put in a button with a cat GIF that literally did nothing. We planned on having it do something jokey, but ran out of time.
I will always remember demoing this to my mentor, basically the world expert on all things Jupiter, showing him what the program did, thus justifying why JPL had spent several thousand dollars to have me as a research fellow. The disappointment in his eyes when he saw that dumb, useless, cat button was priceless.
This already sounds incredibly cool. I wish I had had an opportunity like this sometime. Sadly, nothing.
> The disappointment in his eyes when he saw that dumb, useless, cat button was priceless.
Some people tend to have no humour. I think it's hilarious.
I once wrote a p2p filesharing app in college for a networking class, and I had put an easter egg in there where if you requested a certain file (lenin.jpg?) it displayed ascii art of a communism meme and started playing a midi of the soviet national anthem.
My little old networking prof sets down to test my program, and of course, that's the file she requested. She slowly turns to me, looks me in the eye and says 'be honest, you spent more time on that than the actual assignment didn't you?' ...'yes'. She shakes her head and mutters 'nerds!' under her breath, lmao