Comments on: Playing on the CodeGolf Range http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/ ruby, java and the rest Fri, 21 Nov 2008 04:49:41 +0000 http://wordpress.org/?v=2.5.1 By: Frank Spychalski http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4443 Frank Spychalski Tue, 08 Aug 2006 15:18:32 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4443 Finally a working version from Daniel :-) Thanks again Finally a working version from Daniel :-) Thanks again

]]>
By: Frank Spychalski http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4436 Frank Spychalski Tue, 08 Aug 2006 10:46:16 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4436 I edited your original comment, but it doesn't work on my machine. Could you mail me your code (to fs at this domain)? I edited your original comment, but it doesn’t work on my machine. Could you mail me your code (to fs at this domain)?

]]>
By: Daniel Martin http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4434 Daniel Martin Tue, 08 Aug 2006 10:05:05 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4434 Note that some of my code seems to have been eaten by the submission process - part of that hash literal should read: {?<,"$a-=1",?>,"$a+=1",?+,"x 1", Note that some of my code seems to have been eaten by the submission process - part of that hash literal should read:

{?<,”$a-=1″,?>,”$a+=1″,?+,”x 1″,

]]>
By: Frank Spychalski http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4432 Frank Spychalski Tue, 08 Aug 2006 08:34:02 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4432 Thanks for the comments. It's embarrassing that I have missed Carl's #3. Daniel thanks for the code - I didn't think of unpack.map.join to create my program, nice idea... Right now I'm at work but I can't wait to get home :-) Thanks for the comments. It’s embarrassing that I have missed Carl’s #3. Daniel thanks for the code - I didn’t think of unpack.map.join to create my program, nice idea… Right now I’m at work but I can’t wait to get home :-)

]]>
By: Daniel Martin http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4420 Daniel Martin Tue, 08 Aug 2006 02:58:26 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4420 # 243 bytes, once extraneous newlines are removed (in the big hash literal, commas don't need to be followed by newlines) <pre>def x i=0;$d[$a]=(($d[$a]||0)+i)%256;end $d=[] $a=0 $c,$k=STDIN.read.split'!' eval $c.unpack("C*").map{|i|{?<,"$a-=1",?>,"$a+=1",?+,"x 1", ?-,"x -1",?[,"while x>0 do",?],"end",?.,"print x.chr", ?,,"$d[$a]=$k.slice!(0) or exit"}[i]||''}.join(" ")</pre> As a plus, I think it's faster too. <i>edited the code to work around wordpress</i> # 243 bytes, once extraneous newlines are removed (in the big hash literal, commas don’t need to be followed by newlines)

def x i=0;$d[$a]=(($d[$a]||0)+i)%256;end
$d=[]
$a=0
$c,$k=STDIN.read.split'!'
eval $c.unpack("C*").map{|i|{?<,"$a-=1",?>,"$a+=1",?+,"x 1",
?-,"x -1",?[,"while x>0 do",?],"end",?.,"print x.chr",
?,,"$d[$a]=$k.slice!(0) or exit"}[i]||''}.join("
")

As a plus, I think it’s faster too.

edited the code to work around wordpress

]]>
By: carldr http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4409 carldr Mon, 07 Aug 2006 22:29:16 +0000 http://amazing-development.com/archives/2006/08/07/playing-on-the-codegolf-range/#comment-4409 Hi, Thanks for the blog post, it was really interesting to read the process you've gone through to get the solution you have! There are a few clues I'll give you : 1) You're on the right track with your last submission. 2) I know no special knowledge of the Brainfuck language. 3) You don't need any function calls. I'm sure there are more I can give you, but that would ruin the surprise of finding them! If you're on IRC, drop by #codegolf on irc.freenode.net - I'm usually round during the day UK time. Or, if you're not, there will be forums on the Codegolf site within the week. Either way, I'll try and give you some more hints without ruining the fun. Glad you're enjoying the site. Regards, Carl. Hi,

Thanks for the blog post, it was really interesting to read the process you’ve gone through to get the solution you have! There are a few clues I’ll give you :

1) You’re on the right track with your last submission.
2) I know no special knowledge of the Brainfuck language.
3) You don’t need any function calls.

I’m sure there are more I can give you, but that would ruin the surprise of finding them! If you’re on IRC, drop by #codegolf on irc.freenode.net - I’m usually round during the day UK time. Or, if you’re not, there will be forums on the Codegolf site within the week. Either way, I’ll try and give you some more hints without ruining the fun. Glad you’re enjoying the site.

Regards,
Carl.

]]>