@echooff&setlocal enabledelayedexpansion
set "num=12345678 "
set n=9
for /l %%i in (1,1,%n%) do (
set/a r=!random!%%n,m=r+1,n-=1
for /f "tokens=1,2" %%a in ("!r! !m!") do (
set "#%%i=!num:~%%a,1!"
set "num=!num:~,%%a!!num:~%%b!"
))
echo.┏━┳━┳━┓
echo.┃!#1! ┃!
#2! ┃!#
3! ┃
echo.┣━╋━╋━┫
echo.┃!
#4! ┃!#
5! ┃!#6! ┃
echo.┣━╋━╋━┫
echo.┃!#7! ┃!
#8! ┃!#
9! ┃
echo.┗━┻━┻━┛
pause>nul
cls
%0