Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Challenge: Ricochet Robots

by choroba (Cardinal)
on Feb 19, 2021 at 13:40 UTC ( [id://11128556]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Challenge: Ricochet Robots
in thread Challenge: Ricochet Robots

> Want a harder challenge?

Rather not. This was still manageable, but a harder one would be less fun. I have enough of them at work.

> did you have fun?

Yes, especially when I finished it! ;-)

> you need 2GB RAM

The original version that didn't produce the moves was less memory hungry. But the initial solution that stored the configuration as a string ate all my machine's memory and wasn't able to finish, so I had to introduce pack to make it more compact. I'd be interested in seeing an alternative solution.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Challenge: Ricochet Robots
by LanX (Saint) on Feb 19, 2021 at 14:15 UTC
    > > did you have fun?

    > Yes, especially when I finished it! ;-)

    Oh, at 3 am? Did it wake up your wife? ;-)

    > I have enough of them at work.

    Yeah me too.

    > I'd be interested in seeing an alternative solution.

    Don't wanna spoil the fun here. :)

    FWIW found a presentation in the internet from 2012 using most of the same principles though.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

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

    No recent polls found