| posted: 5/20/09 | |
| Cell Phone App - Java Midlet - Game Demo. | |
|
Remember the game MasterMind. One player would hide a four peg pattern, each peg a different color, and the other player would guess the pattern (probably not sold anymore because the little pegs could be swallowed). Here four random numbers are generated, 0-9, and the player guesses the numbers in the correct sequence. The player makes a guess by picking four numbers. The game responds with dots and dashes showing the number of correct matches. A black dot indicates a right number in the correct sequence, a white dot is a right number, but in the wrong sequence, and a dash indicate none of the numbers match, black for none of the numbers in sequence and a white dash for no right numbers. A wonderful game to numb the mind for a few minutes. |
|
| Download by setting your cell phone browser to: | |
| ProgramsPlus.us/code/Java/J2ME/s/Sequence/Sequence.html
or ProgramsPlus.us/code/Java/J2ME/s/Sequence/Sequence.wml |
|
|
If your cell phone is Java enabled it will download the game automatically (asking your permission). The file is approximately 8k. Let me know how it works.
|
|
|
The challenge here is to design an app that fits as many displays as possible. With the proliferation of devices, software design considerations take on a new dimension, often display, sometimes memory, and other times communication protocol. Some new and dynamic programming styles are developing. Do you have any ideas?
|
|
|
|
|
Here everything is expressed in display units. Nothing fancy but a mathematical puzzle in itself. One cell phone might have a display that's 100 pixels wide and another 200 so it's a matter of converting Cartesian coordinates to generic display units rather than integers. The square units in the Sequence display that show numbers are also used to translate font metrics. A font style that might work on one display but may not work on another. Fortunately Java in it's design perfection provided the getWidth and getHeight functions that can easily be calculated into the display units and font functions that can call device fonts. It's all fundamental now, but as devices improve and expectations increase, routines will have to be developed that can accommodate more and more flexibility. The economics often fall short so an exchange of ideas is an advantage.
|
|