How to make game in notepad

 

Method 1 
Creating A Guessing Game with a Batch File

  1. 1
    Open Notepad. Notepad has an icon that resembles a blue Notepad. Use the following steps to open Notepad in Windows.
    • Click the Windows Start menu.
    • Type "notepad".
    • Click Notepad.
  2. 2
    Copy the following script. This is a batch script that can be used to create a guessing game. Highlight the entire script below. Then right-click it and click Copy. The script is as follows:[1]
     @echo off
    color 0b
    title Guessing Game by seJma
    set /a guessnum=0
    set /a answer=%RANDOM%
    set variable1=surf33
    echo ----------------------------------------------------------------
    echo This Is a Guessing Game Made in Notepad!!!
    echo.
    echo What Number Am I Thinking Of?
    echo ----------------------------------------------------------------
    echo.
    :top
    echo.
    set /p guess=
    echo.
    if %guess% GTR %answer% ECHO Lower!
    if %guess% LSS %answer% ECHO Higher!
    if %guess%==%answer% GOTO EQUAL
    set /a guessnum=%guessnum% +1
    if %guess%==%variable1% ECHO Found the backdoor hey?, the answer is: %answer%
    goto top
    :equal
    echo Congratulations, You guessed right!!!
    echo.
    echo It took you %guessnum% guesses.
    echo.
    pause
    
  3. 3
    Paste the script into Notepad. Click back over to your black Notepad document. Right-click the text cursor at the top and click Paste. This will paste the script into your Notepad document.
  4. 4
    Save the Notepad document as a batch file. By saving it as a batch file, you can run it in Windows as though it were an executable (.exe) file. You don't need to install a scripting language or compile the source code. Windows already has everything you need. Use the following steps to save the document as a batch file:
    • Click File in the menu bar at the top.
    • Click Save as.
    • Click the drop-down menu next to "Save as type".
    • Select All files (*.*).
    • Type a name for the file next to "File name" (i.e. Guessing Game).
    • Add ".bat" to the end of the file name (.i.e. Guessing Game.bat).
    • Click Save.
  5. 5
    Double-click the Batch file. Navigate to where you saved the batch file using File Explorer. Then double-click the batch file to launch it. This will launch the guessing game in the Windows Command Prompt. Type a number and press Enter to guess. The program will tell you to guess higher or lower. When you guess right, it will tell you how many guesses it took.
    • If you want to edit the batch file script, right-click the batch file and click Edit.
    • Try editing the batch file script. See if you can figure out how to change the text, or maybe even change the color of the text.

Comments

Popular posts from this blog

How to crate calculator in your notepad