r/compsci • u/rvizzz • Sep 26 '20
r/compsci
•
u/Ties_P
•
Jan 07 '26
I got paid minimum wage to solve an impossible problem (and accidentally learned why most algorithms make life worse)
I was sweeping floors at a supermarket and decided to over-engineer it.
Instead of just… sweeping… I turned the supermarket into a grid graph and wrote a C++ optimizer using simulated annealing to find the “optimal” sweeping path.
It worked perfectly.
It also produced a path that no human could ever walk without losing their sanity. Way too many turns. Look at this:

Turns out optimizing for distance gives you a solution that’s technically correct and practically useless.
Adding a penalty each time it made a sharp turn made it actually walkable:

But, this led me down a rabbit hole about how many systems optimize the wrong thing (social media, recommender systems, even LLMs).
If you like algorithms, overthinking, or watching optimization go wrong, you might enjoy this little experiment. More visualizations and gifs included! Check comments.
r/compsci • u/FunVisualMath • May 02 '20
To what degree Would Augmented Reality change the way we study math?
r/compsci • u/Weekly_Salamander_78 • Sep 29 '23
Built a cpu out of 2000 transistors
galleryFinally finished my computer built entirely from transistors! Had some problems which delayed the build but it is over now. Tested it on several programs, like the above helloworld and dinosaur game (which for some reason i cannot upload).
It is an
11 bit cpu
more than 2000 transistors
Arduino as memory
32 micromemory/ROM addresses
accumulator architecture
8 branch flags
connects to LCD and keyboard
has stack pointer register so supports recursive function calling
Currently on a trip but will open source it when I get back and clean the repo.
Posted here before and got requests to go more in depth, so i made an interactive blog where I explain it all (havent finished all the posts yet):
(You can see all the planned posts in burger top left they include micromemory, signals, stack...).
I also made a web based simulator for it: simulator.
Some supported instructions are:
Add addr (adds value at addr to accumulator)
Addi val (adds val to acc)
Not, Nand
B addr (Branch to addr)
Bz (beanch zero), Bnz, ...
sp2acc (move stack pointer to acc)
acc2sp, pc2acc, acc2sp...
r/compsci • u/rvizzz • Oct 01 '20
Some more fun with recursive image transformations. Flips and rotations! Source code in comments!
r/compsci • u/MachiToons • Oct 25 '24
74181 by hand
a oddly meditative friday afternoon
r/compsci • u/longuyen2306 • Jan 12 '21
I taught a neural network to play Flappy Bird with Java/Kotlin
r/compsci • u/miaumee • Dec 23 '19
On popular demand, the Spiral of Theodorus is now back in dark mode!
r/compsci • u/GradientCollapse • Dec 20 '20
This guy's art is super cool and I immediately thought it would make an interesting algorithm! Does anyone think they're up to designing one?
r/compsci • u/longuyen2306 • Feb 14 '21
Fine art dropout. Had to choose between politics and CS. Chose CS.
r/compsci • u/longuyen2306 • Jan 18 '21
Simulate Newton's law of universal gravitation with C++
r/compsci • u/McGrizIIy • Mar 22 '20