Langton's ant: Difference between revisions

Content added Content deleted
m (→‎{{header|jq}}: ANSI code)
Line 4,652: Line 4,652:
| ($grid|length) as $height
| ($grid|length) as $height
| ($grid[0]|length) as $width
| ($grid[0]|length) as $width
| reduce range(0;$height) as $i ("\u001BH";
| reduce range(0;$height) as $i ("\u001B[H"; # ANSI code
. + reduce range(0;$width) as $j ("\n";
. + reduce range(0;$width) as $j ("\n";
. + if $grid[$i][$j] then " " else "#" end ) );
. + if $grid[$i][$j] then " " else "#" end ) );