Live data from Hacker News

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

news.ycombinator.com

11–20 of 422 posts

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

#12
A combinator reduction evaluator with a translator from lambda calculus to combinators. The creative part was getting a C compiler to parse combinator expressions with the traditional syntax, where function application does not have an operator and is left-associative, like S K K. http://www.ioccc.org/years.html#1998_fanf

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

#13
post #8

I learned in college Geometry class that you can transform a square to an equilateral triangle in 11 cuts or so So I wrote a matlab program to draw the shapes, and cut them out, and it works It’s mathematically exact, not just approximate Still surprises me after 20 years, so I want to find this old program again lol

This got a downvote and I wonder if it’s from a person who doesn’t think it’s true

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

#14
Many years ago I wrote a text editor in brainfuck. It wrote out the file in memory as the user typed, and it'd shift its data structures successively farther in memory to avoid overwriting them as it went. A friend gave it one of the best compliments I've ever received and called it beautiful after watching it execute in a memory editor.

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

#15
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.

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

#16
post #13
post #8

I learned in college Geometry class that you can transform a square to an equilateral triangle in 11 cuts or so So I wrote a matlab program to draw the shapes, and cut them out, and it works It’s mathematically exact, not just approximate Still surprises me after 20 years, so I want to find this old program again lol

This got a downvote and I wonder if it’s from a person who doesn’t think it’s true

Or perhaps from someone who doesn't think it's useless

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

#18
A decade and a half ago, I came across this beautiful bar in Bahrain (online) that was visually appealing to the eye with contrasty colors. I was so fascinated by it that I started writing a simple algorithm to just extract out the dominant colors in the image, just for fun, but mostly because I was so lazy to open Photoshop and pick the colors out manually.

Turns out, this is actually a real challenging task for computers - what the eyes perceive as dominant, computers do not and vice-versa. For example, if you draw a small circle on a black board with white chalk, take a picture of it and ask a computer, it will tell you black is the dominant color because it covers most of the pixels. Whereas, any human would tell you the white drawing is the dominant color because it stands out.

There are some ways of guiding the computer to get the color palette you want out of an image, but they are never as accurate. Over the years, I would from time to time, throw a bunch of images at it - ranging from portraits to beautiful flowers from gardens to see how my algorithm would perform and improved it bit by bit. I would say, it is close to 90% accuracy now and I still work on it over the weekends. It has no use cases so far (for me). It just exists as a pure passion project that got me excited about programming such algorithms.

Recently, I did a Fashion degree just out of passion and I realized this code has so much applications for things like making mood boards and color palettes from inspiration boards. However, none of my professors nor fellow students were impressed or saw utility in it because they believed no algorithm can match or replace a true creative process. They are pretty old-school about this, so, there's that. But, they just didn't seem to understand the technical challenge about this seemingly simple task.

However, over the years, I did build an API around this algorithm, kept fine tuning it and even made some marketing material for it. For no purpose other than reminding myself of why I am excited about programming.

If you're interested, here is a decade old snapshot of the algorithm's output:

https://ibb.co/SvYLLG3

https://ibb.co/tHKf9T8

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

#19
I recently managed to fit Loader's number, which is about the largest finite number ever conceived of that's still computable by a small program, into a mere 233 bytes of code. No practical use except as an entry in golfing contests [1].

[1] https://codegolf.stackexchange.com/questions/176966/golf-a-n...

Post reply on HN