Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Icarus Challenge 2
- setlocal enabledelayedexpansion
- ::This script is based on assigning a variable to every position in the box
- ::m#1#2 #1 is the vertical assignment and #2 is the horizontal assignment
- for /l %%a in (0,1,10) do (
- for /l %%b in (0,1,20) do (
- set m%%a%%b=
- if "%%a" == "0" set m%%a%%b=#
- if "%%a" == "10" set m%%a%%b=#
- if "%%b" == "0" set m%%a%%b=#
- if "%%b" == "20" set m%%a%%b=#
- )
- )
- set /p input= Please enter the text that you would like to see displayed in the box:
- for /l %%c in (0,1,200) do (
- if "!input:~%%c,1!"=="" set total=%%c &goto next1
- )
- :next1
- if %total% GTR 18 goto multi
- set /a left=18 - %total%
- set /a end1=(%left%)/ 2
- set /a end2=18 - ((%left%) / 2)
- set /a temp=((%left% + 3) / 2 ) - 1
- if %end1% LSS %temp% set /a end1=%end1% + 1
- set text=%input%
- for /l %%h in (0,1,%end1%) do (
- set text= !text!
- )
- set verti1=4
- set verti2=4
- set inputpos=0
- for /l %%d in (0,1,%end2%) do (
- set m%verti1%%%d=!input:~%%d,1!
- )
- :setvars
- for /l %%e in (0,1,%end2%) do (
- set m%verti1%%%e=!text:~%%e,1!
- )
- set m%verti1%0=#
- goto show
- :show
- for /l %%f in (0,1,10) do (
- for /l %%g in (0,1,20) do (
- set line%%f=!line%%f!!m%%f%%g!
- )
- echo !line%%f!
- )
- pause
Advertisement
Add Comment
Please, Sign In to add comment