Quinine
Quinine
I wonder if this is possible with optimizing the "standard technique" of building quines (i.e., two parts of the program for data and code). I tried different variants, but no matter how I turn it, I don't seem to be able to get it much below 120 instructions (including data). Does this challenge require a completely different approach?
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
From what I've seen, the standard technique is pretty much the only way of doing it. There are some exceptions, but in a closed enviroment with a language like HVM, it IS the only way.
You'll find that data and "real code" are directly proportional in size. Make sure your data is resonably well condensed, and then work on optomizing the computational aspect. Taking a single char off the real code should actually save a few overall.
I'm not sure exactly how your program works, and I don't want to give too much away, but think about how you can better utilize commands. I've found that the easiest place to knock off a few chars is around goto/jump commands.
Good luck. I had tons of fun working on that challenge. I have about 3 pages of scribbles as I tried to get it working
You'll find that data and "real code" are directly proportional in size. Make sure your data is resonably well condensed, and then work on optomizing the computational aspect. Taking a single char off the real code should actually save a few overall.
I'm not sure exactly how your program works, and I don't want to give too much away, but think about how you can better utilize commands. I've found that the easiest place to knock off a few chars is around goto/jump commands.
Good luck. I had tons of fun working on that challenge. I have about 3 pages of scribbles as I tried to get it working
Grrr, I am on 114 after several days of optimizing . The main problem is the addressing issue of HVM...
[edit]112[/edit]
[edit]107[/edit]
[edit]106[/edit]
[edit]104 ... dead end[/edit]
I probably got it ... the original solution of length 141 used 2 calls to code encodding. Replacement to one call not only simplified the code, it also broken another constraint ... hmmm, not yet ... another dead end:(
Now I almost have it ... I just must make the code one op longer
[edit]95[/edit] ... which allows to read challenge solved thread ... what easily leads to 84 ... the last step to mighty quine 81 requires further thinking.
[edit]112[/edit]
[edit]107[/edit]
[edit]106[/edit]
[edit]104 ... dead end[/edit]
I probably got it ... the original solution of length 141 used 2 calls to code encodding. Replacement to one call not only simplified the code, it also broken another constraint ... hmmm, not yet ... another dead end:(
Now I almost have it ... I just must make the code one op longer
[edit]95[/edit] ... which allows to read challenge solved thread ... what easily leads to 84 ... the last step to mighty quine 81 requires further thinking.