Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Android and the fly likes Tic Tac Toe - Checking for a winner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Tic Tac Toe - Checking for a winner" Watch "Tic Tac Toe - Checking for a winner" New topic

Tic Tac Toe - Checking for a winner

Frederik Bolding

Joined: Jul 22, 2012
Posts: 5

I am currently developing a little Tic Tac Toe game in Java (For Android)
And i am stuck, i want to "CheckForWinner();" but i can't really figure out how...

I am thinking something like: "foreach(Field in Fields)" and then check which has value of 1 and which has a value of 2 :-)

Full game sourcecode:

Pastebin: Clicky

Thanks in advance!

- Frederik
I agree. Here's the link:
subject: Tic Tac Toe - Checking for a winner
Similar Threads
Android CustomListView getView() getting nullpointerexception
How to start new activity when click on a listview and pause the process that is being in background
android gridview with fling + flipper
Check if an application is installed
street view & satilite view is not working