Lan Tic Tac Toe Ware

Now you can play Tic Tac Toe on your Android Device. Its a very light weighted multiplayer game which supports different modes of play.

Feb 06, 2014  MultiPlayer TicTacToe By Ahmad45123 (FOR BEST SCREEN RUN HD) Please Rate And Subscribe NOTE: I DIDN'T TEST THIS WITH THE EXTERNAL IP Download: http://www.mediafire. Ultimate Tic-Tac-Toe has a 3x3 grid of regular tic-tac-toe games. We’ll call this the master board and each small game a tile. X moves first and can go into any of the tile in the grid. Shop Target for Lawn Games you will love at great low prices. Spend $35+ or use your REDcard & get free 2-day shipping on most items or same-day pick-up in. Skip to main content skip to footer.

Suitable for all grades, TIc Tac Toe Squares asks questions before placing an X on the square. Get 3 X's in a row to win. Play Tic Tac Toe Squares online, here. Tic Tac Toe at Cool Math Games: Play the classic game of X's and O's vs. The computer or 2 player. Or try to get four in a row on our super-sized 5x5 grid. Tic-Tac-Toe as Hollywood Squares: Tic-Tac-Toe and Hollywood Squares have essentially the same game objective: get three squares in a row by answering a question correctly.

Tic
1) Single Player.
2) Two Player.
3) Multiplayer Game. (WiFi or Bluetooth)
4) Online Game
-> Play with friends or strangers over internet.
You can play against computer or a human. Tic Tac Toe LAN supports multiplayer mode. You can host a game on your network. Your friends can discover your game and connect with your device to play against you. To play in LAN Game mode, your devices should be in same WiFi network. If you don't have WiFi AP, then you can connect your devices via WiFi-Tethering. You can play multiplayer game with the help of Bluetooth also.Permalink

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up
Find file Copy path
0 contributors

Palco Mp3 Mc Lan Tic Tac

importjava.awt.Color;
importjava.awt.GridLayout;
importjava.awt.event.MouseAdapter;
importjava.awt.event.MouseEvent;
importjava.io.BufferedReader;
importjava.io.InputStreamReader;
importjava.io.PrintWriter;
importjava.net.Socket;
importjavax.swing.Icon;
importjavax.swing.ImageIcon;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JOptionPane;
importjavax.swing.JPanel;
publicclassTicTacToeClient {
privateJFrame frame =newJFrame('Tic Tac Toe');
privateJLabel messageLabel =newJLabel('');
privateImageIcon icon;
privateImageIcon opponentIcon;
privateSquare[] board =newSquare[9];
privateSquare currentSquare;
privatestaticintPORT=8901;
privateSocket socket;
privateBufferedReader in;
privatePrintWriter out;
// Constructs the client by connecting to a server, laying out the GUI and registering GUI listeners.
publicTicTacToeClient(StringserverAddress) throwsException {
// Setup networking
socket =newSocket(serverAddress, PORT);
in =newBufferedReader(newInputStreamReader(
socket.getInputStream()));
out =newPrintWriter(socket.getOutputStream(), true);
// Layout GUI
messageLabel.setBackground(Color.lightGray);
frame.getContentPane().add(messageLabel, 'South');
JPanel boardPanel =newJPanel();
boardPanel.setBackground(Color.black);
boardPanel.setLayout(newGridLayout(3, 3, 2, 2));
for (int i =0; i < board.length; i++) {
finalint j = i;
board[i] =newSquare();
board[i].addMouseListener(newMouseAdapter() {
publicvoidmousePressed(MouseEvente) {
currentSquare = board[j];
out.println('MOVE '+ j);}});
boardPanel.add(board[i]);
}
frame.getContentPane().add(boardPanel, 'Center');
}
//* The main thread of the client will listen for messages from the server.
//The first message will be a 'WELCOME' message in which we receive our mark.
//Then we go into a loop listening for:
//--> 'VALID_MOVE', --> 'OPPONENT_MOVED', --> 'VICTORY', --> 'DEFEAT', --> 'TIE', --> 'OPPONENT_QUIT, --> 'MESSAGE' messages, and handling each message appropriately.
//The 'VICTORY','DEFEAT' and 'TIE' ask the user whether or not to play another game.
//If the answer is no, the loop is exited and the server is sent a 'QUIT' message. If an OPPONENT_QUIT message is recevied then the loop will exit and the server will be sent a 'QUIT' message also.
publicvoidplay() throwsException {
String response;
try {
response = in.readLine();
if (response.startsWith('WELCOME')) {
char mark = response.charAt(8);
icon =newImageIcon(mark 'X'?'x.gif':'o.gif');
opponentIcon =newImageIcon(mark 'X'?'o.gif':'x.gif');
frame.setTitle('Tic Tac Toe - Player '+ mark);
}
while (true) {
response = in.readLine();
if (response.startsWith('VALID_MOVE')) {
messageLabel.setText('Valid move, please wait');
currentSquare.setIcon(icon);
currentSquare.repaint();
} elseif (response.startsWith('OPPONENT_MOVED')) {
int loc =Integer.parseInt(response.substring(15));
board[loc].setIcon(opponentIcon);
board[loc].repaint();
messageLabel.setText('Opponent moved, your turn');
} elseif (response.startsWith('VICTORY')) {
messageLabel.setText('You win');
break;
} elseif (response.startsWith('DEFEAT')) {
messageLabel.setText('You lose');
break;
} elseif (response.startsWith('TIE')) {
messageLabel.setText('You tied');
break;
} elseif (response.startsWith('MESSAGE')) {
messageLabel.setText(response.substring(8));
}
}
out.println('QUIT');
}
finally {
socket.close();
}
}
privatebooleanwantsToPlayAgain() {
int response =JOptionPane.showConfirmDialog(frame,
'Want to play again?',
'Tic Tac Toe is Fun Fun Fun',
JOptionPane.YES_NO_OPTION);
frame.dispose();
return response JOptionPane.YES_OPTION;
}
//Graphical square in the client window.
staticclassSquareextendsJPanel {
JLabel label =newJLabel((Icon)null);
publicSquare() {
setBackground(Color.white);
add(label);
}
publicvoidsetIcon(Iconicon) {
label.setIcon(icon);
}
}
//main
publicstaticvoidmain(String[] args) throwsException {
while (true) {
String serverAddress = (args.length 0) ?'localhost': args[1];
TicTacToeClient client =newTicTacToeClient(serverAddress);
client.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
client.frame.setSize(240, 160);
client.frame.setVisible(true);
client.frame.setResizable(false);
client.play();
if (!client.wantsToPlayAgain()) {
break;
}
}
}
}
Toe

Tic Tac Toe Online Game

  • Copy lines
  • Copy permalink