4 ms·
Years ago I participated in a CTF where one of the challenges was to produce Fractran programs that met certain requirements. They were relatively simple-soundi
by alexbock 10y ago
Years ago I participated in a CTF where one of the challenges was to produce Fractran programs that met certain requirements. They were relatively simple-sounding things like computing the nth power of two, but even that is a bit of a pain in Fractran. I initially tried something similar to this article, manually compiling programs that use only the (Turing-complete) JZDEC instruction on paper. Unfortunately, there was a length limitation which made this approach impossible as it did not produce fraction lists nearly as small as one can write by hand. I ended up finding it easier to write a program to brute force all possible Fractran programs under the length limit until one of them had the correct behavior than to actually write useful Fractran code by hand.
- aab0 10y agoThat's interesting. How do you brute force all possible Fractran programs when they take natural numbers? Did you have an upper limit like 10,000?
- alexbock 10y agoThe limit was quite small. There was a relationship between the number of distinct primes you allowed to appear and the number of registers the Turing machine it modeled had, but I don't remember the details. I don't recall the choice of composites being very important. There was a pretty natural limit that was apparent to me at the time but I've long since lost my Fractran intuition.