The previous method — clearing the screen and completely redrawing every frame — caused severe screen-flickering. This is better, calculating the changed characters per-frame and printing only those.