Page 1 of 1

It's A Very Small Word!

Posted: Sat Apr 18, 2009 11:35 pm
by teebee
My solution is 56 instructions long. Is there a smaller one?

Moreover, I could write a program with 58 instructions that prints out 'Hello, Small World!' and does not grow the operand stack larger than 25.

Posted: Sun Apr 19, 2009 6:16 am
by teebee
What about adding a corresponding "King of the Hill" challenge to the "It's A Very Small Word!" and "It's a Very Small World" challenges?

Re: It's A Very Small Word!

Posted: Wed Aug 17, 2011 11:36 pm
by teebee
teebee wrote:My solution is 56 instructions long. Is there a smaller one?
Yes, there is a smaller one:

Code: Select all

$ hackvm.py word55.hvm
Hello, Small Word!
--
length of code: 55
number of cycles: 322
operand stack depth: 4
maximum operand stack depth: 20
call stack depth: 1
maximum call stack depth: 9

Posted: Fri Jun 06, 2014 12:04 pm
by Hippo
Yes, I was shortennig till my Hello, Small World! was 58 op long ... and it was rejected due to "l".
57 op long Hello, Small Word! was no problem than.

Grrr ... teebee ... how do you reduce the code size ... the 2,5 years between posts is a small satisfaction.

Re: It's A Very Small Word!

Posted: Tue Sep 30, 2014 11:03 pm
by Hippo
teebee wrote:

Code: Select all

$ hackvm.py word55.hvm
Hello, Small Word!
--
length of code: 55
number of cycles: 322
operand stack depth: 4
maximum operand stack depth: 20
call stack depth: 1
maximum call stack depth: 9
Grrr, I am on

Code: Select all

$ hackvm.py word55.hvm
Hello, Small Word!
--
length of code: 55
number of cycles: 338
operand stack depth: 6
maximum operand stack depth: 22
call stack depth: 1
maximum call stack depth: 9
:) only small step divided me from the correct solution decreasing just stack depth by 2.
Seems I calculate number of cycles diferent way than teebee.

Actually, I have 2 solutions with max stack length 19 and code length 55.
(But it's just an easy modification of the solution)

Posted: Tue May 22, 2018 1:13 am
by TheBigBoss
The hardest part was letting the VM stop.
But 55 instructions? :( No way! End of road...