Skip to main content

Posts

Showing posts with the label Source Code

X-O game using JAVA

Here, you can find a basic java code to implement X-O game. Follow me @ facebook //*********************************Coded-By : SOMES KUMAR K.*******************************//   //*********************************LEARN CODE WITH FUN*************************************//     import java.util.Scanner; public class X_O_Game { int xi , xj ; static Scanner s = new Scanner(System. in ); char board [][]; public void make_board( int n){ if (n% 2 != 0 ){ setBoard(n); } else { System. out .println( "Enter valid Board Size" ); n = s .nextInt(); make_board(n); } } public void setBoard( int size) { board = new char [size][size]; for ( int i= 0 ;i<size;i++){ for ( int j= 0 ;j<size;j++){ board [i][j]= ' ' ; } } } boolean check_board_empty( int size){ boolean c= true ; ...