|
Answer» im trying to make a batch video game for a school project, I was wonder
I'm trying to figure out if it is possible to rename two variables on the same line individually at separate times when called from a goto command from two different spinners. each health ("-------") Is an individual variable that is renamed.
I have a 2 health bars that appear as this.
╔══════╗ | ╔══════╗ health ║ ------- ║ | health ║ ------- ║ ╚══════╝ | ╚══════╝
the middle will slowly decrease each time its set through a spinner. for example...
"-------" will become "------", then "-----", then "----", "---", and so on...
the problem that i am having is that each health bat has its own spinner and i cant figure out how to decrease the health bar by one "-" at a time when each health status ("-------") has its own variable and is set on the same line attached to that spinner. another example...
I can make
╔══════╗ | ╔══════╗ health ║ ------- ║ | health ║ ------- ║ ╚══════╝ | ╚══════╝
do this
╔══════╗ | ╔══════╗ health ║ ------- ║ | health ║ ---- ║ ╚══════╝ | ╚══════╝
but when each spinner is set off and i want to do this.
1 2 ╔══════╗ | ╔══════╗ health ║ --- ║ | health ║ --- ║ ╚══════╝ | ╚══════╝
the health bar 1 cant save the health when i want the other to decrease by another "-".
I set the whole box on one line using this trick
set nl=^& echo. echo line1%nl%line2%nl%line3%nl% so on~
the code below line vvvvvvvvvvvvvvvvv
(THE LONG LINE OF CODE WAS TO MUCH TO FIT ON THE BOX BUT THOSE ARE THE HEALTH BARS, IT BUMBED IT SELF ON A NEW LINE BECAUSE IT NEEDS MORE ROOM TO FIT IN THIS BOX, PASTE IT INTO NOTEPAD AND HIT BACKSPACE TO PUT IT BACK ON THE SAME LINE)... the line looks something like this (" echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º ")
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@echo on :START title Julius Caesar project [JacobgGilbert] COLOR 17 set nl=^& echo. set resultA=------- set resultH=------- if exist C:\JS\ goto packageskip start extractmedia.exe echo Prepairing files timeout /t 35 :packageskip echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» echo º Julius Caesar by Jacob Gilbertº echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ echo/ echo Picking player at random to go on the first turn. SET /A ht=%random% %% 6 pause
if %ht%==1 goto player1 if %ht%==2 goto player1 if %ht%==3 goto player1 if %ht%==4 goto player2 if %ht%==5 goto player2 if %ht%==6 goto player2
pause
:player1 cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultA%º ^| Health º%resultH%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo (Caesar) plays first... echo. :commandsp1 echo Commands:%nl%1 - attack %nl%2 - block%nl%3 - sharpen sword set /p command1= "~Command:" pause if %command1%==1 goto attackp1 if %command1%==2 goto blockp2 if %command1%==3 goto sharpen_swordp3
:attackp1 SET /A missrange=%random% %% 10 if %missrange%==1 goto miss1 if %missrange%==2 goto worked1 if %missrange%==3 goto miss1 if %missrange%==4 goto worked1 if %missrange%==5 goto miss1 if %missrange%==6 goto worked1 if %missrange%==7 goto miss1 if %missrange%==8 goto worked1 if %missrange%==9 goto miss1 if %missrange%==10 goto worked1
:miss1 echo Sorry your attack missed. pause cls goto jumpp2 :worked1 echo Recieved Damage! pause cls
::================================================================ :spinner1 SETLOCAL ENABLEDELAYEDEXPANSION SET COUNTP1=1
:BEGINCOUNTP1 CLS SET /A COUNTP1+=1 IF !COUNTP1! EQU 1 goto count1p1 IF !COUNTP1! EQU 2 goto count2p1 IF !COUNTP1! EQU 3 goto count3p1 IF !COUNTP1! EQU 4 goto count4p1 IF !COUNTP1! EQU 5 goto count5p1 IF !COUNTP1! EQU 6 goto count6p1 IF !COUNTP1! EQU 7 goto count7p1 IF !COUNTP1! EQU 7 ( SET COUNTP1=1 ) ELSE ( ) GOTO BEGINCOUNTP1
:count1p1 set resultA=------- set resultI=------ set modified=%resultI:resultH=------ echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultA%º ^| Health º%resultH%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1
:count2p1 set result1=------ set modified=%result1:resultH=------ echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultB%º ^| Health º%resultI%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1 pause
:count3p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultC%º ^| Health º%resultJ%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1 pause
:count4p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultD%º ^| Health º%resultK%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1 pause
:count5p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultE%º ^| Health º%resultL%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1 pause
:count6p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultF%º ^| Health º%resultM%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% goto commandsp1 pause
:count7p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º WIN! º ^| Health º LOSE! º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo CAESAR IS THE WINNER!!!! pause goto start ::================================================================
:player2 cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º-------º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo (Brutus) plays first... echo. :commandsp2 echo Commands:%nl%1 - attack %nl%2 - block%nl%3 - sharpen sword set /p command= "~Command:" pause if %command%==1 goto attackp4 if %command%==2 goto blockp5 if %command%==3 goto sharpen_swordp6
:attackp4 SET /A missrange=%random% %% 10 if %missrange%==1 goto miss2 if %missrange%==2 goto worked2 if %missrange%==3 goto miss2 if %missrange%==4 goto worked2 if %missrange%==5 goto miss2 if %missrange%==6 goto worked2 if %missrange%==7 goto miss2 if %missrange%==8 goto worked2 if %missrange%==9 goto miss2 if %missrange%==10 goto worked2
:miss2 echo Sorry your attack missed. pause cls goto returnp2 :worked2 echo Recieved Damage! pause cls
::================================================================ :spinner1 SETLOCAL ENABLEDELAYEDEXPANSION SET COUNTP2=1
:BEGINCOUNTP2 CLS IF !COUNTP2! EQU 1 goto count1p2 IF !COUNTP2! EQU 2 goto count2p2 IF !COUNTP2! EQU 3 goto count3p2 IF !COUNTP2! EQU 4 goto count4p2 IF !COUNTP2! EQU 5 goto count5p2 IF !COUNTP2! EQU 6 goto count6p2 IF !COUNTP2! EQU 7 goto count7p2 IF !COUNTP2! EQU 7 ( SET COUN2=1 ) ELSE ( SET /A COUNT2+=1 ) GOTO BEGINCOUNTP2
:count1p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health ºresultAº ^| Health ºresultDº º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl%
pause
:count2p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º----- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 2 pause
:count3p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º---- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% pause
:count4p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º--- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% pause
:count5p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º-- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% pause
:count6p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% pause
:count7p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º WIN! º ^| Health º LOSE! º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% pause ::================================================================
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you guys for the help i added in Echo's with character so that you know where the spinner lands you because i am also finding that the spinner keeps mistaking that location :count1p1 is :count1p2 when i set SET /A COUNT2+=1 under )ELSE( inside the spinners. could anyone just help me with the whole solution, im not EVEN close to being done but i've worked forever trying to figure this out. Im only 17 so and this is due next monday so i need help asap... thank you the bottom spinner hasnt been tested but ive realized that if i wanted to change one bar's health it would be difficult without affecting the other when i call back from the spinnerthe block and sharpen sword options hasn't been added yet, if anyone one would like to help on that too i would be very thankful for everything dang i just realized that i uploaded the code where i had to fix my errors.... wow that just dumb of me, here this one should help more
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@echo off :start title Julius Caesar project [JacobgGilbert] color 17 set nl=^& echo. set resultA=-------% set resultH=-------% if exist C:\JS\ goto packageskip start extractmedia.exe echo Prepairing files timeout /t 35 :packageskip echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» echo º Julius Caesar by Jacob Gilbertº echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ echo/ echo Picking player at random to go on the first turn. SET /A ht=%random% %% 6 pause
if %ht%==1 goto player1 if %ht%==2 goto player1 if %ht%==3 goto player1 if %ht%==4 goto player2 if %ht%==5 goto player2 if %ht%==6 goto player2
pause
:player1 cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º-------º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo (Caesar) plays first... echo. :commandsp1 echo Commands:%nl%1 - attack %nl%2 - block%nl%3 - sharpen sword set /p command1= "~Command:"
if %command1%==1 goto attackp1 if %command1%==2 goto blockp2 if %command1%==3 goto sharpen_swordp3
:attackp1 SET /A missrange=%random% %% 10 if %missrange%==1 goto miss1 if %missrange%==2 goto worked1 if %missrange%==3 goto miss1 if %missrange%==4 goto worked1 if %missrange%==5 goto miss1 if %missrange%==6 goto worked1 if %missrange%==7 goto miss1 if %missrange%==8 goto worked1 if %missrange%==9 goto miss1 if %missrange%==10 goto worked1
:miss1 echo Sorry your attack missed. pause cls goto jumpp2 :worked1 echo Recieved Damage! pause goto spinner1
::================================================================ :spinner1 SETLOCAL ENABLEDELAYEDEXPANSION SET COUNTP1=1
:BEGINCOUNTP1 CLS IF !COUNTP1! EQU 1 goto count1p1 IF !COUNTP1! EQU 2 goto count2p1 IF !COUNTP1! EQU 3 goto count3p1 IF !COUNTP1! EQU 4 goto count4p1 IF !COUNTP1! EQU 5 goto count5p1 IF !COUNTP1! EQU 6 goto count6p1 IF !COUNTP1! EQU 7 goto count7p1
SET COUNTP1=1 ) ELSE ( SET /A COUNTP1+=1 )
:count1p1 cls set resultH=------ set modified2=%resultH:resultI=------% echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultA%º ^| Health º%resultH% º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 1 (Brutus's) turn.... goto commandsp1
:count2p1 set result1=------ set modified2=%result1:resultH=------% echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultB%º ^| Health º%resultI%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 2 goto commandsp1
0:count3p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultC%º ^| Health º%resultJ%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 3 goto commandsp1
:count4p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultD%º ^| Health º%resultK%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 4 goto commandsp1
:count5p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultE%º ^| Health º%resultL%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 5 goto commandsp1
:count6p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultF%º ^| Health º%resultM%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo 6 goto commandsp1
:count7p1 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º WIN! º ^| Health º LOSE! º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo CAESAR IS THE WINNER!!!! echo 7 goto start ::================================================================
:player2 cls echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º-------º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo (Brutus) plays first... echo. :commandsp2 echo Commands:%nl%1 - attack %nl%2 - block%nl%3 - sharpen sword set /p command= "~Command:" pause if %command%==1 goto attackp4 if %command%==2 goto blockp5 if %command%==3 goto sharpen_swordp6
:attackp4 SET /A missrange=%random% %% 10 if %missrange%==1 goto miss2 if %missrange%==2 goto worked2 if %missrange%==3 goto miss2 if %missrange%==4 goto worked2 if %missrange%==5 goto miss2 if %missrange%==6 goto worked2 if %missrange%==7 goto miss2 if %missrange%==8 goto worked2 if %missrange%==9 goto miss2 if %missrange%==10 goto worked2
:miss2 echo Sorry your attack missed. pause cls goto returnp2 :worked2 echo Recieved Damage! pause cls
::================================================================ :spinner2 SETLOCAL ENABLEDELAYEDEXPANSION SET COUNTP2=1
:BEGINCOUNTP2 CLS IF !COUNTP2! EQU 1 goto count1p2 IF !COUNTP2! EQU 2 goto count2p2 IF !COUNTP2! EQU 3 goto count3p2 IF !COUNTP2! EQU 4 goto count4p2 IF !COUNTP2! EQU 5 goto count5p2 IF !COUNTP2! EQU 6 goto count6p2 IF !COUNTP2! EQU 7 goto count7p2 IF !COUNTP2! EQU 7 ( SET COUNTP2=1 ) ELSE ( SET /A COUNTP2+=1 ) GOTO BEGINCOUNTP2
:count1p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º%resultA%º ^| Health º%resultH%º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo a pause
:count2p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º----- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo b pause
:count3p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º---- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo c pause
:count4p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º--- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo d pause
:count5p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º-- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo e pause
:count6p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º-------º ^| Health º- º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo f pause
:count7p2 echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»%nl%º º%nl%º Player (Caesar) ^| Player (Brutus) º%nl%º ^| º%nl%º ÉÍÍÍÍÍÍÍ» ^| ÉÍÍÍÍÍÍÍ» º%nl%º Health º WIN! º ^| Health º LOSE! º º%nl%º ÈÍÍÍÍÍÍͼ ^| ÈÍÍÍÍÍÍͼ º%nl%º º%nl%ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ%nl% echo BRUTUS IS THE WINNER! pause ::================================================================
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
im really sorry for that.... Your homework is not an appropriate QUESTION - it's for you to do, but here's a hint of one way it can be done.
Code: [Select]@echo off set "var=|------|" echo "%var%" set "var=%var:~0,-2% |" echo "%var%" pause thanks, sorry i only ask because i'm self taught and I don't quite understand sometimes how code works. i like knowing exactly what the code does so would you mind explaining? i can see it works but i want to faullt understand my answer
|