Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-24-2006, 12:42 PM   #1
jacquesmc
Registered User
 
Join Date: Dec 2001
Location: Belgium
Posts: 17
Default Flash chess engine + source

Hello all,

It's still in a very early stage, and could be greatly improved. Graphics are temporary & ugly.

But here it is:
http://www.jacquesmalchance.com/chess

Note:
There's no detection for check or mate yet, but the computer will never leave itself in check (unless it is mate). Castling is supported, 'en passant' isn't. It's slow and not really strong and most people should win from it.

For those who know something about computer chess (I knew nothing when I wrote it):
Apparently it uses some kind of improvised alpha-beta optimization, with very primitive move sorting. It has a fixed PLY of 4 (PLY can be changed in the source code).

In the meanwhile I've read a bit about computer chess, and would like to rewrite the whole thing using 'bitboards' (but I don't know if bitwise calculations in AS are fast enough), variable PLY, better evaluation and better move sorting. Does anyone have experience with this?

All suggestions welcome, and thanks for checking!

- Bram

Last edited by jacquesmc; 09-24-2006 at 04:03 PM.
jacquesmc is offline   Reply With Quote
Old 09-29-2006, 03:26 AM   #2
sunlis
Mac user and proud
 
sunlis's Avatar
 
Join Date: Feb 2006
Location: Canada
Posts: 694
Send a message via MSN to sunlis Send a message via Skype™ to sunlis
Default

Looks like the basics of the system are there, but it's a bit slow.
At least it's easy to beat!

EDIT: After playing another game, the opponent seemed to take about 3 turns during 1 turn. They got my King because of it, but the game kept going.
__________________
//dA
//blog
//site

Last edited by sunlis; 09-29-2006 at 03:38 AM.
sunlis is offline   Reply With Quote
Old 09-29-2006, 04:01 AM   #3
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,140
Default

Nice job!

btw, when the computer is "thinking" it maxes out my CPU the entire time.
__________________
trace("Good bye Flash.") Log.i(TAG, "Hello Droid");
Flash Gordon is offline   Reply With Quote
Old 09-30-2006, 11:04 PM   #4
actionone
Registered User
 
Join Date: Sep 2006
Posts: 23
Default Nice job

I love this chess game. I was still playing after I lost my king. What is that called if your king is taken off the board and you are still playing chess? I am not that good at chess?
actionone is offline   Reply With Quote
Old 09-30-2006, 11:11 PM   #5
sunlis
Mac user and proud
 
sunlis's Avatar
 
Join Date: Feb 2006
Location: Canada
Posts: 694
Send a message via MSN to sunlis Send a message via Skype™ to sunlis
Default

Quote:
Originally Posted by actionone
I love this chess game. I was still playing after I lost my king. What is that called if your king is taken off the board and you are still playing chess? I am not that good at chess?
That's what you call a coding error. When you lose your king, you're supposed to lose.
__________________
//dA
//blog
//site
sunlis is offline   Reply With Quote
Old 10-01-2006, 12:14 AM   #6
Assertnfailure
as[org].addListener(this)
 
Assertnfailure's Avatar
 
Join Date: Dec 2005
Location: LA, California
Posts: 837
Default

aren't bitwise calculations always supposed to be the fastest level of computation or something? I believe bitwise operations are the lowest level of data manipulation
Assertnfailure is offline   Reply With Quote
Old 10-06-2006, 12:53 PM   #7
jacquesmc
Registered User
 
Join Date: Dec 2001
Location: Belgium
Posts: 17
Default

Thanks for your reactions!

actionone: jup, it's a bug: there's no check detection yet.

Assertnfailure: this is true for lower-level languages, but I'm not so sure about AS. AS doesnt seem to have a binary data type.
jacquesmc is offline   Reply With Quote
Old 10-15-2006, 09:13 PM   #8
actionone
Registered User
 
Join Date: Sep 2006
Posts: 23
Default jacquesmc

I really like this game just how it is because you can play with no king. I bet other people would like it too.
actionone is offline   Reply With Quote
Old 10-15-2006, 10:14 PM   #9
pixelwit
village halfwit
 
pixelwit's Avatar
 
Join Date: Jul 2001
Location: USA, PA
Posts: 3,330
Default

Wow!

I've considered making a board to display a chess game using other people's non-Flash engines but never even considered making the WHOLE thing in Flash. That's quite an accomplishment for both you and Flash. Nice.

-PiXELWiT
http://www.pixelwit.com
__________________
There are no answers, only choices.
pixelwit is offline   Reply With Quote
Old 10-16-2006, 01:39 AM   #10
Assertnfailure
as[org].addListener(this)
 
Assertnfailure's Avatar
 
Join Date: Dec 2005
Location: LA, California
Posts: 837
Default

Someone posted one a while back where, whenever it was the computers turn, it would go through the whole recursive process of analyzing movements, and would draw lines on the screen to show its thought process. It was neat to see high concentrations of lines in areas of particular significance.
Assertnfailure is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to buil a pseudo search engine in pure flash galak ActionScript 2.0 11 01-17-2006 12:30 AM
[Q] Do we need those forums??? CyanBlue General Chat 59 07-27-2004 11:13 AM
enterframe and load and objects, oh my! dice ActionScript 1.0 (and below) 13 07-18-2003 11:07 AM
Flash MX seminar Tink ActionScript 1.0 (and below) 5 03-17-2002 04:41 AM
Php, Javascript, and Flash 5 browser detect and more! Redline01 Server-Side Scripting 2 08-11-2001 01:09 AM


All times are GMT. The time now is 12:23 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.