Keep in mind that this is a programming blog. Where things may be unclear to the average layperson, I have tried to insert reasonable explanations, but my clarity is not guaranteed. I recommend having at least a basic understand of computer programming before you read this blog.
With no further ado, let me introduce to you Project 1: The Sliding Word Puzzle
It is dark. Before you is a grid of tiles bearing assorted letters. Both the rows and columns of the letter grid slide back and forth easily, almost as if this were a Flash game ignoring the problem of friction completely. The purpose becomes clear: you must slide the rows and columns to form words either vertically or horizontally. And so, your task begins.
The idea for this seemed so simple that I actually spent about an hour Googling to make sure no one else had made this game already. So far it looks like no, but please tell me if this already exists.
Problems I anticipate:
- Storing the lexicon in a format that a.) is easily readable by Flash and b.) won't take up too much space. XML seems like the easiest format since Actionscript already has classes and methods for processing that.
- The whole sliding thing. You can click and drag a mouse in any direction, but the tiles can only move up and down or left and right. How do I program this so that the tiles know which way they're going and don't move all weird?
- Checking whether a word is valid without putting undue strain on the processor. Checking a lexicon of several thousand words one by one is going to take a lot of time and effort. Perhaps I could devise a way to check only words that start with the appropriate letter? Or... wait... perhaps I could form a trie of letters that when read from root to end spell out all the words in the lexicon! Yes, I think I will go with the trie option. Mostly because I've already written Java code for doing that that I can convert to Actionscript relatively easily.
No comments:
Post a Comment