laurencetimms.blog.blog.blog

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

BizTalk-related Blogs

my website

Subscriptions

News


Will code for money.

Post Categories

Article Categories



Two knotty problems (one graphical, one lexical)

This is a word puzzle called a trackword. You have to find the 9-letter word hidden in the grid by tracking across each letter in turn up, down, across or diagonally. Can you figure it out? This one is fairly easy. Once you've figured out the trackword, see how many other words of 3 letters or more you can find using the same rules.

Anyway, I'm writing a component in C# that will generate a trackword grid from a dictionary, build a GIF of it and post it to my website each day. The component also has to work out all the possible words in the grid to allow users to check their solutions.

Problem 1) The grey background of the GIF always comes out in 16 colours or something. How can I get it to be high colour? I'm using this code to create it:

Bitmap newBitmap = new Bitmap(150,150,PixelFormat.Format64bppArgb);
Graphics g = Graphics.FromImage(newBitmap);
g.FillRectangle(new SolidBrush(Color.LightGray), new Rectangle(0,0,150,150));
// do some drawline and drawstring stuff
newBitmap.Save("trackword.gif", ImageFormat.Gif);

Problem 2) I've worked out an algorithm for scanning the grid and finding all the possible words in it, but it's not perfect. To be honest, it's all a bit Heath-Robinson. Does anyone know of any code libraries that do a similar kind of thing? I don't like re-inventing the wheel if I can avoid it.

Thanks all.

posted on Thursday, August 05, 2004 8:15 AM by laurencetimms





Powered by Dot Net Junkies, by Telligent Systems