[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Assistance with writing a tic tac toe program!  XML
Forum Index » GUI Development
Author Message
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

I'm new to java; I'm in my second Java collegiate course, and have to say am barely treading water. I have a project to create tic tac toe without a gui. Can anyone point me in the right direction of where to get some leads. Thanks!
tfecw

Newbie

Joined: 09/19/2005 15:02:20
Messages: 144
Location: No. VA.
Offline

Sure,

check out the tutorials at http://java.sun.com/docs/books/tutorial/index.html There are a ton of them. Let us know if you need any help along the way. Good luck
aim icon
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

This is my potential Tic Tac Program without GUI; written in pseudo/java. If anyone could assist me with this I would greatly appreciate it!



 Filename NJohnsonP5Main.java [Disk] Download
 Description Here is my actual program in JGrasp
 Filesize 3 Kbytes
 Downloaded:  791 time(s)

This message was edited 4 times. Last update was at 02/20/2006 14:45:07

destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

Looks good to me.

PS. Next time when posting make sure to use the [code][/code] tags. It makes it much easier to read. Thanks!
[Email]
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

Thanks Destin, but I was looking for some assitance in writing the actual code where I have pseudocode.

I've also submitted my .java in the previous message.

This message was edited 1 time. Last update was at 02/20/2006 14:31:01

destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

Ah, sorry . Well, what have you tried?

First of all, you'll need a board.

I would recommend making final chars to represent what is in each sqaure.

Then, you need to initialize the board.

Then, to check the winner, this gets a bit tedious.


Hope this helps a little. Post back if you're still having trouble.

This message was edited 6 times. Last update was at 03/11/2006 07:16:33

[Email]
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

So, I'm adding another array for another board. Add this to the board I have already?

And also, I know this might seem extra tedious, but my professor is anal, and he wants us to use his methods, so is there anyway you could alter the win method into my already won method?

I can't have a gui as well. He wants to see a old style tic tac toe bracket like

| |
----|----|----
----|----|----
| |


Thanks a bunch!

This message was edited 4 times. Last update was at 02/20/2006 15:11:41

destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

WannaBe wrote:So, I'm adding another array for another board. Add this to the board I have already?

No, you only need one board. I'm just confused as to why you initialize your board with 5 by 5.
WannaBe wrote:
And also, I know this might seem extra tedious, but my professor is anal, and he wants us to use his methods, so is there anyway you could alter the win method into my already won method?

Why don't you give it a shot?
[Email]
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

I believe it has to do with a manual tic tac toe screen as opposed to GUI.

01234
-----
0 |
1 |
2 |
3 |
4 |
destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

WannaBe wrote:I believe it has to do with a manual tic tac toe screen as opposed to GUI.

01234
-----
0 |
1 |
2 |
3 |
4 |

I understand that there's no GUI. I just pictured it like this:

[Email]
WannaBe

Newbie

Joined: 02/20/2006 09:17:19
Messages: 11
Offline

Would you know how to convert my public void play() method into actual java code?

This message was edited 1 time. Last update was at 02/20/2006 15:23:01

destin

Newbie
[Avatar]
Joined: 01/07/2006 19:13:04
Messages: 224
Offline

Again, try it first, then ask for help. No one will not do it for you; we will only point you in the right direction.

So try it, if you're having problems, tell us exactly what you're having trouble with, what you don't understand.

Good luck!

This message was edited 1 time. Last update was at 02/20/2006 15:30:30

[Email]
frozenmonkey

Newbie

Joined: 06/30/2011 11:39:50
Messages: 1
Offline

Found this for you, it might help. But i suggest you to try it on your own. Just take this a reference.




Source: http://www.mycoding.net/2011/06/tic-tac-toe-in-java/


C++ and Java for beginners: www.mycoding.net
[WWW]
 
Forum Index » GUI Development
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle