Batch Tutorial – Notepad: Virtual Dice & Probability | Random Number Generator | CMD Programming
Making games with Notepad! Batch Programming.
Did you know that you can make games in Notepad using very simple codes!? Well, you do now.
Making games with Notepad using Batch Programming is actually very simple and easy. You are restricted with only text. You can customize the background with preset colours. You can make a mean text-based adventurous game using that.
Make a Game in Notepad
Virtual Dice in Notepad Batch Programming
In this post we’ll be seeing mainly about probability in Batch Programming. So, you can make a standalone program such as Virtual Dice.
What we do is that we generate a random number whose value is less than 6. So, we have the numbers (0,1,2,3,4,5). Later we add +1 to it. Then we print/display the number.
Probability effect with two unequal outcomes in Notepad Batch Programming
You can additionally also make a program which needs to work with a game. This can work with a fighting game (Probability). Let us assume that you are fighting and that 75% chance is that of you winning,
What we do is that we generate a random numbers whose values are less than or equal to 100. So, we have the numbers upto 100.
Later, we add the IF statements. If the number generated is less than or equal to 75, you win. If the number generated is more than 75, you lose.