Getting My Text-Based Display to Not Repeat
Hi Guys, i am working on a text-based version of tic tac toe for learning purposes. I'e made it a double array that displays 9 pieces in a grid like this. To keep the display simple, I chose to create a an array to display as a table. how do i get it to update each piece without the entire board repeatedly being displayed. This is the original display 1 2 3 4 5 6 7 8 9 Each user picks a number and the board updates. the only problem is that every time the board is updated to an X or an O in the selected numeral, the entire board is duplicated. the whole board is duplicated like this: Original 1 2 3 4 5 6 7 8 9 Player One Makes a Moe 1 X 3 4 5 6 7 8 9 I was hoping to create a text-based game without using java libraries like AWT, but any suggestions would be very helpful. I'm stuck. Thank you My Code: public void playGame() { disPlay(); while(won=='L') { turns(); disPlay(); if(turnsCompleted>4) {checkRow_Column_Diagonal_For_Match();} if(turnsCompleted==9&&NoMatchesFound==8) {won='l';} } input.close(); winner(); } public void sampleDisplay() { int count=0; for(row=0;row<3;row++) { for(col=0;col<3;col++) { if(count==selection.length) {break;} display[row][col]=selection[count]; System.out.print(display[row][col]+" "); count++; } System.out.println(); }