Page 2 of 3

Posted: Thu Nov 27, 2008 6:13 pm
by Allosentient
Yes, the 10,000 cycle limit is tough, but makes the challenge very interesting. I suspect there are many ways to solve it.

Posted: Fri Nov 28, 2008 4:28 pm
by efe
I'm making progress in this challenge, but my new solution still takes more than 10000 cycles.
My approach is to write a python program that prints out a hvm-quine.

The quine works like this C-Example: http://www.madore.org/~david/programs/selfrep/selfprt.c

For this kind of quine it is easier to construct a python program for building the hvm code instead of writing the hvm directly.

My quine is 1530 instructions long and executes in 16694 cycles. But I see some potential to make it shorter...

Posted: Fri Nov 28, 2008 9:30 pm
by efe
new record :) : 13832 cycles, 1412 instructions

now it gets tricky ...

Posted: Fri Nov 28, 2008 10:12 pm
by gfoot
My solution was 7889 cycles, 295 instructions. The more instructions you have, the more cycles it takes to print them out again later on! That said, your cycles/instructions ratio is a lot better than mine.

Posted: Sat Nov 29, 2008 2:52 am
by tails
Hi efe,

My first answer was 305 instructions long (oh, longer than gfoot's!), without any optimization. So, maybe you're thinking something a bit too complex, I guess.

Today I tried optimizing my code in size, and made it into 109 instructions long. It takes 1879 cycles.

EDIT: I optimized my code again and it is 97 instructions long.

Posted: Sat Nov 29, 2008 1:21 pm
by efe
Finally, I made it :D !

My solution takes 9751 cycles and is 636 instructions long.
There are some optimizations possible, but it is still a miracle to me how to do it with just 109 instructions.

Posted: Sat Nov 29, 2008 9:54 pm
by tails
Congratulations!

Posted: Sat Nov 29, 2008 11:45 pm
by tog
I also got it. Thanks to gfoot for pointing me to the standard techniques, which I didn't expect to exist at all :oops:. I didn't have any problems with the cycle limit. My first try (also without any optimizations) was already small enough (260 instructions, 5614 cycles),

Posted: Sat Nov 29, 2008 11:56 pm
by gfoot
Hmm, I hope that wasn't too much of a giveaway then!

Posted: Sun Nov 30, 2008 12:34 am
by therethinker
I'm pretty sure mine was less than 200 instructions, but I can't quite remember. I'm pretty sure it was about 1.5 lines in the JS implementation. I may be making this up, though :P It didn't loop too much either, so I'd be surprised if it was over 500 instructions...

I didn't love mine, I didn't think it was too optimized. However, looking at your solution sizes, I think I actually did pretty well :P

Posted: Sun Nov 30, 2008 12:55 am
by Allosentient
wow, i'd like to see both that one and the long one!

Posted: Sun Nov 30, 2008 3:12 am
by adum
hmmn, maybe i'll make a harder quine challenge...

Posted: Sun Nov 30, 2008 8:50 am
by tog
gfoot wrote:Hmm, I hope that wasn't too much of a giveaway then!
No, I don't think so. This hint only led me to learn about general techniques for quines. And learning is what the challenges are all about, right?

Posted: Sun Nov 14, 2010 9:33 pm
by nighthalk
holy @#$%# this is a tough one, managed to get mine down to 865 instructions, (curse that cycle limit) and i seriously have no idea how those insane people can get it to 97, too many symbols need to be stored which takes too many instructions to save which propagates through the functions needed to print all this =p

Posted: Thu May 31, 2012 10:20 am
by dangermouse
arhgs, mine is 309 chars and needs 11722 cycles to quine the quine! i think i need to do some deep analysis on the char representation to see how i can optimize it... :shock:

btw efe's essay on quines is impressive! there are even multiquines and a fix point theorem! crazy!