codes

This is a discussion on codes within the A Brief History of Cprogramming.com forums, part of the Community Boards category; You should be able to download my code from the c4 contest results thread, I doubt it would be difficult ...

  1. #31
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    You should be able to download my code from the c4 contest results thread, I doubt it would be difficult to incorporate into your program to see which one would win. Just make sure your program doesn't take more than a second to make a move to be fair since that was part of the contest rules

  2. #32
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Quote Originally Posted by major_small
    well, from searching, I find Shadow's results ALOT more, but I did find govt's results, always alongside Shadow's... my conclusion: You're both right, but govt's is the lesser-known (or doesn't work in all versions of the game:

    http://www.gamewinners.com/nes/Contra.htm
    I always thought that code originated from Contra 1 on the NES. I do want to say Govtcheez is right as well but GameFAQs is a pretty widely used code and information source for video games. Everything else they have is essentially verified. I also have nooooo clue if that code was in other games or a variation of it was, that'd be a new one on me(simply because I never paid attention).

    But hey, in about 5 minutes you could be playing that game on your computer with an emulation search.

    Discussing a video game code from the 80s. There's a thread derailment.
    Last edited by Shadow; 11-18-2005 at 11:18 AM.
    The world is waiting. I must leave you now.

  3. #33
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    I think right now my game takes more like 2-3 seconds for the first ~5-7 moves. So I'll have to find some way to improve performance. Or I could have it start at a smaller depth, and incrementally increase the depth as the game continues. Or I could implement a transposition table and iterative deepening with a timeout indicator to stop at 1 second of search. Depends on how ambitious I feel this weekend.

    BTW, I have a fairly advanced evaluation function, which is why it plays not too bad even for depth 1. Basically Eval does the following (pseudocode):

    Code:
    int eval()
    {
        for each 4-in-a-row possible on the board
        do
            if both min and max have played a piece in that board
            then
                assign no points and continue
            else if max played piece in that board
                if max has 4 of 4 then eval = MAX_WINS
                if max has 3 of 4 then eval += MAX_BIG_ADVANTAGE
                else if max has 2 of 4  then eval += MAX_SMALL_ADVANTAGE
            else if min played piece in that board
                if min has 4 of 4 then eval = MIN_WINS
                if min has 3 of 4 then eval += MIN_BIG_ADVANTAGE
                else if min has 2 of 4  then eval += MIN_SMALL_ADVANTAGE
            end if
        done
    }
    And in the code above the MAX_* constants are positive, and the MIN_* constants are negative. So what ends up happening, is that max favors moves that maximize 2 and 3 in a rows, but also might favor moves that kill min's 2 or 3 in a rows. So even at depth 1, the computer for instance "see" which play will minimize the opponents chances (by killing the most winning boards)--even it it isn't computationally certain that it's choice is correct.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  4. #34
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Not bad, let me know how our two programs fare against each other.

  5. #35
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Location
    Milwaukee, WI, USA
    Posts
    300
    My whole life has been a lie.
    http://en.wikipedia.org/wiki/Konami_Code

    It must be that both work; a co-worker confirmed he used the B-A-B-A version, too.

    Discussing a video game code from the 80s. There's a thread derailment.
    No doubt. We've gone from bad grammar to random game cheat codes to the specifics of one code to Connect Four AI and back again. Wow.
    There is a difference between tedious and difficult.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 07-12-2005, 10:03 PM
  2. action replay codes
    By c++.prog.newbie in forum Game Programming
    Replies: 2
    Last Post: 02-28-2004, 08:47 AM
  3. Key codes...
    By Supar in forum C++ Programming
    Replies: 3
    Last Post: 03-18-2003, 08:48 PM
  4. anyone have linked-list sample codes?
    By ling in forum C++ Programming
    Replies: 3
    Last Post: 07-03-2002, 03:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21