#checks rows for a win, by comparing if the elements in the row are the same #Checks if the game is over by checking for a win or tie: Print(" | " + gameboard + " | " + gameboard + " | " + gameboard + " | ") Print("These are their markers:", marker) Print("These are the players:", player_list) Name2 = input("Fill in the name of player 2: ") Name1 = input("Fill in the name of player 1: ") Here's the full code print ("*** Welcome to Tic Tac Teen ***") Meaning I can't do a check to see if there are no empty spots left The spots in the tic tac toe board have to be numbers from 1-9 so I can't replace them with empty spaces. You can still see I have some attempts left over. public class MainActivity extends AppCompatActivity : : length=8 index=8Īt (ActivityThread.java:2665)Īt (ActivityThread.java:2726)Īt .-wrap12(ActivityThread.java)Īt $H.handleMessage(ActivityThread.java:1477)Īt android.os.Handler.dispatchMessage(Handler.java:102)Īt android.os.Looper.loop(Looper.java:154)Īt (ActivityThread.java:6119)Īt .invoke(Native Method)Īt .ZygoteInit$n(ZygoteInit.java:886)Īt .ZygoteInit.main(ZygoteInit.java:776)Ĭaused by: : length=8 index=8Īt .onCreate(MainActivity.java:28)Īt (Activity.java:6679)Īt (Instrumentation.java:1118)Īt (ActivityThread.java:2618)Īt .ZygoteInit.main(ZygoteInit.For a school assignment I need to make tic tac toe, I've got pretty much everything ready, except for 1 issue, I don't know how to make the game know when it's a draw and then quit Here I just click one button and it becoming X, and when I have 3 X in a line there comes a Toast displaying "Game over".
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |