I made this game equivalent to tictactoe but with a slight twist called find the X between two players using socket programming with Java. Don’t know where I went wrong in trying to find the X but for some odd reason my count variable never updates allowing the victory message to never pop up.
Basically the game is as follows, the dealer starts by placing the X then the spotter has to guess where it is by placing the O. Still quite new to Java and socket programming, I followed a few Java socket programming examples which is what led me to the code as shown below:
The client and server uses the
.startsWith() function to fetch the necessary inputs for the corresponding areas. Thus, by using keywords such as “MOVE” alongside with
Integer.parseInt(variable.substring()) it is able to get the location on the board.
package com.findthex; import java.io.IOException;