Bill Allombert on Sat, 20 Nov 2021 22:39:55 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: GP movie


On Sat, Nov 20, 2021 at 10:06:00PM +0100, Denis Simon wrote:
> Thank you Bill for this movie !
> 
> Can you explain the command
> print("\e[H\e[2J")

This is an ANSI escape sequence that clear the screen, see
<https://en.wikipedia.org/wiki/ANSI_escape_code#Control_characters>
\e[ -> CSI H -> move cursor to top
\e[ -> CSI 2 J -> clear screen 

For Windows user: you can try to replace
install(usleep,vU);
by
usleep(n)=for(i=1,15*n,);
and set your terminal to ANSI mode.

another one:
usleep(n)=for(i=1,15*n,);
for(i=1,1000,plot(h=0,i,abs(zeta(1/2+I*h)));print(i);usleep(40000);print("\e[H\e[2J"))

Cheers,
Bill