Simplified checkers (AI)
Moderator: PC Supremacists
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Simplified checkers (AI)
So in case you're wondering why you haven't heard from me in news posts or heard of my work in the Adventures in Game Development videos lately, it is because I have spent the last month or so programming this checkers game here (that and my job). I think I included all the necessary dependencies. Hopefully everything is right 'cause I'm all tired here.
Zip is here http://www.mediafire.com/file/znntjijjh ... eckers.zip
The write-up (not in zip) is here http://www.mediafire.com/file/xhjrjm1tt5m/checkers.doc msword format 7 pgs single-spaced and shouldnt be hard to understand
You may get some sort of 'application configuration is incorrect' error. Let me know so I know if I should bother to try and compile with g++ or use MSVS redistribute-stuff-the-right-way mode, or something. Only one person has to post that.
Edit: Source is here (below): http://elysianshadows.com/phpBB3/viewto ... 563#p28563
Zip is here http://www.mediafire.com/file/znntjijjh ... eckers.zip
The write-up (not in zip) is here http://www.mediafire.com/file/xhjrjm1tt5m/checkers.doc msword format 7 pgs single-spaced and shouldnt be hard to understand
You may get some sort of 'application configuration is incorrect' error. Let me know so I know if I should bother to try and compile with g++ or use MSVS redistribute-stuff-the-right-way mode, or something. Only one person has to post that.
Edit: Source is here (below): http://elysianshadows.com/phpBB3/viewto ... 563#p28563
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Checkers
Great, can't download that attachment at work. I'll play around with it when I come home tonight.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Checkers
Oh yeah, the version I sent you is slightly dumber than the version posted here. Also for those who didn't know it's simplified checkers (per assignment), once a player gets a king, that player wins.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Simplified checkers (AI)
I guess I should mention that this implements artificial intelligence via alpha-beta search (aka alpha beta pruning).
Edit: Executable is here (OP): http://elysianshadows.com/phpBB3/viewto ... 296#p28296
Source (except for the SDL files) is attached. You'll need SDL, SDL_image, and SDL_ttf in order to compile it. Source may not totally correspond to the executable but it should since I think all I took out were my comments.
http://www.libsdl.org/download-1.2.php
http://www.libsdl.org/projects/SDL_image/
http://www.libsdl.org/projects/SDL_ttf/
Edit: Uploaded fixed source, depth should now be able to be infinite w/o crashing your machine, but behavior is not tested yet.
Edit: Executable is here (OP): http://elysianshadows.com/phpBB3/viewto ... 296#p28296
Source (except for the SDL files) is attached. You'll need SDL, SDL_image, and SDL_ttf in order to compile it. Source may not totally correspond to the executable but it should since I think all I took out were my comments.
http://www.libsdl.org/download-1.2.php
http://www.libsdl.org/projects/SDL_image/
http://www.libsdl.org/projects/SDL_ttf/
Edit: Uploaded fixed source, depth should now be able to be infinite w/o crashing your machine, but behavior is not tested yet.
- Attachments
-
- CS_463_Source_Fixed.zip
- (375.81 KiB) Downloaded 124 times
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Simplified checkers (AI)
There is an executable there, right? I still plan on playing/screwing with it. I just have a final today. =(
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Simplified checkers (AI)
Executable in OP.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Simplified checkers (AI)
That's pretty sweet Marauder. It's good fun actually, haha I got owned on 7 though and 10 froze my CPU :P. It's more fun to not enter -1 for player at all and just have the computer play itself lol.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Simplified checkers (AI)
I updated this a while ago so the memory handling is correct, but I haven't posted it yet. It allows infinite depth d:
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Re: Simplified checkers (AI)
Pretty tight man, I like it a lot. I've been messing around with it and seems to run well; no crashes. I got my ass whooped though, as I have not played this game in ages (not set -1). I haven't looked in depth at all the code, so I was curious as to why you commented out the entire system::init function definition.
It's interesting to see how this relates to what I'm also doing in school, BTW.
For instance, a while ago (before all these goddamn finals that I have right now) I had to write a proggie that treated the 8x8 Chess board as a undirected connected simple graph, where all inner nodes/vertices were to be considered strongly-regular and squares were represented by these very nodes/vertices. The main (and only) objective was this: given a specific set of chess pieces already aligned on a hypothetical board (this would be set by the program initiation), you were to use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.
I'll take a read at the design documentation and give you some constructive criticism if you'd like.
It's interesting to see how this relates to what I'm also doing in school, BTW.
For instance, a while ago (before all these goddamn finals that I have right now) I had to write a proggie that treated the 8x8 Chess board as a undirected connected simple graph, where all inner nodes/vertices were to be considered strongly-regular and squares were represented by these very nodes/vertices. The main (and only) objective was this: given a specific set of chess pieces already aligned on a hypothetical board (this would be set by the program initiation), you were to use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.
I'll take a read at the design documentation and give you some constructive criticism if you'd like.
Re: Simplified checkers (AI)
funny how that stuff works out huh?sparda wrote:Pretty tight man, I like it a lot. I've been messing around with it and seems to run well; no crashes. I got my ass whooped though, as I have not played this game in ages (not set -1). I haven't looked in depth at all the code, so I was curious as to why you commented out the entire system::init function definition.
It's interesting to see how this relates to what I'm also doing in school, BTW.
For instance, a while ago (before all these goddamn finals that I have right now) I had to write a proggie that treated the 8x8 Chess board as a undirected connected simple graph, where all inner nodes/vertices were to be considered strongly-regular and squares were represented by these very nodes/vertices. The main (and only) objective was this: given a specific set of chess pieces already aligned on a hypothetical board (this would be set by the program initiation), you were to use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.
I'll take a read at the design documentation and give you some constructive criticism if you'd like.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Simplified checkers (AI)
Updated source ( http://elysianshadows.com/phpBB3/viewto ... 563#p28563 )
Thanks.sparda wrote:Pretty tight man, I like it a lot.
There's a couple I commented out =) I refactored that part, I think, out to some part of Renderer.I was curious as to why you commented out the entire system::init function definition.
I had to look up most of the terms but then I remembered them from my algorithm design class =) Yeah, neat stuff. We focused a lot on prepositional logic modeling in my AI class, and modeled n-queens :)use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.
It's more of a report for the professor. You can if you want to, doesn't make any difference anymore, though (got a 94 in the class).I'll take a read at the design documentation and give you some constructive criticism if you'd like.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.