Make a chess like game in batch

May 12, 2010 at 18:17:56
Specs: Windows XP
I wish to make a chess game kind of thing in a batch file IE your on A1 and you press W you goto A2 (marked in the batch file as :A2) if you press D you goto B1 (or B2 if you pressed w then d) (marked as :B1 (or :B2 like i mentioned) and vice versa (unless your at the edge of the board and are trying to go off the edge.) How would I set something up like that.

What i know so far:

I will need a GUI (made out of ascii art. I have a generator.)
I know basic commands such as;
@echo off
goto :var
if ERRORLEVEL = x goto :var
and i know how to fiddle with things.

I am just bored and would like to make this so i could possibly even make an undefeatable chess bot. (ie no matter what you move, your opponent will make the most optimal move, and I can make a mind map or something like that to help me, which will take a lot of time to script every move because i have to go down every path.)

See More: Make a chess like game in batch

Report •

June 2, 2010 at 17:59:32
I'd try a different language than batch. it's not really a programming language, more of a DOS command macro system.

Report •

June 3, 2010 at 04:31:32
i could possibly even make an undefeatable chess bot

Some of the best programmers in the word using some of the most powerful computers ever made and the most complex programming languages ever devised have failed to achieve that.

Not much chance with a bat file at all. First you need to understand all the intricacies of chess and be able to work out what is likely to happen three or four moves ahead and calculate all the possible outcomes from those moves, outcomes that can run into thousands.

Some of the best chess players are thinking anything up to ten moves ahead.


Report •

June 3, 2010 at 16:32:29
Ok, so it cannot happen with batch files. But it can happen easily right? Doesnt an AI only need a mind map with all the possible moves to figure out what is the optimal move (ie what path or set of paths have the potential to result in the most wins)? If the best chess player thinks like 10 moves ahead, then if an AI is 'thinking' all the way to the checkmate, there is no way that AI could lose... right?

Report •

Related Solutions

June 3, 2010 at 19:26:49
You're not taking the human opponent into account. For every
move the computer "maps", it must then "map" every possible
counter move the human could do, no matter how bad or "dumb" the move is, because there's still no way to really know for sure that a "dumb" move could result in the human winning. Then, for every possible counter move, the computer must map again all it's own possible moves, each of which is followed by all the possible human counter-moves. I believe
this is known as a "combinatorial explosion".
Maybe it's possible, or maybe even been done...with supercomputers. Not to discourage you... If you get something actually working, I'd really be interested in seeing the code (after you get it patented of course).

Report •

June 3, 2010 at 19:51:29
I've found out from my father that when he was younger (typical line from a 53 year old ex-soldier with hearing issues and vision issues), he used to work in this place where they had a chess bot super computer kind of thing. It had 10 levels of difficulty and no one in the building could beat level 3. He only could beat level 1.

This is plausable, right? I am remaining Sane? or am I going insane?

So, even if we had a "combinatorial explosion" and the computer crashed, it would still be able to map lots of moves, as it would taking a move which expands all the way to the most victories for the computer! IE if it were to move the rook to X, we would have a potential 15:7 win loss ratio, with 3 potential stalemates, but if I move the rook to Y, we would have a potential 20:5 win loss ration, with 7 potential stalemates, so I will move the rook to Y. See my logic?

But, my final goal is to make this thing work on the everyday computer, IE your laptop, his phone, her pda, my computer, their Mac's, ETC.

Report •

Ask Question