Choosing design method for ladder-like word game.

Posted by owca on Stack Overflow See other posts from Stack Overflow or by owca
Published on 2010-05-16T14:54:20Z Indexed on 2010/05/16 15:00 UTC
Read the original article Hit count: 226

Filed under:
|
|
|

I'm trying to build a simple application, with the finished program looking like this :

ladder-like game

I will also have to implement two different GUI layouts for this. Now I'm trying to figure out the best method to perform this task. My professor told me to introduce Element class with 4 states :
- empty
- invisible (used in GridLayout)
- first letter
- other letter

I've thought about following solutions (by List I mean any sort of Collection) :
1. Element is a single letter, and each line is Element[]. Game class will be array of arrays Element[]. I guess that's the dumbest way, and the validation might be troublesome.
2. Like previously but Line is a List of Element. Game is an array of Lines.
3. Like previously but Game is a List of Lines.

Which one should I choose ? Or maybe do you have better ideas ? What collection would be best if to use one ?

© Stack Overflow or respective owner

Related posts about java

Related posts about collections