Kotlin Plz.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Kotlin Plz.

Post by answerhappygod »

Kotlin Plz.
Kotlin Plz 1
Kotlin Plz 1 (76.45 KiB) Viewed 26 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply