Results 1 to 5 of 5
Thread: TicTacToe
- 10-29-2007, 07:46 AM #1
Member
- Join Date
- Oct 2007
- Location
- AZ
- Posts
- 2
- Rep Power
- 0
TicTacToe
/*Can someone help me with this, I can't seem to find the error it keeps erring at Void. Thanks*/
Java Code:import java.util.*; public class TicTacToeJNR { public int currentTurn, entryCount, setupBoard; public int getMove, writeBoard; private static char [][] board = new char [3][3]; private static char currentTurn; } public static void main(String[] args) { setupBoard (); entryCount = O; currentTurn = X; for (entryCount = O; entryCount <9 entryCount ++) { getMove (); writeBoard(); if (currentTurn == 'X') currentTurn = 'O'; else currentTurn = 'X'; } System.out.println ("Game Over"); row = keyboard.nextInt (); col = keyboard.nextInt (); board [row-1][col-1] = currentTurn; public static void setupBoard () { int row; int col; for (row = O; row <3; row ++ { board [row] [col] = '+'); } private static void setupBoard() { int row; int col; for (col = O; col <3; col ++) { board [row][col] = '+'; } } }Last edited by JavaBean; 10-29-2007 at 07:51 AM. Reason: Code placed inside [code] tag.
- 10-29-2007, 07:52 AM #2
Hi,
Next time please place your code inside [code] tag.
Can you write the exact error message?
- 10-29-2007, 07:59 AM #3
Member
- Join Date
- Oct 2007
- Location
- AZ
- Posts
- 2
- Rep Power
- 0
- 10-29-2007, 08:21 AM #4
Check curly bracket after your variable declaration above. It closes your class! You should remove that.Java Code:private static char currentTurn; }
- 11-25-2007, 06:47 PM #5
Member
- Join Date
- Nov 2007
- Posts
- 1
- Rep Power
- 0
hi every one
i wanna to ask question about this applications
i wanna to do things like system calls in linux or win32 api
exactly what is needed that i wanna to make application that will create shared memory in memory then using semaphors or any thing like it any one can access this semaphor and only is who updating in shared memory
any thing like this is found in java or not ?
and if yes or can be implemented can i run game like this game and then can run no of it then these application will play with each other no any interrupt from the user
i wanna to implement scenario like this
i know this can be easily using system calls over linux but iam suffering in java
can any one help me .............. :( ?
thanks very much
Similar Threads
-
TicTacToe
By Thomas Covington in forum New To JavaReplies: 1Last Post: 04-10-2008, 04:51 AM -
TicTacToe Game
By Ebtihal in forum New To JavaReplies: 0Last Post: 01-09-2008, 11:01 AM -
disabling JButtons after win in TicTacToe
By noisepoet in forum New To JavaReplies: 1Last Post: 05-18-2007, 11:01 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks