Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

Lawrence Buensalida

Ranch Hand
+ Follow
since May 18, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lawrence Buensalida

I need to create a function that can catch the keys pressed on the keypad so that I can get their letter equivalent, using GameCanvas. How do I make such function?
12 years ago
1. Can I use the method keyPressed() inside GameCanvas?
2. Won't there be any conflict with getKeyStates()?
12 years ago
My phone is a Nokia 3220
and here is my code:



12 years ago
I have an alert message and it doesn't show up on my phone, however, it does show up on my emulator. What could the possible problem be?
12 years ago
I was trying to code your suggestions...however, I still have to consider doubled letters.

ex:

guessedString = asdfgh
storedString = fwhrgfh
12 years ago
hmmm... ok, I'll try that. Thanks.
12 years ago
Guys, I really need help on this one.

I need code to check the characters of a 4 charactered string. Think of it as similar to Mastermind, only, it uses 4 letter words instead of colors. It needs to check if the letter is correct and if it's in the right place or not.

example:

str1 = "CLAD" //this the word that the program thought of
str2 = "AAAA" //this is the word that the player entered

I've already transfered them to an array. From there, I compared the letter of both strings with the same index to check if the letter guessed by the player in index[0] is equal to the thought word in index[0] (I hope you understand). If they are, then they are the "Correct Letter at the Right Place", right?

In this example the "Correct Letter in the Right place" is the letter in index[2] of both strings.

Now, here's my problem, I can't seem to create the next kind of checking wherein it needs to check the remaining characters against the thought word, excluding the index that were already checked in the first checking (In this example, index[2]).

example2:

str1="PINK" //thought word
str2="KNNP" //guessed word by the player

in this example, the index that is checked correct in the right place is the character in index[2]. Using the second kind of checking, it should check the remaining 3 indexes. It still has to consider duplicates, though.

Please please please, this problem is really bugging me.
12 years ago
YES!!! wooosh...there goes confusion.



I got it!

I didn't understood it before this example because the "get it" function of my brain is slow...but now I got the right explanation.

Thanks Shawn
12 years ago
lex,

was the string "abc" compared to "Come with France" for that matter? In which case, "c" was the reason why the result is 3, is that it?
12 years ago
Guys, question...

I don't know the use of the String method compareTo(String anotherstring).
What's the simplest explanation for this method and how do I use this, I find the j2me explanation hard to understand.

Thanks.
12 years ago
Thanks for suggesting the standard, I'll do that.

One more thing, what is the difference between what I did with my checking variable (being a Boolean something) and the one that you want me to practice?

12 years ago
Oh, I'm sorry. Here are my variable declarations:

public int GbLeft; // this value is 108;
public int GbTop; // this value is 96;
public int perSpace; // this initial value for this is 1

public Boolean checking; // Relevant indicator for assignResult to be performed
public Image[] resultImage = new Image[4]; // array to hold an image
public int RIctr; // counter for Result Image
public int TRctr;



some codes here




Mark, What I have here is a revised version of my code. I changed displayResult to assignResult wherein I assigned every image there inside the array. I called the repaint() so that every image is displayed.

The images were displayed, however, we have a new problem. After displaying the images inside the resultimage array, I received this error:



I think I have a problem with my repainting, don't you think so?


P.S.

Thanks for editing my displayed code (again). I hope I got it this time.
12 years ago
So, if you want to call the paint(Graphics g) you use the repaint(), right?

Another...I have a problem with this:



Some codes here



* This should display an image. 2 images of correcthalf.png and correctall.png in different x positions.
* The x value changes because of the variable TRctr.

However, when I run the midlet, it only displays 1 image. It only displays the last correctall.png image without the other images.

Why is this so?

Help me. Please?
[ July 26, 2005: Message edited by: Mark Spritzler ]
12 years ago
excuse me, can someone please enlighten me...
What is the difference between repaint() and calling paint(g)?
12 years ago