This code saves so much space and really makes sense but System.out.println("Tie!"); doesnt work, it doesnt outprint the actual word "Tie", may be i put it in the place where its not supposed to be, but i think i should be in the last Public Static...
Im sorry for such dumb things, but i really appreciate your help
Thank You :)

Isn't a tie the situation when the board is full but has no winner lines ? :confused:

Anyway rupa, you said my solution was too complicated, and I agree that it may be so if you need to resort GUI-less and (nearly) sequantial programming (non-oop) methods.

My method is a combination of oop/tabledriven programming and a GUI. The whole game is controlled by the winLine matrix and the fact that player1 & 2 are awarded different scores for the placements (1 & 4).

As a java program, its not complicated at all, but hey, its your game.

01-22-2006, 08:35 AM

destin

Quote:

Originally Posted by sjalle

Isn't a tie the situation when the board is full but has no winner lines ? :confused:

Well, if turn == 9, the board is full, and if winner().equals(EMPTY), then there's no winner.

01-22-2006, 05:15 PM

sjalle

Yes, but...

...I will still argue that my tabledriven approach is more 'generic'; if I wanted to make a bigger gameboard and more complicated win patterns, and allow more players, I would only have to plot in these patterns into the win matrix and allocated a wider spectre of awards (so that no player sum could be equal).

As for problem analysis, my solution has dealt with the general concept of a game where players place dices in turn, and the object it to get some pattern first. Expanding the games complexity craves no programming effort and if it is supplied with a GUI for plotting in the win matrix, the player can make his 'own' game. And thats rather cool.