Forums Register Login

Need Help for word game

+Pie Number of slices to send: Send
Hi All,
I am a student and learning j2me right now, I am working on a simple application wordgame in j2me but have some problem while filling up the matrix in starting.
Description of the program :
Program screen will have a 5*5 matrix devided into rows and columns. so it will contain 5 rows and 5 columns in each row at the screen and in this way we can show 25 characters in the cells on the screen.
Now i have words in an array, some words are of 5 characters and other have characters less then 5.
Now problem is how to fill this matrices with the words given in the array dynamically. Means i want everytime whenever the program will be run matrices will be filled by the characters (one character in each cell) and some words of the array will be hidden into this matrices.
User will have to search that words inside this matrices.
Now words may be filled
Horizontly, vertically, or diagonally.
Being a beginner i am not a good programmer and not able to make a perfact logic for the same.
I have created a logic but the code for that goes for around 150 lines and which creates the problem while running the whole application on real phone as for the further processing i also have to right a lot of code.
Is there anybody who can help me to do it by some simple logic.
Waiting for the reply
Regards,
Rohan
+Pie Number of slices to send: Send
Surprised !!
What happened no java guru is ready to help. I thought that somebody will be there in this forum who can help a beginner too.
Waiting for the reply....
Rohan
+Pie Number of slices to send: Send
Rohan,
Although you should have been raised the same question in bigginers section there you can get the right answer, But for now you can make a simple search on the word wordgame or crossword and you will get a lot of links where you can even find the whole source code for the same application but for the applets not for j2me and then porting it to j2me will not be a big matter for you.
For help i am giving a little code for writing a 4 char word into the matrix in a 5*5 matrix
int wchf=0;
int m=1,n=1;
for(int j=0;j<=m;j++)
{for(int k=0;k<=n;k++)
{for(int l=0;l<4;l++)
if(ch_val[j+l][k+l]==0 || str[i].charAt(l)==ch_arr[j+l][k+l])
wchf++;

if(wchf==4)
{
for(int l=0;l<4;l++)
{
ch_arr[j+l][k+l]=str[i].charAt(l);
ch_val[j+l][k+l]=1;
}
break;
}
wchf=0;

This is the part of code which i used in my application
Rishi}
Then YOU must do the pig's work! Read this tiny ad. READ IT!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1218 times.
Similar Threads
June Newsletter Puzzle
to read intgers into program
Matrix form of files and words
Failed to load byte array of an png image into an midp application
How to create Generic 2-dimensional array?
Please help me to understand dynamic programming
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 01:40:35.