I know, a couple of hours later it hit me like a brick why you did that, but by then the server went down so I couldn't edit it. Sorry! :oQuote:
Yes, but I messed it up on purpose to avoid spam.
Please don't post it.
I just sent you my entry.
Printable View
I know, a couple of hours later it hit me like a brick why you did that, but by then the server went down so I couldn't edit it. Sorry! :oQuote:
Yes, but I messed it up on purpose to avoid spam.
Please don't post it.
I just sent you my entry.
submitted last night.
I noticed the current game files dont check for a tie. They just force the player to move if the board is full, which is obviously an illegal move. This should be accounted for.
Also, how are you going to decide who goes first in the tournament?
My guess is you play twice against you opponant each having an opportunity to go first.
Just wanted to point out (I don't know if anyone else has) there should be some bounds checking. Running my code could possibly crash if there isn't.
For example in at():and in canMove():Code:if (x < 0 || x >= width || y < 0 || y >= height)
return ' ';
I assume that the files we were supplied with are not the complete versions that will be used for the competition, but you can't be too sure.Code:if (x < 0 || x >= width)
return false;
I've fixed the 'game engine' so it correctly checks for a tie.Quote:
Originally Posted by Perspective
I'll make each player play against each other two times, so each one can start once. The board dimensions will be slightly random, but not the number of pieces needed to win.
I've recived submissions from you three, I'll PM the others to check whether they'll submit or not. Either way, the tournament will begin soon.
>>I'll make each player play against each other two times, so each one can start once. The board dimensions will be slightly random, but not the number of pieces needed to win.<<
Ack, I didn't know the dimensions of the board would change, I thought it was going to stay the standard 7x6. A big chunk of my code is hard coded for this size board because getMove() was the only function to be called and I didn't want to recalculate every move. Looks like my entry will have to sit out anything that isn't 7x6.
mine as well is "optimized" to run at 7x6, though syntactially it should handle any size. Havent actually tried yet though :p
>>I'll make each player play against each other two times
so what happens in a 1:1 tie?
>>mine as well is "optimized" to run at 7x6, though syntactially it should handle any size.<<
Heh, not mine. Anything other than 7x6 and its crash and burn baby.
I'm very curious how ya'll approached this here program because I never even had even the slightest thought about taking into account the dimensions of the playing area... Hmm...
OK, the board will be 7x6. But the idea was to use Board::width and Board::height to make the program able to handle different boards. But since neither of you have taken this into account (although Perpective sent me a slightly updated version) I guess the contest will be better if the board stays 7x6.
A win = 2 pointsQuote:
so what happens in a 1:1 tie?
A tie = 1 point each
well, mine is totaly independant of board size. It more or less was in the first place i just changed some stored values to be calculated on the fly based on board dimensions. But a fixed size is cool by me.
>>A win = 2 points
>>A tie = 1 point each
yeah, what i meant was what happens if one game is one by each player ( a score of 2 to 2). If you simply try to play the AI's against each other again your likely to just see the same games repeat themselves (unless one of them use a stochastic algorithm)
If only 3 of us submit i can submit my "FooBot" as well just for the sake of having competitors in the tournament. Its a slightly better than random player that should get destroyed by most of our AI's. Maybe the other players have some test bots as well? Also, im sure Sang-drax has an AI for his game, maybe he can enter that in the tournament if we dont get a better turn out.
That was why I wanted to alter the board size a little between the games.Quote:
Originally Posted by Perspective
It will be a tournament and the program with most points at the end will be the winner.
The others aren't finished and it isn't that likely they will submit anything. I will start the first game soon, but I see no problem in adding another contestant later.
These are the preliminary rules:
Each player plays each other one twice and they begin the game once each.
Win = 2 points
Loss = 0 points
Tie = 1 point.
If a player earns any points with an average moving time of more than 1 second, ½ point will be removed for each ½ second above 1 second.
The player with the most points at the end of the tournament wins.
EDIT: http://cboard.cprogramming.com/showt...286#post411286
The following changes had to be made to make your submissions compile:
LuckY
Had to change your for loops so that x is declared in each loop, not just the first, like the standard says.
PJYelton
The getMove function (and all other functions) take Board& instead of const Board&, which is unacceptable.
I had to do this:
Code:int getMove(const Board& cboard, char player)
{
Board board = cboard;
//Unchanged from here
Oops, I was going to change to const board once I relooked up the original post, but some reason I forgot.
If I have time this weekend I'll try to update my algorithm to account for different size boards. That way we can extend the tourney if we want to.