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.
It's A Very Small Word!
Re: It's A Very Small Word!
Yes, there is a smaller one:teebee wrote:My solution is 56 instructions long. Is there 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
Re: It's A Very Small Word!
Grrr, I am onteebee 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
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
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)
- TheBigBoss
- Posts: 29
- Joined: Thu Jun 07, 2012 12:07 pm
- Location: Germany