Thread: Wanna play my game?

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Wanna play my game?

    Hey, wanna play my connect four game? This is my first attempt at AI and the comp plays a pretty decent game although it plays a little too predictably at higher levels because how it views the best move never really changes... it really needs one more recursive level for it to be REALLY strong since it falls for too many traps that are 8 levels deep! With school and projects though haven't had time to get in that extra level...

  2. #2
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I lost to a level 1 computer by accident Then I won 7 consecutive games with this strategy:

    Code:
    | | | |X| |O| |
    
    | | | | | |O| |
    | | |X|X| |O| |
    
    | | | | | |O| |
    |O|X|X|X| |O| |
    Very entertaining doing that
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  3. #3
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    You mean you beat level 1 like that? I hope you didn't beat level 7 like that, how embarrasing for me!

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    49
    Work on it during school, that's what I do, except in Social Studies, we have an over-energetic student teacher who doesn't like naps or anything else besides picking through trash and social studies.
    DJGPP-Complier
    Windows 98-(Shouldn't need to explain)

    I like plants.

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Heh, I beat it on level 7.. first try.
    I played first and the AI was good for some time, then it just allowed me to get an easy four by playing in row 6.

    Code:
            | | |☻|☺|☻| | | |
            | | |☺|☺|☺| | | |
            |☻| |☻|☺|☻| |☻| |
            |☺| |☺|☻|☻| |☺|☺|
            |☻| |☺|☺|☺|☺|☻|☻|
            |☻| |☺|☻|☺|☻|☺|☻|
            -----------------
             1 2 3 4 5 6 7 8
    
    
    Try those weak tactics on my level 7 setting!
    
    
    Computer wins -> 0
    Player wins   -> 1
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    Registered User
    Join Date
    Mar 2002
    Posts
    249

    Post

    can I get the source code for that plz?

  7. #7
    Registered User GreenCherry's Avatar
    Join Date
    Mar 2002
    Posts
    65
    Thats a pretty cool game!
    I have a rabbit in my pants! Please be happy for me.

  8. #8
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Actually Sang-drax, the computer is too smart for its own good, which is why it moved on row 6. If you notice, if you had gone on row 6 first, it would have lost, since he would have to go 6 to stop you, then you hit row six again with a trap where if the comp stops your four diagonal you got the four horizontal on top of that - an example of a 8 level trap that my comp falls for since it only looks 7 levels deep I haven't QUITE figured out how to debug it so the stupid thing doesn't just give up when it sees it's lost. After all, it should make you work for it! But everytime I try to tinker with it, it messes up the AI somewhere else... I'll post the source code this weekend from home... although I'm a little embarrassed since I wrote it before I learned anything object oriented so its VERY MESSY! Straight off my old QuickBasic techniques!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Told ya so...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 58
    Last Post: 09-12-2007, 08:12 PM
  2. Wanna learn DirectX game programming
    By Hermitsky in forum Game Programming
    Replies: 2
    Last Post: 12-01-2004, 07:35 AM
  3. My Memory Game
    By jazy921 in forum C Programming
    Replies: 0
    Last Post: 05-05-2003, 05:13 PM
  4. Lets play money making game
    By ggs in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 09-27-2001, 07:39 PM
  5. Lets Play Money Making Game
    By ggs in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-04-2001, 08:36 PM