? is this possible also it should save the difficultly you choose in the highscore and it should save the total time you spent playing also you should get 3 lives maybe different lives with different difficultly and also the different difficulty should have a multiplier to the score I want to add some sort of scoring system with possible bonuses for the time completed in or the amount of guess it took or to how many you got right before you ran out of lives time or tries and have the time update in the title of the prompt also with tries I believe this would be easier than have it keep clearing the screen Is this possible before you attempt to make this please reply what is possible out of this and if you can make it then go ahead and attempt it I know I'm asking alot but these would be great improvements thanks to anyone that can do any of these things I ask.you should be able to choose difficulty's easy 20 try resets when you get it right medium 10 trys resets when you get it right and hard you only get 10 but when you get it right it doesn't reset it just gives you plus 5 trys
EDIT
Code: Select all
start cmdbkg 123.bmp 10 includeBorders
We could also use the tool cmdbkg to change the background if you get closer or farther from the number
http://www.dostips.com/forum/viewtopic.php?f=3&t=7407
BUGS
- =======================
- The title is messed up and keeps adding letters like h Im assuming is for higher and l Im assuming for lower until it says not enough storage to process command
- The goto commands were not working had to fix them up
============================
=======================
FIXED A FEW BUGS
=======================
Code: Select all
@echo off
color 0F
cls
echo Type your name to save your highscore.
set /p "name= "
CLS
Set "title1=Guessing Game Edited By AlternateAlt (and some other people)"
title %title1%
Set "LoadColor=7"
Set "LoadLimit=27"
Set "LoadColors=0123456789ABCDEF"
set "variable1=surf33"
for /f %%a in ('show 30') do set "up=%%a"
for /f %%a in ('show 31') do set "down=%%a"
:StartNewGame
Set "LoadCtr=0"
set "guessnum=0"
:PickAnswer
echo ///Loading///
echo ///Loading///
echo ///Loading///
echo ///Loading///
SetLocal EnableDelayedExpansion
set /A "RandomColor=%random%*16/32768"
Set "LoadColor=!LoadColors:~%RandomColor%,1!"
color 0%LoadColor%
EndLocal
ping -w 10 -n 2 -1 3 127.0.0.1>NUL
Set /A "LoadCtr+=1"
CLS
set /a answer=%RANDOM%
if %answer% gtr 100 (
if "%LoadCtr%" EQU "%LoadLimit%" (set /A "answer=(%random%*100)/32768+1" & goto :ChoseAnswer)
goto PickAnswer
)
:ChoseAnswer
:: Reduce countdown with experience and add progress status to title
Set /A "LoadLimit=1+LoadLimit/3"
color 07
::I want to add these
set /a extremely_close_low=%anwser%-2
set /a extremely_close_high=%anwser%+2
::I want to add these
set /a super_close_high=%answer%+3
set /a super_close_low=%answer%-3
::I want to add these
set /a pretty_close_low=%anwser%-15
set /a pretty_close_high=%anwser%+15
::I want to add these
set /a kinda_close_high=%answer%+20
set /a kinda_close_low=%answer%-20
set /a not_that_close_high=%answer%+35
set /a not_that_close_low=%answer%-35
set /a not_even_close_high=%answer%+40
set /a not_even_close_low=%answer%-40
:top_Welcome
Set "title2=----+----1----+----2----+----3----+----4----+----5"
Set "title2=%title2%----+----6----+----7----+----8----+----9----+----"
title %title1% %title3%
echo "---------------------------------"
colorshow /0B 32 " Welcome," /0F " %name%" /0B ", to the Guessing Game!" 13 10
colorshow 196*49 13 10
colorshow /0B 32 " Try and Guess my Number!: from 1 to 100 ." 13 10
echo "---------------------------------"
ColorBox /0f 0 0 48 4
colorshow /0F 16 32
:top_Guess
set /p "guess="
if "%guess%"=="%variable1%" (ECHO Found the backdoor hey? The answer is: %answer% && goto top_Guess)
if %guess% GTR 100 goto error1
if %guess% lss %not_even_close_low% Set ColorHint=07
if %guess% gtr %not_even_close_high% Set ColorHint=07
if %guess% gtr %not_even_close_low% if %guess% lss %not_that_close_high% Set ColorHint=04
if %guess% lss %not_even_close_high% if %guess% gtr %not_that_close_low% Set ColorHint=04
if %guess% gtr %not_that_close_low% if %guess% lss %kinda_close_high% Set ColorHint=0C
if %guess% lss %not_that_close_high% if %guess% gtr %kinda_close_low% Set ColorHint=0C
if %guess% gtr %kinda_close_low% if %guess% lss %super_close_high% Set ColorHint=0A
if %guess% lss %kinda_close_high% if %guess% gtr %super_close_low% Set ColorHint=0A
if %guess% gtr %super_close_low% if %guess% lss %super_close_high% Set ColorHint=02
SetLocal EnableDelayedExpansion
Set /A "ProgPos=%guess%-1
Set "Progress1=!Title2:~0,%ProgPos%!"
Set "Progress2=!Title2:~%guess%!"
if %guess% GTR %answer% (
Set "Hint=Lower"
Colorshow /%ColorHint% "!Hint!" 13 10 /0C "%down%" 32
Set "Title2=%progress1%L%Progress2%"
)
if %guess% LSS %answer% (
Set "Hint=Higher"
Colorshow /%ColorHint% "!Hint!" 13 10 /0B "%up%" 32
Set "Title2=%progress1%H%Progress2%"
)
title Guessing HINTS___+0%title2%100+___%Hint%
if "%guess%"=="%answer%" (
set /a guessnum=%guessnum% +1
set /a right=%right%+1
colorshow /0C 32 03 32 /0E"SUCCESS!" 13 10
Set "Hint=Exact"
Set "title3=[Guesses - !Guessnum!] - [Times Right - !right!]
Set "Title2=%progress1%#%Progress2%"
title Guessing HINTS___+0!title2!100+___!Hint!
goto :hello11
)
(EndLocal & rem.Save values for reruns
Set "right=%right%"
Set "Title2=%Title2%"
Set "Title3=%Title3%"
)
set /a guessnum=%guessnum% +1
goto :top_Guess
if "%guess%"=="%answer%" (
set /a guessnum=%guessnum% +1
set /a right=%right%+1
colorshow /0C 32 03 32 /0E"SUCCESS!" 13 10
Set "Hint=Exact"
Set "title3=[Guesses - !Guessnum!] - [Times Right - !right!]
Set "Title2=%progress1%#%Progress2%"
title Guessing HINTS___+0!title2!100+___!Hint!
goto :hello11
)
(EndLocal & rem.Save values for reruns
Set "right=%right%"
Set "Title2=%Title2%"
Set "Title3=%Title3%"
)
set /a guessnum=%guessnum% +1
goto :top_Guess
:hello11
CLS
color 0C
echo Congratulations, you guessed correctly!!!
echo It took you %guessnum% guesses to find %guess%.
echo You guessed the number correctly this many times: %right%
echo ------------------------------
echo Press 1 To Save Score
echo ------------------------------
echo Press 2 To Keep Playing.
echo ------------------------------
echo Press 3 To Check Highscores.
echo ------------------------------
echo Press 4 To Exit.
echo ------------------------------
CHOICE /C 1234 /N /M [1,2,3,4]?
Set "save=%ErrorLevel%"
if %save%==1 (call :save "%name%" %right% %Guessnum% & Goto :hello11)
if %save%==2 goto :StartNewGame
if %save%==3 (call :open & Goto :hello11)
if %save%==4 (title %title1% & Exit /B)
:save
(
echo ====================
echo Player=%~1
echo Date=%date%
echo Times Many Guessed Correctly=%2
echo Number Of Guesses=%3
echo ====================
) >>highscore.txt
Exit /B
:wrong
echo Unknown Number. Press Any Key To Return.
pause>nul
goto top_guess
:open
notepad highscore.txt
CLS
goto Hello11
:error1
echo Please Pick A Number Between 1 and 100.
goto top_guess
=======================