Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: The 15 Puzzle

by jwkrahn (Abbot)
on Jun 10, 2020 at 20:30 UTC ( [id://11117920]=note: print w/replies, xml ) Need Help??


in reply to The 15 Puzzle

print for( '', 'Welcome to the 15 puzzle!', '', 'Use an arrow key to move a block into the empty position.', "You're trying to reach the position:", ' 01 02 03', '04 05 06 07', '08 09 10 11', '12 13 14 15', '', '^C to kill.', '' );

That would probably be better as a here doc (a single string) than a list of strings:

print <<TEXT; Welcome to the 15 puzzle! Use an arrow key to move a block into the empty position. You're trying to reach the position: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 ^C to kill. TEXT

Replies are listed 'Best First'.
Re^2: The 15 Puzzle
by msh210 (Monk) on Jun 10, 2020 at 20:54 UTC

    Thank you!

    $_="msh210";$"=$\;@_=@{[split//,uc]}[2,0];$_="@_$\1";$\=$/;++$_[0]for$...1;print lc substr crypt($_,"@_"),1,6

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found