Jump to content

Can and/or how AutoIt can read/play chess board?


kart442
 Share

Recommended Posts

Yes

EDIT: That was step 1, step 2 is reading the help file and making the script

Step 1: Learn AutoIt.

Step 2: Write script that will duplicate $200,000,000.00 IBM Deep Blue project.

Step 3: ???

Step 4: Profit!

My future is now secure!

<_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I have gotten my ass kicked by some cheap battlechess game before. I guess the big difference between battlechess and IBM's Cray would be one just makes random moves, and one processes every possible scenerio, making a determination on highest likeliness of a win.

I read some artical recently on Slashdot or BoingBoing about how unpredictable AI may actually be more challenging since it keeps the player from getting into a rythym.

Link to comment
Share on other sites

Actually Weaponx, i would see the former as harder, If you get stuck into a rythym during a game of chess, It is highly likely that you will fail, Especially if / when the opponent makes an un-expected move and you just slap along with your current frame of thought.

As for AutoIT Playing Chess.. I would love to see that.

For starters, you can reference all pieces via a Grid Co-Ordinate, and a Letter for the piece type.

Castle

Knight

Bishop

King

Queen

Pawn

You would also need to find a way that works for holding values of each piece of the board.

I can see the most efficient way of this being a set of 64 variables. Holding one of several possibly values:

A piece (White or Black) and its type

Who controls the square: White, Black or Both

So, something along the lines of

$a1 = WC (Has a white castle)

$a2 = WP (Has a White Pawn)

$a3 = W (Is controlled by White, In this case, by the White Pawn in the $b2 position)

$a4 = (Blank, as it is neutral at the moment)

$a5 = (Blank, as it is neutral at the moment)

$a6 = B (Control by Black Pawn in $b7)

$a7 = BP (Black Pawn

$a8 = BC (Black Castle)

Perhaps an array would be better.

Eitherway, Then you just need a whole heap of if thens

For arguement sake, using the above, If i were to attempt to put the black king in $a3, It would be illegal.

If the black king was in position $a5 and i moved the pawn from $b2 to $b3 then the Black king would be in check !

A function for Each type of piece, That is able to calculate the items in its determined path of movement would be required aswell, Basically, so when the Pawn is moved from $b2 to $b3 it evaluates the contents of $a4 and $c4 to see if there is anything there, If there is a King, it will be marked as in Check.

It wouldn't be the fastest of scripts, and it wouldn't really "play" chess, more or less just govern if the move was legal. But it would be a great start.

Hope that helps the logical break down.. I wish I could be bothered with such a task as attempting to script this, But I just don't have time.

Edited by tAKTelapis
Link to comment
Share on other sites

I can see how unpredictability can be challenging with AI in some situations, though. For example, try playing a a RTS or FPS game against the AI, do that for a long time, get used to it, then try playing against a human. Even if they suck, they still do weird things that you wouldn't expect. AI is too predictable.

Of course, if you're doing something unpredictable, it shouldn't be something stupid that accomplishes nothing. "This time I'll turn my monitor off and attack him with my mind!"

Link to comment
Share on other sites

I think in chess, AI would be predictable, if you knew the book moves you would know what IT is doing, BUT try learning all the moves for every opening up to 12 moves ( some openings go to 30 moves or more ). Look at the best players in the world and see how many can beat DEEP BLUE.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...