Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-29-2007, 09:46 AM
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-29-2007, 09:52 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Hi,

Next time please place your code inside [code] tag.

Can you write the exact error message?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-29-2007, 09:59 AM
Member
 
Join Date: Oct 2007
Location: AZ
Posts: 2
Joe3161 is on a distinguished road
Send a message via AIM to Joe3161
Quote:
Originally Posted by JavaBean View Post
Hi,

Next time please place your code inside [code] tag.

Can you write the exact error message?
Sorry, I am new to this.

java:13 'class or 'interface' expected
public static void main(String[] args)
^
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-29-2007, 10:21 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Code:
private static char currentTurn; }
Check curly bracket after your variable declaration above. It closes your class! You should remove that.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-25-2007, 08:47 PM
Member
 
Join Date: Nov 2007
Posts: 1
abdo_elrahman is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TicTacToe Thomas Covington New To Java 1 04-10-2008 06:51 AM
TicTacToe Game Ebtihal New To Java 0 01-09-2008 01:01 PM
disabling JButtons after win in TicTacToe noisepoet New To Java 1 05-19-2007 01:01 AM


All times are GMT +3. The time now is 11:29 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org