Thread: TicTacToe
View Single Post
  #1 (permalink)  
Old 10-29-2007, 09:46 AM
Joe3161 Joe3161 is offline
Member
 
Join Date: Oct 2007
Location: AZ
Posts: 2
Joe3161 is on a distinguished road
Send a message via AIM to Joe3161
TicTacToe
/*Can someone help me with this, I can't seem to find the error it keeps erring at Void. Thanks*/


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 09:51 AM. Reason: Code placed inside [code] tag.
Reply With Quote
Sponsored Links