[C#] Reversi Program - Using GDI With Fully Integrated Logic Class

Discussion in 'General Discussion' started by Ace, Feb 21, 2013.

  1. Ace

    Ace

    Joined:
    Sep 13, 2011
    Messages:
    76
    Likes Received:
    13
    Location:
    Canada
    Probably one of the most advanced games I've tried recreating. I don't make a lot of games, but the logic here on a matrix was a little convoluted through the development stages.

    What I mean by fully integrated logic is that the control itself does absolutely everything for you. You can basically take this control, build it, and place it within your program immediately to start playing Reversi.

    There might be some issues I haven't seen yet, but it seems to work fine. I finished this early in the morning, but the only issue I have come across (and one I knew about because it was my list of todo's the whole time), is that when a play can't be made, it does not skip to the other person's turn like it is supposed to. This is an easy fix though.

    By the time you get to this stage, you probably will only have maybe 10 empty spaces on the board at most. Just loop through all of the empties and see if it's a possible move, and if none are found then skip to the next user. If the next user can't play, then the game is done probably.

    Usually you'll get to the point where all of the tiles are occupied though (80% of the time).

    I've seen the standard for this game is an 8x8 grid, but the way I've programmed it, If you don't add it via the designer, you can have as large of a grid as you want. (I was playing with 25x25 before no problem.)

    Unless you change the default constructor to chain to the second constructor with different values than 8 and 8.

    Preview:


    Earlier Images (through the progress):
    [​IMG]

    [​IMG]

    Code: (Note: Since the code itself was longer than the max number of chars this forum would let me post, I had to post it to pastebin.)
    http://pastebin.com/MvQwKt0K

    Still some minor functionality to be added, so I didn't worry about going through it all and optimizing it quite yet. Take it to learn from though if you want. There is quite a bit of code to this one though, so it can be overwhelming at first glance, I spent some time on this one though, and I had a few headaches with the logic that was a bit confusing at first.

    Now if I was any good with WPF or any web languages like JavaScript and HTML5, I could turn this into a Windows store app. And maybe I will lol... Just hope that no one else takes my idea, but it would be my own fault if I left it alone long enough.

    Enjoy :)
    ~Ace
     
    Ace, Feb 21, 2013
    #1
    Ian likes this.
    1. Advertisements

  2. Ace

    davehc

    Joined:
    Feb 2, 2010
    Messages:
    884
    Likes Received:
    152
    Location:
    Denmark
    There are one or two quite good ones already there.
     
    davehc, Feb 21, 2013
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.