http://qs321.pair.com?node_id=11117920


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