Hopefully Helpful Program - SpacingSpacers

It’s a command prompt .exe file written in c++. Basically, you input some length and the program will try its best to fill it with spacers (white one units, small black, big black, metal washer, Teflon washer). This is version 1 I guess. Feedback would be appreciated (the best programmers recognize their code will not work the first time, there are bound to be bugs).
Why did I make this? Idk, I got bored on a flight.
SpacingSpacers-v1.zip (17.8 KB)

5 Likes

Cool idea! Any chance you can share the c++ source? Could be useful for people running macOS/Linux, and/or to provide some feedback.

If you haven’t read up on the general version of this problem already, that might be of interest as well: Change-making problem - Wikipedia

1 Like

oh my! yeah i totally forgot the source code. i’m not very proud of the actual code tho because there are a lot of places which can be optimized but whatev it gets the job done.
SpacingSpacersCode-v1.zip (903 Bytes)

2 Likes

i checked out the problem too. man there are actual algorithms out there. i just brute forced it lol