http://www.perlmonks.org?node_id=508640


in reply to Re: Super Nibbles
in thread Super Nibbles

unlike this:
use Term::ReadKey;ReadMode 3;%v=qw{a -1 s 80 w -80};$f=print"\ec";{$d+ +=$ v{$c=ReadKey(-1)||$c}||1;p($d=$d>1600?$d-1600:$d<0?$d+1600:$d);$d-int$ +f? p(pop@s,$"):p($f=rand 800);9x1e7;map$d-$_||${ReadMode 0;exit},@s;@s=($ +d, @s);redo}sub p{printf"\e\[%d;%dH%s\e[20H",1+$_[0]/80,$_[0]%80,$_[1]||x +}
from here oh yeah: w=up s=down a=left d=right
a
update: added key defs