Page 1 of 1

Some holiday animations (from Vt100.net)

Posted: 01 Nov 2020 05:40
by miskox
Here https://www.vt100.net/dec/animation/ you can see some .txt files that you can
type *.txt
and see some animation. Some might work some will not display correctly (they are for original DEC Video Terminals).

All .txt files are included in the .zip.
xmas.zip
(18.53 KiB) Downloaded 472 times
Saso

Re: Some holiday animations (from Vt100.net)

Posted: 01 Nov 2020 08:22
by aGerman
The Windows Terminal is able to handle those escape sequences pretty well
https://aka.ms/terminal
But I'm afraid my machine is way too fast and I can't see any animation.

Steffen

Re: Some holiday animations (from Vt100.net)

Posted: 01 Nov 2020 20:04
by penpen
I suspect some vt100 sequences are (actually) not supported by the console, but this fast hack might help:

Code: Select all

@echo off
setlocal enableExtensions enableDelayedExpansion

set "xmas2.speed=800"
for %%a in (*.txt) do (
	cls
	call :play "%%~a" !%%~na.speed!
	pause
)
goto :eof
call :play file [skip] [speed]


:play
setlocal
set "file=%~1"
set /a "delay=1000-%~2+0"
for /f "tokens=1* delims=:" %%a in ('findstr /n "^" "%file%"') do (
	for /l %%w in (1, 1, %delay%) do rem:
	echo(%%b
)
endlocal
goto :eof
penpen

Re: Some holiday animations (from Vt100.net)

Posted: 02 Nov 2020 02:32
by miskox
@penpen: thanks. This works very well. Though I see some 'undefined' characters on my Win10.

Yes, original DEC Video Terminals were not that fast.

Saso

Re: Some holiday animations (from Vt100.net)

Posted: 02 Nov 2020 03:04
by jfl
Cute, thanks for sharing :-)

Re: Some holiday animations (from Vt100.net)

Posted: 03 Nov 2020 22:33
by IcarusLives
I have a question for @penpen!

Why add 0 to this? :)

Code: Select all

set /a "delay=1000-%~2+0"
I was inspecting your code, but I am curious if I am missing something here?

Re: Some holiday animations (from Vt100.net)

Posted: 03 Nov 2020 22:54
by ShadowThief
IcarusLives wrote:
03 Nov 2020 22:33
I have a question for @penpen!

Why add 0 to this? :)

Code: Select all

set /a "delay=1000-%~2+0"
I was inspecting your code, but I am curious if I am missing something here?
I'm guessing it's to prevent syntax errors if %2 isn't provided