943,934 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 470
  • Java RSS
Nov 2nd, 2009
1

hangman on the phone problem Java

Expand Post »
I have a question about my java program.

I'm new to Java, but I learn fast.

I have the following problem.

I need to communicatie between 2 mobile phones. The entered character will be checked by methode checkletter. After completing the check, the frame will be set. The first 7 frames are for the sender. The next 7 frames are of the receiver. The 14th frame is an actionframe. From 15 and counting, the frames are for the letter that is entered.

The most important frame is 15. resulltString has an hexdecimal notation. If you entered "hello" as the play-word. If I search for the "l", it gives me this number 12.

12 means binair number like 01100. l is on the 3rd and 4th place.

The other player needs to open these slots.

That needs to happen within the if statement of method frameEvent().

That my problem. How do I get hex 12 to be a biniar number and also open the slots of the word. The null needs to get a dot. It has to be remembered for the next turn.

Java Syntax (Toggle Plain Text)
  1. public void checkletter(String letter)
  2. setFrameSender(getName());
  3. setFrameReceiver(Opponent);
  4. frame[14] = 'R';
  5.  
  6. copyStringToFrame(resultString, 15, resultString.length());
  7. sendFrame(frame);
Java Syntax (Toggle Plain Text)
  1. public void frameEvent(byte[] frame)
  2.  
  3. String sendername = new String(frame, 0, 7).trim();
  4. String recname = new String(frame, 7, 7).trim();
  5.  
  6. if (frame[14] == 'R')
  7. {
  8. ...........................................................
  9. ...........................................................
  10. ..........................................................
  11. }
Last edited by AccessFreak; Nov 2nd, 2009 at 6:25 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AccessFreak is offline Offline
1 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Flash .swf files in Java application
Next Thread in Java Forum Timeline: Anonymous class





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC