Quine
-
- Posts: 273
- Joined: Thu Apr 10, 2008 9:47 pm
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...
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...
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.
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.
Last edited by tails on Sat Nov 29, 2008 10:53 pm, edited 1 time in total.
-
- Posts: 144
- Joined: Fri Mar 28, 2008 11:29 pm
- Location: #hacker.org on Freenode
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 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
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
-
- Posts: 273
- Joined: Thu Apr 10, 2008 9:47 pm
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
- dangermouse
- Posts: 89
- Joined: Sun Jun 05, 2011 8:14 pm
- Location: deep space computing AG
- Contact: