Does anyone here know BATCH Programming? - I Have a Problem...

Hello everyone!

I was just wondering if anyone here is familiar with BATCH as a programming language.

Yes, I know C++ is the way to go when programming, but I’ve always had a soft spot for BATCH and I enjoy going back into it sometimes.

Unfortunately, I have a problem that has plagued me far too long.

Does anyone know how one would block commands.

In other words let’s say this is my CMD game screen:

Welcome to the game.

Type “hi” to say hi.
Type “bye” to say bye.

In my current state, if I were to type “yes,” the game will just take that as the input, therefore bringing the player into the next screen as if they typed “hi.”

What I want to do is disable any other word inputs except for “hi” and “bye.” If the player were to type “yes” I would like an echo of “I do not understand.”

Any ideas?


~ Jason

why in batch?
To disable input you have if (condition) goto: back to question.
Write exactly what you need in C here or pseudocode, should be easy to translate into batch.
Well some thing are however impossible in ms batch, you need some extended things like tcc.

Also why batch not python or perl?

Ps this is take comand help page and syntax for if then:
most of stuff works in dos

Honestly, BATCH is just full of nostalgia for me.

I love programming in it. It reminds me of ZORK…

Anyway, I found out my problem.

My game was based off of number inputs (the player would have to pick the number of the choice they wanted).

All I needed to do was add an IF Statement that stated if the input number is greater than the last number of the choices it would state that the input is invalid.

Thanks for the link, its a lot more organized than my syntax pages (which are all over the place).

~ Jason

I still remember dos time, loading all drivers to upper memory, because game required 540kb.
Now game icon has around 1mb.

It really is crazy, how far we’ve come from the days of MS-DOS.
Though at the same time we’ve taken a few steps back…

~ Jason