falohound.blogg.se

How to use notepad++ to make a game
How to use notepad++ to make a game






how to use notepad++ to make a game

This works becauseif the user guesses 1, d1 should equal 1. ::~ Checks that the number hasn't been already chosen by checking that !d%guess%! is equal to guess. ::~ If the user didn't input or entered something that wasn't a number between 1 and 9, it 'goto's back, to ask again ::~ Asks the user to input the number of the space they want to choose and allows them to using "Set /p" If /i !d%guess%! neq %guess% goto 1display If it has, all the spaces on the grid have been used up and nobody has won, so the game is a draw.Įcho Choose the number of the space you'd like to choose ::~ Checks that the turns hasn't reach nine. At the start these will all just be numbers. ::~ ^^ Displays the current status of each place in the grid. ::~ This tests to see if the numbers are equal, then sets the "go" variable to whichever possibility came out and deletes the "rnumber" variables ::~ This is the method I use to create a 50% chance, as there's a 50% that a random number will be odd or even ::~ If the number was even, it would be equal to "rnumber2", if it was odd it would end up one less than "rnumber2" ::~ Divides "rnumber" by two, then multiplies by two. ::~ Sets a variable "rnumber2" to the same number as "rnumber"

how to use notepad++ to make a game

::~ Sets a variable "rnumber" to a random number ::~ Sets the display characters for game to their appropriate number ::~ Sets all the places on the noughts and crosses grid to 0 ::~ Sets the number of turns taken so far to 0

how to use notepad++ to make a game

::~ Checks the Menu variable, tests to see if it matches 1, 2 or 3, then 'goto's the appropriate place. :~ If the user didn't enter a value, it 'goto's back to ask again. ::~ ^^ The menu system, gives all the options, allows the user to input a number using "set /p menu=" ::~ ^^^ Stops all commands appearing on screen, sets the title and enables the use of ! for environment variable








How to use notepad++ to make a game