I have no idea how to even start this. please help
The Game
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ b _ _ _
_ _ _ q u _ _
_ w o r d _ _
It is played with the aid of a vertical grid with seven columns of six rows, arranged so that lettered tiles can be dropped from the top of any column, from where the tile will fall until it reaches the bottom row or the top of any tiles already in that column.[1]
Each player starts the game with a set of lettered tiles consisting of one of each letter of the alphabet plus a second copy of each of the five vowels: ‘e’, ‘a’, ‘i’, ‘o’, and ‘u’.
On their turn, a player drops a tile into the grid. They then score points for each new word they identify that was formed with the aid of that tile. Scoring is as follows:
3-letter words: 1 pt
4-letter words: 2 pts
5-letter words: 4 pts
6-letter words: 8 pts
7-letter words: 16 pts
Words can be formed horizontally, vertically, or on a diagonal, and may run in either direction, but must lie entirely in a straight line.
b
q u
w o r d s
For example, if a player were to drop the ‘s’ into the 6th column of the board shown earlier, the result would be as shown to the right. That player could score for the words “words” (4 pts), “bus” (1 pt), and “sub” (1 pt) for a total of 6 points.
The game ends when the grid is full. Both players will have letter tiles remaining unplayed.
2. The Computer Player
You will be implementing the software to manage a game in progress and to take the part of the one player.
A perfect game player is beyond the scope of this course, so you will instead implement an aggressive strategy as follows:
Consider the tiles you have left to be played. Look at what kind of score you could earn by dropping each tile into each of the 7 possible columns. Select the play that earns the highest possible score on that turn.
If there are two or more possible plays that would tie for the highest score, give preference to plays that involve a consonant rather than a vowel. (Because these will likely offer fewer opportunities for your opponent to make a counter play.)
If there are still two or more plays tied for the preferred play, give preference to plays where your dropped tile touches at least one existing tile, horizontally or vertically.
If there are still two or more plays tied for the preferred play, give preference to the play involving the earlier letter in alphabetic order.
If there are still two or more plays tied for the preferred play, give preference to the play involving the column further to the left.
This is by no means a perfect player. It emphasizes immediate scoring over strategic considerations such as preserving “power letters” like ‘s’ that can be added to the end of other words, nor is there any attempt to “set up” long words for high scores in later turns.
In a real implementation of the game, we would probably replace the last two tie-breakers by a random selection from among the tied plays, as this would result in a player that was less predictable and therefore probably more fun to play against. But, for now, we will sacrifice randomness in favor of easier testing. It’s hard to test code that is allowed to make random choices.