Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- ::This is all used to take the text from the file and parse it into individual lines
- ::temp.t is used because if the file name has spaces, it will create an error
- ::in the for loop
- set linenum=0
- copy "%~1" "temp.t" /Y >nul
- set file=%~1
- for /f "tokens=*" %%a in (temp.t) do (
- set /a linenum=!linenum!+1
- set line!linenum!=%%a
- )
- del temp.t
- for /l %%b in (1,1,%linenum%) do (
- echo !line%%b!
- )
- set /a linetemp=1
- :calculate
- for /l %%z in (0,1,10000) do (
- if "!line%linetemp%:~%%z,1!"=="" set total!linetemp!=%%z &goto next1
- )
- :next1
- echo !total%linetemp%!
- if "%linetemp%"=="%linenum%" goto next2
- set /a linetemp+=1
- goto calculate
- :next2
- for /l %%e in (%linenum%,-1,1) do (
- set /a tempnum=%%e-1
- for /l %%f in (1,1,!tempnum!) do (
- if not "!total%%e!"=="!total%%f!" goto notrectangle
- )
- )
- pause
- ::Since I know for later scripting it will be easier if each character is set to a variable
- ::All the variables will be set according to a row / column set
- ::mrXcY
- ::The var total is calculated from earlier and is the length of the first line of the maze
- ::The following for loop will set the lines based on the length of the first line calculated
- ::This introduces a slight flaw that if the first line is
- for /l %%c in (1,1,%linenum%) do (
- for /l %%d in (1,1,!total%%c!) do (
- pause > nul
- exit /b
- :notrectangle
- echo Bitch that ain't no rectangular maze.
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement