The exclamation point belongs in the title. It's that exciting a game!
Anyhow, it requires the .NET Framework, available at Windows Update.
Here is a screenshot:
Tic Tac Toe!
Edit: Updated! Now there are difficulty levels!
The exclamation point belongs in the title. It's that exciting a game!
Anyhow, it requires the .NET Framework, available at Windows Update.
Here is a screenshot:
Tic Tac Toe!
Edit: Updated! Now there are difficulty levels!
Can you provide a more solid link to the ".NET Framework?" I can't seem to find it. (Tried earlier, .. couldn't find it then either.) Thanks man. I can't wait to try your creation. :highfive: Many socks may it rock.
Britannianhero4 wrote:Can you provide a more solid link to the ".NET Framework?" I can't seem to find it. (Tried earlier, .. couldn't find it then either.) Thanks man. I can't wait to try your creation. :highfive: Many socks may it rock.
Something I've found works well for difficulty with simplistic games: the AI can either pick the best move, or pick randomly. It decides between these 2 with some set probability. Changing this probability changes the difficulty of the game (0% best choice = very easy, 100% best choice = very hard).
This is how I implemented AI levels in Mancala for my CS10 class, and it worked very well. In that case, the 'best move' was found by looking just 2 ply ahead, which didn't guarantee the best move, but it still tended to pick very good moves on the high difficulty.
Cloral wrote:Something I've found works well for difficulty with simplistic games: the AI can either pick the best move, or pick randomly. It decides between these 2 with some set probability. Changing this probability changes the difficulty of the game (0% best choice = very easy, 100% best choice = very hard).This is how I implemented AI levels in Mancala for my CS10 class, and it worked very well. In that case, the 'best move' was found by looking just 2 ply ahead, which didn't guarantee the best move, but it still tended to pick very good moves on the high difficulty.
The other thing I want to do is make it so you can drag the window around using a MouseDown event on the label, but I can't seem to find any articles on how that would be done (I guess you're just supposed to use the default windows interface, bah).
Damn you keep on turning out neat little programs. I want to learn programming, but since I am kind of in college to do so, I don't want to learn things that I have to unlearn. Right now I am just programming little Matlab programs for class.
Well I've never done dragging like that, but it seems that what you might want to do is when you get the mouse down, record where the mouse is. Then whenever the mouse moves, figure out where it moved in relation to where it was at the last check and move the window that much. I.e. if it was at (5, 7), and now it is at (3, 10), the difference is (-2, 3), so that's how much you'd want to move.
I'm not totally sure how you handle the mouse moving outside of the window though...
Cloral wrote:Well I've never done dragging like that, but it seems that what you might want to do is when you get the mouse down, record where the mouse is. Then whenever the mouse moves, figure out where it moved in relation to where it was at the last check and move the window that much. I.e. if it was at (5, 7), and now it is at (3, 10), the difference is (-2, 3), so that's how much you'd want to move.Yeah, I just thought it would be neat, but it's probably more work than I'd be willing to do on this little program. :PI'm not totally sure how you handle the mouse moving outside of the window though...
But I did implement your difficulty level suggestion! There is now a difficulty selector. You can still beat it on hard though. 😊
Lutraphobiac wrote:Damn you keep on turning out neat little programs. I want to learn programming, but since I am kind of in college to do so, I don't want to learn things that I have to unlearn. Right now I am just programming little Matlab programs for class.
Matlab? Thanks for reminding me. I have three assignments with that due tommorow for an engineering class here at Wilkes. If you had a copy of that by chance on your computer, you should hook me up. I hate going to the lab to use it and I'm too poor to buy it.
I just installed it so I still have the installation files. Programs have a habit of "showing up" at dorm rooms for engineering students to use at their leisure.
I'm actually coding a "craps" game for an assignment for class. I can't wait until we move to C for the next half of the semester.
I'm thinking you need to open source it and share it, bro 😉
Actually, I'm just interested in the UI, I haven't done much with borderless forms. If you give me a while, I can post the code you would need to make the window draggable by its drawn caption bar.
So far the best the hard difficulty can do is tie me, it's too wily for my traps. I thought I was undefeatable if I had the first move, but apparently there are ways around my strategy.
I'll tell you the secret: Go in the bottom-right corner. The computer will take the center. Then go in the upper left. The computer may take one of the remaining two corners. If so, you're in luck. Take the final corner and you have two possible win moves, ensuring that the computer will only be able to block one of them. However, if the computer moves in a non-corner space after you take your 2nd corner, you're screwed.
Also, I guess I could post the source, but I didn't think anyone would care. I just made the form borderless by setting it's BorderStyle property to None, and then made labels and buttons for the title bar and control boxes, respectively.