Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Even smaller 2048 in Perl !!!
sub Y{$p=$_;for$i(1..4){$p=join'',map{substr+($k&&$k-$i?$p:join'',map{s/@//g;s
16;for(`stty cbreak`;print"\e[2J\e[H";$_=Y map{$k=index+JDACB,getc}0..2){$k=0;
1until$r=0|rand 16,!/@/||s/(?<=^.{$r})@/rand>.1?A:B/e;printf'%4s|%s',/\w/&&1<<
(ord)-64,++$g%4?'':$/for/./g;last if$e=WIN x/K/||Y!~/@/&&LOSE}print$e # [2048]

This comment has been minimized.

Show comment Hide comment

xiaobohaha Jun 27, 2015



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment