weaponx Posted November 6, 2007 Share Posted November 6, 2007 (edited) Setup WindowStandard ModeSurvival Mode (Left 4 Dead Mode) NEWNotes:-All original code...based on Master Checkers flash game-Tested in 3.3.0.0-FYI: AI is WIP-No external files requiredSource:BETA 6: Updated 2/24/09Checkers_b6.au3 Edited February 24, 2009 by weaponx Link to comment Share on other sites More sharing options...
Valuater Posted November 6, 2007 Share Posted November 6, 2007 Not bad at all!!! 8) Link to comment Share on other sites More sharing options...
weaponx Posted November 6, 2007 Author Share Posted November 6, 2007 Not bad at all!!!8)Thanks for checking it out. At first glance you think "checkers? I can write that in 20 lines of code" but then you really have to break it down into logical steps. I'm pretty sure a chess game would take about 35% more code. Link to comment Share on other sites More sharing options...
gseller Posted November 6, 2007 Share Posted November 6, 2007 Sweet! I was totally able to beat it first game.. LOL I suck at checkers tho. LOL Nice example... Link to comment Share on other sites More sharing options...
weaponx Posted November 6, 2007 Author Share Posted November 6, 2007 Sweet! I was totally able to beat it first game.. LOL I suck at checkers tho. LOL Nice example... It's pretty easy to win right now. You should have tried the first version I made, AI movement wasn't random. AI pieces would be selected starting from the left side and if it could move it would, so one piece would move until it got kinged and no other pieces would move...good times.The next version will actually look for pieces with jumps first instead of randomly choosing any piece that can move. I'm hoping to also have triple and quadruple jumps etc... Link to comment Share on other sites More sharing options...
gseller Posted November 6, 2007 Share Posted November 6, 2007 Definately improved then.. LOL Keep up the great work... Link to comment Share on other sites More sharing options...
Siao Posted November 6, 2007 Share Posted November 6, 2007 I'm pretty sure a chess game would take about 35% more code.I think that's a veeerry optimistic estimation. Unless you mean no AI whatsoever. Anyway, this looks really promising, keep up the good work.I wanted to code checkers in AutoIt some time ago, but gave up on it pretty soon... "be smart, drink your wine" Link to comment Share on other sites More sharing options...
weaponx Posted November 20, 2007 Author Share Posted November 20, 2007 Updated to Beta 2. Possible moves are now found recursively, so you can jump up to 9 times (conditions allowing). Link to comment Share on other sites More sharing options...
autoitxp Posted November 30, 2007 Share Posted November 30, 2007 man this really good and inspiring u coded very well my question how much time it take to build ?? Link to comment Share on other sites More sharing options...
thomaatje Posted November 30, 2007 Share Posted November 30, 2007 good job! Link to comment Share on other sites More sharing options...
BigDod Posted November 30, 2007 Share Posted November 30, 2007 In checkers if a jump is available then you must jump. I notice that this is not the case in your version. Apart from that it is pretty good. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Achilles Posted January 2, 2008 Share Posted January 2, 2008 Nice work! I agree with BigDod in that you have to jump if you can... Also, I would recommend giving a little bit of time after you more before the computer moves. That might allow the user to see what where the computer moved... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
The Ape Posted January 3, 2008 Share Posted January 3, 2008 Well done!I agree with Piano_Man. I'd like to see the move. Also, an AI would be difficult but possible. At this point, I feel like I'm back in 6th grade PE playing checkers... only I'm 31 and kicken ***! FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted January 3, 2008 Share Posted January 3, 2008 In checkers if a jump is available then you must jump. I notice that this is not the case in your version. Apart from that it is pretty good.I've never played it like that.. seems more fun the way he has it.Also good work with the code, very well laid out and easy to understand. Can't wait for the finished product! Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
DirtDBaK Posted January 4, 2008 Share Posted January 4, 2008 (edited) Just tested this out. Very nice, only thing I can say to help you improve is maybe work on it's way to see if it has a jump or if it's creating a jump for the opposing team. I understand that would be very hard. Good luck and keep up the good work! Edit: As I sugusted to the user who wanted to create chess it would probabbly be much eiaser to just create a two player game rather than AI. Nice work though! Edited January 4, 2008 by DBak [center][/center] Link to comment Share on other sites More sharing options...
weaponx Posted February 6, 2009 Author Share Posted February 6, 2009 Updated for AutoIt 3.3.0.0 compatibility. Link to comment Share on other sites More sharing options...
Spiff59 Posted February 6, 2009 Share Posted February 6, 2009 (edited) That's very slick! I've never played where you had to *jump* if it was an option, but I think the rules are that you have to *move* if it's possible. So, the skip button sems to be a bit of a 'cheat'. A neutral-colored "Turns: " label would be cool so one could keep track of how many turns it takes to beat the AI. A number that would increase as you improve the AI until eventually the AI might come out triumphant! A little code contribution, you might use, if you like, in CreateBoard and CreateTeams to simplify the $flip flag... $flip = false For $Y = 0 To $boardRows - 1 For $X = 0 to $boardCols - 1 If $flip Then ;flip1 - square type 1 Else ;flip0 - square type 2 EndIf $flip = ($flip=0) Next $flip = ($flip=0) Next EDIT: Oops! Just noticed your MVP status, I prolly shouldn't be offering code snippet to you guys <sheepish grin>. Well, I was born in Akron, so maybe you'll forgive me! Go Bucks! Edited February 6, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
SadBunny Posted February 6, 2009 Share Posted February 6, 2009 (edited) Well this certainly looks nice!I just created a VERY simple tic-tac-toe game, put it in the examples forum too (http://www.autoitscript.com/forum/index.php?showtopic=89137), mostly as an attempt to create a working AI albeit the simplest one ever. Then I refresh the page a couple of minutes later and I see a checkers game! Cool.My two cents worth of complaints:1 - If you click on one of your pieces, you get the nice green circles for the possible moves. What if you change your mind and want to move another piece? That seems to be totally forbidden now. Clicking a pice to see its moves means you MUST move that piece and cannot change your mind any more. That seems user-unfriendly 2 - The flickers and the almost immediate moving of the computer means you cannot see clearly what the computer is doing. I would suggest placing a faint green square around the last moved piece, or color it's background a bit, something like that.3 - Indeed, as others noted, it would be a good idea to make the program adhere to the rules of the game (at least that if a jump is possible you MUST jump). It seems [understatement]'vaguely important'[/understatement] to get that done before attempting AI.I have not thought a lot about checkers AI (actually, not at all before today), but if you want to implement that, here's some things I can think of (assuming you will be using a recursive decision tree, and not difficult stuff like genetic algorithms or neural networks, which would (IMHO) be pretty much ridiculous to attempt in a slow non-OO language like AutoIt anyway):- Better use breadth-first (as opposed to depth-first) searching because AutoIt is quite slow, especially seems so in array handling.- Hill climbing algorithms seem unwise in board games where sacrifices may be in order, especially if all you do is just count pieces. Local maxima lurk around every corner. Either use workarounds for local maxima or leave the technique aside completely - It seems that just counting your pieces will not be a very useful method of board score calculation, at least not on itself or as a primary score weight, taking into account the number of sacrifices that a regular checkers game contains.98- I would deem it important if you encounter jumping moves in your recursive tree of options, to iterate along the jumping moves situation branching to every possible point where no further jumping is possible, before calculating a board score. Board score calculation in between jumps will be totally unthrustworthy and thus a waste of time, especially since you MUST jump if you can, so only after all necessary jumps have been done, the score calculation is useful. This should save prescious calculation time and give you a more informed AI.Now this is ofcourse all very basic (and novice) theory and might not apply at all to your style of working. In that case, please disregard everything I said It's just what I would ask myself. Good luck! I hope you succeed in finding at least a working AI./edit: tpyos. I mena, i mean mean, typso, dman there i go agian, typos. Edited February 6, 2009 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
weaponx Posted February 6, 2009 Author Share Posted February 6, 2009 (edited) Another update to Beta 3: - Added setup gui before game loads, allowing the user to specify players as human or CPU. If both are CPU the game will be simulated and the speed will be slowed down so you can see what moves are being checked. NOTE: Things can get wonky when running as a simulation. Since the pieces aren't actively seeking each other they may get stuck in an endless loop when the board is almost empty. Edited February 6, 2009 by weaponx Link to comment Share on other sites More sharing options...
weaponx Posted February 17, 2009 Author Share Posted February 17, 2009 Updated to Beta 4: -Selected piece can be changed if a jump hasn't been performed -Removed Skip option -New interface design -Added move counter -Added longest jump record -Optimized movement to reduce flickering Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now