There is a million and one ways of doing this,
All you got to do is create a grid, make it virtual, expand the columns/rows as needed.
Create file format, something easy like this:
C*******T*
A***B**A**
T****EX***
*****IE***
*******R**
now you have a grid, all you need to do is create
a little engine to read this in, replace all * with a random letter from the alphabet, keep all non * characters in their correct position in the grid.
Done.
That is one easy way of programming this ... there are more elegant ways, but why bother.