Page 1 of 1

Create a Kotlin program using double arrays which simulates the "Connect Four" game. You will have a user play against t

Posted: Mon Jun 06, 2022 4:37 pm
by answerhappygod
Create A Kotlin Program Using Double Arrays Which Simulates The Connect Four Game You Will Have A User Play Against T 1
Create A Kotlin Program Using Double Arrays Which Simulates The Connect Four Game You Will Have A User Play Against T 1 (76.45 KiB) Viewed 33 times
Create a Kotlin program using double arrays which simulates the "Connect Four" game. You will have a user play against the computer (like Rock Paper Scissors). The program should print out a "board" for the user to see on EVERY turn, by clearing the screen first and then printing the board and the "menu" for the user to select his turn. Playing will be done in the command console. The program should: prompt the user for their turn, • get the user's selection, (Column 1 through 8) place the piece in the double array, . reprint the screen, • Internally check to see if the user won and quit if they did with a "win" message Show the computer's turn • get the computer's selection, (random number for Column 1 through 8) • place the piece in the double array, reprint the screen • Internally check to see if the computer won and quit if they did with a "win" message • repeat The board should be an 8 x 8 board of playable positions. A piece can only go into one of 8 slots (columns). A piece must "slide" down to the last available space. It cannot "hang" in mid air. After each turn, you need to check to see if you or the computer has won with the last move. This means that there are 4 pieces in a row anywhere on the board: horizontally, vertically, or diagonally. Example Board: 12345 X Select a column to place your piece (X): Extra Credit: 20 pts: Make it "pretty" (connectfour_pretty.kt) using the extended ASCII character set like this: ¹|2|3|4|5| 7 Select a column to place your piece 20 pts: Make a separate Player vs. Player version (connectfour_pvp.kt) 20 pts: Make a separate Computer vs. Computer version (connectfour_cvc.kt) 14