✅ C# Word Game AI (where to start?)
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.
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.
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!
---
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
The maximum score achievable is 50 points.
2 Replies
just thinking loud:
i have a feeling there could be a optimal way of playing
if you count the usage of letters in all the words there will be some letters more often used than others. so they could be placed more strategically
also you could analyze what the most often used letters on each side of a letter are
which letters are usually in the start/end of a word
i guess you could take more into consideration to make the ai smarter
alternatively i guess you could create some decision tree/neural network and do some unsupervised training by letting two bots playing each other
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.