BattleShip Inspired game
First script
First script



This script controls the functionality of the game. It adds all of the buttons in the game into a list called buttonList and it loops through that list. The first time you click on a button in buttonList it will add it to the playerShips list indicating where the user choose to place their ships. Once playerList reaches 3 ships then the computer will generate three random buttons from buttonList and store it in computerShips. Now, the game will begin and it will prompt you to start guessing where the opponent ship is. After every user guess, it will invoke the computerGuess function and the computer will generate a random button from buttonList and compare it with playerList to see if there is a hit. Same with the user guess. It will take the user's guess and compare it with computerShips to see if there is a hit. If there is a hit then the button will turn red and that button will be removed from computerShips list. Once playerShips or computerList reaches 0 then that signifies that all the ships have been hit and there is a winner.
Second script

This second script controls moving from scene to scene.