Quinine

Post Reply
tog
Posts: 70
Joined: Fri Nov 14, 2008 11:23 am
Location: Germany

Quinine

Post by tog »

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?
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

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 :P
tog
Posts: 70
Joined: Fri Nov 14, 2008 11:23 am
Location: Germany

Post by tog »

I probably tried a thousand of different variants and finally got one with 97 instructions. Now the challenge says it should be done in 93 instructions :shock: . Was the limit set down? I thought it was 97 instructions - at least, a couple of days ago.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Sorry, the limit was set down because therethinker and I found shorter solutions. If you find a still shorter solution, then the limit will be set down again and you will have the credit for this challenge.

EDIT: The limit was set back to 97.
Skeeve
Posts: 5
Joined: Sun Oct 26, 2008 7:37 am

Post by Skeeve »

Wow, this is a really nice challange.
I optimized my quine from 1800 chars down to 118 (and solved other small HVM challanges on the way). Still there's a bit to go... I didn't thought, that there are so many possibilities to optimize a HVM program.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Hi,

It's really hard to make the code shorter than 100. But, as the code gets shorter, it gets more and more artistic. So, have fun! :D
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

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.
Post Reply