Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: BF interpreter

by truedfx (Monk)
on Aug 28, 2006 at 07:20 UTC ( [id://569941]=note: print w/replies, xml ) Need Help??


in reply to BF interpreter

Nice. You can make it a little bit shorter by not giving p any arguments, and by using ARGV:

#!/usr/bin/perl $/=\1;%p=('>',sub{$p++},'<',sub{$p--},'+',sub{$p[$p]++},'-',sub{$p[ $p]--},'.',sub{print chr$p[$p]},',',sub{$p[$p]=ord<>},'[',sub{&c}); sub p{exists$p{$_}&&&{$p{$_}}}p while<>;sub c{push@c,<>.!1until$c[@ c-1]eq']';do{p for@c}while$p[$p]}

Replies are listed 'Best First'.
Re^2: BF interpreter
by gustavderdrache (Acolyte) on Aug 30, 2006 at 20:42 UTC

    Wow, awesome.

    Wouldn't have come up with that one.

    "If you go on with this nuclear arms race, all you are going to do is make the rubble bounce" -- Winston Churchill

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://569941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found