Live data from Hacker News

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

news.ycombinator.com

371–380 of 422 posts

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

#371
I wrote many. One I remember is writing a little piece of code that'd pick "optimal" starting positions in the board game The Settlers of Catan. Now by "optimal" I don't mean it was actually the absolute best position possible according to the complete rules of the game but the system would use a few heuristics to determine an optimal position according to simplified rules.

Then each "player" (well computer player really) would pick it's starting position in an optimal way according to these rules.

It's fun because the set up of the game begins like this (say there are three players):

    p1 puts his first village and one road
    p2 puts his first village and one road
    p3 puts his two villages and two roads at once
    p2 puts his last village and one road
    p1 puts hist last village and one road
The idea being that p1 is so advantaged by the fact that he picked the best spot, that he then gets to put his second village only after the other players have put everything in place.

So it's cute from an game theory point of view to find the "optimal" (according to my rules at least). It's just recursion. Each player knows that the next player is going to play optimally too and they all pick their spot(s) accordingly after having evaluated all possible positions.

> What was your motivation?

Just having fun.

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

#372
MacOS lets you interact with pretty much any gui element programmatically, and you make facetime calls from cli

My friend wasn’t picking up my calls, so i wrote a quick script to call, wait for the ring, end call and loop; let it loop 1000 times and left

Later found out he was sleeping on silent, and despite phone being in the charger he woke up to 0% battery. I accidentally created a weapon

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

#373
post #196

This is marginally useful, but I wrote a small ‘subleq’ playground — it’s an instruction set with just one instruction, “SUBtract and branch if Less-than or EQual to zero”. https://github.com/incanus/subleq It was fun to see how simple a model of computation could actually be.

Some people wrote a Forth interpreter on top of that.

Oh, this is totally also my jam. Will dig some of those up.

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

#375

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…

Wow awesome! Reminded me of Cucinelli's AI website: https://www.brunellocucinelli.ai/ which is one of the best one I've seen. It's dedicated to Mr Cucinelli's life and beliefs. The aesthetics are similar.

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

#377
This is something I did as an add-on to an obscure but useful data analysis. The notion is that people are most easily influenced by people who are "like" them. So, let's say you want to talk about politics; you don't necessarily want them to agree with you, but you want to find people to have engaging conversations with. Where do you go? Who do you talk to?

What we've got (hammer... nail...) is a precinct canvass (tells us how, at a level of hundreds of voters in a geographic area, people voted in an election). Can we do similarity matching and find geographic clusters which voted similarly? Yes, yes I think so. Before you scoff, this was tested at a larger level and met with great derision and paranoia before the principles underlying it were subsequently adapted as an organizing principle by a political organization whose turf was covered by the dataset.

So the notion here was: Plug in your precinct. Find other precincts which voted most like your precinct. Go to one of them, knock on some doors and see if you can find some like-minded people to agree / disagree with in a civil and engaging fashion.

I already walked my own precinct and was willing to do it... because I liked meeting people and found it entertaining. I thought this was a problem that people had: they didn't know where to go to meet people who they could actually engage with meaningfully about issues of the day. There's a caveat here: it's a two way street, and you might talk to people who change your mind about something or have some information that's not in your particular "bubble". Turns out that that is emphatically not what organized politics wants to do when they knock on doors.

http://elections.m3047.net/elections/perl/cluster-correlate....

For the record, I did walk some other precincts identified by this tool... just to see who lived there. It was eery, I felt like I could live in any one of those places much more strongly than just some random place in the city; the openness to conversation was similar to knocking on doors in my own precinct and much better outcomes from a standpoint of personal fulfillment.

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

#378
post #49

When working for a bank we had daily jobs where we had to input the date of the previous working day manually. This led to some human errors. I wrote code that automatically calculated the previous working date - including those floating dates around Easter. I generated calendars for future years to compare to know calendars to prove no discrepancies. My code worked. My management did not understand how it worked or…

That's dispiriting.

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

#380
post #231

I didn't expect it to be that useless. 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 ph…

I love everything about this. This is art
Post reply on HN