Introduction: How to Make a Simple Batch Trivia Game

This is a very simple way to make a trivia game. I hope you like it. By the way i also posted a trivia game already so if you dont want to make your own just go to this website

https://www.instructables.com/id/Trivia_Game/

the website posted above uses these exact pictures and following steps so i'm pretty much telling you how i made it

Step 1: Getting Started...

If you know how to get to notepad go there if you dont then...

first you have to click the "start" button and go to programs, applications, then click on notepad



Step 2: Colors

to begin, type
"@echo off"
then type the color you want your screen and words to be
here is a list of colors

1=blue 9=light blue
2=green A=light green
3=aqua B=light aqua
4=red C=light red
5=violet D=light violet
6=yellow E=light yellow
7=white F=brigth white
8=gray

example... 19 would turn my screen blue with a light blue text

(not very good example very blurry and hard to see... sorry... but you get it)

Step 3: Some Basic Commands

ok now you should have something like this

@echo off
color cf

i used the colors "cf" but you can type anything you want

ok so if you want a title all you need to do is type

title (insert title here)

dont use ( )

it should look like this

@echo off
color cf
title Computerfaker3's TRIVIA

now if you want it to say something type echo, echo tells the computer to say something so if you type echo Hi it will repeat Hi back to you

echo Hi, welcome to Computerfaker3's Trivia

typing echo. will create a space

i added lines to make it look better
this is what i did
this is completly up to you i did it cause it looks cool and better then just plain
echo Welcome to Computerfaker3's TRIVIA!!

echo.
echo - - - - - - - - - - - - - - -
echo.
echo Welcome to Computerfaker3's TRIVIA!!
echo.
echo - - - - - - - - - - - - - - -
echo.

Step 4: Asking Questions

Ok you got the main screen set up
now it should look something like this

@echo off
color cf
title Computerfaker3's TRIVIA
echo.
echo - - - - - - - - - - - - - - -
echo.
echo Welcome to Computerfaker3's TRIVIA!!
echo.
echo - - - - - - - - - - - - - - -
echo.

ok to create questions you have to type alot
first you have to type your question and the answers

echo Who is that little green guy in Star Wars
echo 1 Yoda
echo 2 Darth Vader
echo 3 Luke

you can put however many questions you want just be sure to set it right

Step 5: Creating Answers

after typing your intro type
pause
cls

cls will clear the screen
pause will pause it untill you press something
sometimes you have to type pause twice i dont know why but if you do pls tell me

say you used my example

echo Who is that little green guy in Star Wars
echo 1 Yoda
echo 2 Darth Vader
echo 3 Luke

there are 3 possible answers so now you need to set something to act as the question

set /p (watever you want)=choice1~3

if you have more question type set /p (watever)=choice1~ and then how ever many questions you have, i have 3

in this example i'm going to use starwars

set /p starwars=choice1~3

now you have to make the answers

if %starwars%==1 goto Correct

if makes it a variable
%starwars% means that we are using the starwars we set
==1 means if you type 1

-by the way i'm not a genius so if i got something wrong here feel free to correct me

if %starwars%==2 goto Incorrect
if %starwars%==3 goto Incorrect

if you have more questions you have to enter them just do the same thing i did

Step 6: Goto

goto means litterally to goto something
so if i type goto correct it will goto correct
to make it go to correct i have to make correct its really simple just type

:correct

then you can type watever you want
echo You got it right!!

be sure to type pause other wise it will say You got it right! for like 1 second and then close
heres what a finished copy looks like

:correct
echo You got it right!!
pause
goto continued
:incorrect
echo Sorry, try again.
pause
goto end
:continued

now continue the steps and when you get done type :end
if you have any questions feel free to ask i should be able to help

everything

@echo off
color cf
title Computerfaker3's TRIVIA
echo.
echo - - - - - - - - - - - - - - -
echo.
echo Welcome to Computerfaker3's TRIVIA!!
echo.
echo - - - - - - - - - - - - - - -
echo.
pause
cls
echo Who is that little green guy in Star Wars
echo 1 Yoda
echo 2 Darth Vader
echo 3 Luke
set /p starwars=choice1~3
if %starwars%==1 goto Correct
if %starwars%==2 goto Incorrect
if %starwars%==3 goto Incorrect
:Correct
cls
echo You got it right!!
pause
pause
goto continued
:Incorrect
cls
echo Sorry you got it wrong!!
pause
pause
goto end
:continued
cls
echo you made it to the end
pause
pause
:end

Step 7: Everything

everything

@echo off
color cf
title Computerfaker3's TRIVIA
echo.
echo - - - - - - - - - - - - - - -
echo.
echo Welcome to Computerfaker3's TRIVIA!!
echo.
echo - - - - - - - - - - - - - - -
echo.
pause
cls
echo Who is that little green guy in Star Wars
echo 1 Yoda
echo 2 Darth Vader
echo 3 Luke
set /p starwars=choice1~3
if %starwars%==1 goto Correct
if %starwars%==2 goto Incorrect
if %starwars%==3 goto Incorrect
:Correct
cls
echo You got it right!!
pause
pause
goto continued
:Incorrect
cls
echo Sorry you got it wrong!!
pause
pause
goto end
:continued
cls
echo you made it to the end
pause
pause
:end