You are certainly not alone, my HVM solutions take up many instructions too. Sucks when you need to get below a certain threshold.rmplpmpl wrote:gosh, did this, but I won't tell you my #s of instructions... for King Mouse I will have to strip it down significantly...
King Rat
-
- Forum Admin
- Posts: 496
- Joined: Sat May 28, 2011 9:14 am
- Location: Germany
Your code must be:horst wrote:01+0^<0<:1:01-:5?0^<0>0^45*1-:3?1c0<p
I thought 37 instructions weren't that bad until I saw that mouse challenge
Code: Select all
01+0^<0<:1:01-:5?0^<0>0^45*1-:2?1c0<p
longer better faster stronger
If you can make it short make it efficient too, this is my long code:
* It doesn't use (abuse) the call stack
* It doesn't write on memory nor damaging the input data
* It uses at most 5 elements of the stack
* It doesn't use (abuse) the call stack
* It doesn't write on memory nor damaging the input data
* It uses at most 5 elements of the stack
Code: Select all
0<00^54*:2?3gdp!0^<0^3^:1:2?4g1v2vd1+058*-g
While I enjoyed writing this, it will definitely be a challenge to do the more brutal short ones.
Here's my code:
It abuses the call stack to return to the loop counter, doesn't freeze on 0 or negative inputs, and uses at most 5 slots on the stack, when swapping out the largest num.
Here's my code:
Code: Select all
0<10>0^0<<0^82*?:1-3?0<<0<1+0>5cdp
I am spoiled, in that I usually work with high level languages. I have recently been trying to get my head around using lower level languages and was pretty happy with my solution until I saw some of the ones here (and comments about call stack and efficiency)
I'm going to improve this, now I realize I can use the goto jump instead of a subroutine call. Funnily enough, I would have thought the subroutine call would have been "better practice".
Code: Select all
45*9c06-g1-0^0:55*?0^0^1-<1v<:1+1?$0^<1^1->$<p