3 ms·
Since code size is not restricted, the obvious solution is to store the entire list of numbers received in the program counter. In short, put every possible inp
by mikeash 14y ago
Since code size is not restricted, the obvious solution is to store the entire list of numbers received in the program counter. In short, put every possible input combination into the code, and just follow whatever branch pattern you receive.
This requires no memory other than that for the networking stack. It is, of course, also completely impractical.
- curiousdannii 14y agoThis was my thought as well. But if you can afford several TB of ROM you can probably afford to increase your RAM to 4MB.
- emn13 14y agoit's not TB of ROM. It' much, much more: 2^(2^20) addresses... Even if you're faking it and the addresses aren't real (inevitable with those numbers), you're still just cheating and storing data in a multi-megabyte dynamic (not ROM!) program counter. After all, you need to distinguish all those addresses...
- mikeash 14y agoIt's not cheating! If they wanted to limit the size of the program counter then they should have specified a limit on the amount of code!