2048: Difference between revisions

m
→‎{{header|Perl 6}}: Update for latest Rakudo
(→‎{{header|Elixir}}: escapes from the warning)
m (→‎{{header|Perl 6}}: Update for latest Rakudo)
Line 2,521:
=={{header|Perl 6}}==
Uses termios to set the terminal options, so only compatible with POSIX terminals. This version does not include a specific "win" or "lose" condition. (though it would be trivial to add them.) You can continue to play this even after getting a 2048 tile; and if there is no valid move you can make, you can't do anything but quit.
{{works with|Rakudo|2015-10-102017.03}}
<lang perl6>use Term::termios;
 
Line 2,608:
 
multi sub move('right') {
map { @board[$_;*] = reverse squash reverse @board[$_;*] }, ^n;
}
 
10,333

edits