CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
for /l %%i in (1000,1,9999) do (
set a=%%i
::AABB
if "!a:~0,1!"=="!a:~1,1!" (
if not "!a:~0,1!"=="!a:~2,1!" (
if "!a:~2,1!"=="!a:~3,1!" (
echo !a!
if "!a:~2,1!"=="0" echo !a:~2,2!!a:~0,2!
)
)
)
::ABAB
if "!a:~0,1!"=="!a:~2,1!" (
if not "!a:~0,1!"=="!a:~1,1!" (
if "!a:~1,1!"=="!a:~3,1!" (
echo !a!
if "!a:~1,1!"=="0" echo !a:~3,1!!a:~2,1!!a:~1,1!!a:~0,1!
)
)
)
::ABBA
if "!a:~0,1!"=="!a:~3,1!" (
if not "!a:~0,1!"=="!a:~1,1!" (
if "!a:~1,1!"=="!a:~2,1!" (
echo !a!
if "!a:~1,1!"=="0" echo !a:~1,1!!a:~0,1!!a:~3,1!!a:~2,1!
)
)
)
)
echo OK.
pause>nul
CODE: [Copy to clipboard]
@echo off&setlocal enabledelayedexpansion
set "code=abcdefghijklmnopqrstuvwxyz0123456789"
(for /l %%a in (35,-1,1) do (
set "str=!code:~,1!"&set "code=!code:~1!"&set "codes=!code!"
for /l %%b in (%%a,-1,1) do (
set "var=!codes:~,1!"&set "codes=!codes:~1!"
echo !str!!str!!var!!var!
echo !str!!var!!str!!var!
echo !str!!var!!var!!str!
echo !var!!var!!str!!str!
echo !var!!str!!var!!str!
echo !var!!str!!str!!var!
)
))>list.txt
start list.txt
[CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
call :func "" "12AB"
pause
exit
:func
setlocal
set str=%~2
if "%str:~2%"=="" (
call :echo %~1
goto :eof
)
set /a n=-1
:next
set /a n+=1,nb=n+1
call :func "%~1 !str:~%n%,1!" "!str:~0,%n%!!str:~%nb%!"
if not "!str:~%n%,-1!"=="" (goto :next)
endlocal
goto :eof
:echo
echo %1%1%2%2
echo %1%2%1%2
echo %1%2%2%1
goto :eof
CODE: [Copy to clipboard]
@echo off
setlocal enabledelayedexpansion
set long=9876543210
call :func "" "123456789"
pause
exit
:func
setlocal
set str=%~2
if "%str:~6%"=="" (
call :echo %~1
goto :eof
)
set /a n=-1
:next
set /a n+=1,nb=n+1
call :func "%~1 !str:~%n%,1!" "!str:~0,%n%!!str:~%nb%!"
if not "!str:~%n%,-1!"=="" (goto :next)
endlocal
goto :eof
:echo
echo %1%1%2%2
echo %1%2%1%2
echo %1%2%2%1
goto :eof