Hello.
I'm looking for some help creating an AI for my game (see below for game rules)
Currently the game is written in C# as a console app and I have 2 human players capable of playing each other. The next step is to create an AI that is capable of playing against a human.
I'm ideally looking for pointers in the right direct to solve the problem. I have implemented a DAWG for the word dictionary which accepts an array of char, if an element in the array is a blank char it acts as a wild card for the DAWG.
My issue is I don't know how best to go about using that. At the moment, it's very random and I populate the grid columns with random words. It's not optimal and it's very easy to beat this “AI”.
Thanks in advance!
---
Rules
**Premise**
WordSquare is a 2-player turn-based word game played on two separate 5x5 square grids, one for each player. The objective of the game is to score the most points by forming valid English words with adjacent letters on the grid.
**Objective**
In WordSquare, the objective is to score the most points by forming valid English words with adjacent letters on each player's individual grid.
**Turns and Actions**
On the first turn, the first player chooses any letter and places it in any empty cell on their grid. The first turn consists of only this one action. For all other turns, each player takes two actions:
1. Place the letter chosen by the opponent on the previous turn in any empty cell on their grid.
2. Choose any letter and place it on their grid in any empty cell.
Players do not see their opponent's grid, and only learn the letter chosen by the opponent in the previous turn, but not its placement.
**Game End**
The game ends when both players' grids are completely filled.
**Scoring**
In WordSquare, points are awarded for each unique word formed by connecting adjacent letters horizontally or vertically on a player's grid. Points are based on the length of the word:
- 3-letter word: 3 points
- 4-letter word: 4 points
- 5-letter word: 5 points
Only words that are valid English words found in a pre-existing dictionary are eligible for points. The maximum score achievable is 50 points.