function inc() { i = (c++%40) # inc c after printf "%s", (i==x||i==x+1||i==x+2) ? "█" : " " if (i == 39) { print "" } } { inc() } $1 == "addx" { inc() x+=$2 }