728x90 AdSpace

Latest News
Wednesday, May 22, 2013

Batch script code to create game


@ECHO OFF
title Guess the Number!
color 0b
SET /a GuessLimit=6
:start
cls
ECHO Guess what Number I'm thinking of. (0-10)
SET /a GuessNum=0
:begin
SET /a Answer=%RANDOM%
if %Answer% gtr 10 goto begin
:Retry
SET /p Guess=
SET /a GuessNum=%GuessNum%+1
IF %Guess%==cheat goto END
IF %Guess% LSS %Answer% ECHO My Number is Higher.
IF %Guess% GTR %Answer% ECHO My Number is Lower.
IF %Guess%==%Answer% GOTO END
IF %GuessNum% GTR %GuessLimit% (start http://thiruvikramangovindarajan.blogspot.com/)
ECHO
GOTO Retry
:END
cls
ECHO You are Correct!
echo The Answer was %Answer%
ECHO It took %GuessNum% Guesses.
ECHO.
echo Press any key to play again. :) pause>nul
goto start
Newer Post
Previous
This is the last post.
  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment

Item Reviewed: Batch script code to create game Rating: 5 Reviewed By: Thiruvikraman Govindarajan