Page 2 of 2
Posted: Wed Dec 09, 2009 9:46 am
by wynksaiddestroy
Posted: Wed Dec 09, 2009 5:38 pm
by m!nus
Callstack abusing makes it shorter
Posted: Sat Sep 04, 2010 10:06 am
by licstar
00^<0:8?1+09-6-gp
Posted: Thu Oct 21, 2010 9:05 pm
by chephy
Oh well, I guess the solution I found is the most stupid around – but at least, I didn't need to think very hard while writing this: 02g1+0^<6?094+-gp.
Why didn't I think of doing the increment in the »loop body« -.-
Posted: Sun Jan 02, 2011 3:07 pm
by CStick
00^<8?1+067+-gp!
Posted: Fri Aug 19, 2011 2:04 am
by compudemon
00^<8?1+076+-gp
i like to do it straight forward
Posted: Thu Sep 22, 2011 12:53 pm
by horst
Somewhat long and dirty, but works and doesn't use callstack
09-2-00^1+0^<0:3^*gp
Posted: Sat Dec 31, 2011 12:30 am
by rmplpmpl
this has been the first _real_ HVM challenge I did, and I am pretty ashamed of my code. It works but it seems I have to learn a lot more comparing it to the most approaches posted here.
Anyway, I think I'll get some good ideas from here for King Rat
edit my code...
Code: Select all
099*> 99*<<0:6*g99*<p!199*<+99*>01-75**g
Posted: Sun Jan 01, 2012 1:44 pm
by laz0r
My compiler gives much shorter code when I use a recursive procedure:
219*+ g0^<0:1+$1+$025*cp
(ie. strlen[startPos] := If[memory[startPos]==0,startPos,strlen[startPos+1]])
than when I use iteration:
0749*+3*>749*+3*<<0:1+1-3?11g01-3?11g01-239*+?749*+3*<1+749*+3*> 0219*+6*-g
Posted: Thu Feb 13, 2014 1:12 am
by Tabun
00<6?1+0^2cp
Note: I think it's awesome to read all the different ways people do this -- I think it's an amazing thing that such a short program in such a terse language can create this beautiful diversity. :]
my version
Posted: Tue Jul 05, 2016 11:42 am
by zhg
this is my version. no stack is used
00^<0^9?d1+097+-gdp
Re: my version
Posted: Tue Jul 05, 2016 6:02 pm
by Hippo
zhg wrote:this is my version. no stack is used
00^<0^9?d1+097+-gdp
Why second 0^ when in both branches you drop it?
Posted: Fri Dec 02, 2016 9:13 pm
by adark
Remarkably simple. I love it!
Posted: Fri Oct 12, 2018 4:23 pm
by jaycim
Never really mucked around with this machine code type stuff before, so I'm not sure if this is any good, but I got:
Posted: Sat Oct 13, 2018 7:52 am
by Hippo
jaycim wrote:Never really mucked around with this machine code type stuff before, so I'm not sure if this is any good, but I got:
Yes, it looks OK and rather compact, good job.
Hmm, may be I have written too early ... it is not that much compact
When I am thinking about it now ... I immediately come with code shown by m!nus's ...