Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

.bat game


  • This topic is locked This topic is locked

#1
Mr. cake

Mr. cake

    Banned

  • Banned
  • PipPipPip
  • 179 posts
Does anyone have any .bat games they have made that they would like to share?


An example:

@echo off
color f0
cls
@echo off
setlocal
title Guessing Game Small Version 
:startggs
cls
set /A MyNumber="(%Random% %%1000) + 1"
set /A NumGuess=0
echo You have to guess a number in the range 1 to 1000
echo I will for each guess tell you if the number is to small
echo or to large				   
echo.
:Nextggs
set /P Guess="Enter a number> "
set /A NumGuess+=1
if %Guess% EQU %MyNumber% goto :Winggs
if %Guess% LSS %MyNumber% echo Your number is to small
if %Guess% EQU 815 goto :winggs
if %Guess% GTR %MyNumber% echo Your number is to large
if /I %guess%==back goto :1
if %guess%==back goto :1
goto :Nextggs

:Winggs
echo Congratulations you guessed the numer in %NumGuess% tries
set /P Answer="Do you want to try again [y/n]> "
if [%Answer%]==[y] goto :startggs
if {%Answer%}=={n} goto :1

  • 0

Advertisements


#2
OpenOutcome

OpenOutcome

    Member

  • Member
  • PipPipPip
  • 640 posts
Yes, but too large to post here, lol. Mostly lame adventure stories.. haha.

By the way, I guessed the number in one try... 815 hahaha..

Oops for you! :)

Edited by OpenOutcome, 05 June 2009 - 11:38 AM.

  • 0

#3
Mr. cake

Mr. cake

    Banned

  • Topic Starter
  • Banned
  • PipPipPip
  • 179 posts
It goes to different numbers. :)
  • 0

#4
OpenOutcome

OpenOutcome

    Member

  • Member
  • PipPipPip
  • 640 posts
Only if you DON'T choose 815 as your first try. If you choose anything else, it's random. Why is that?
  • 0

#5
tyler kick you fase

tyler kick you fase

    Banned

  • Banned
  • PipPipPip
  • 220 posts
It is not his It's Carbon Dudeoxide's from another forum.

Edited by tyler kick you fase, 05 June 2009 - 12:21 PM.

  • 0

#6
sari

sari

    GeekU Admin

  • Community Leader
  • 21,806 posts
  • MVP
This has the potential to be extremely dangerous, as someone could easily choose to post something malicious. Topic closed.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP