Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MorseCode Translation: decoding incorrectly

 
Ciaran Mooney
Ranch Hand
Posts: 74
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
My code is encoding a message in english to morsecode fine with a multithread server app, the encoded morseCode is then sent onto a client but the cleint is not decoding correct.
If I send 'Hello' to server it reruns ' …. . .-.. .-.. —' which appears right.
When …. . .-.. .-.. — is sent to client 'L I' is returned...
Have spent a while playing with his and searching around the web but i suspect its the way i am using the Stringtokeinizer, can't follow how it breaks the more code down into tokens..

English to MorseCode code:

Any input appreciated my head is melted!



morseCode to English Code:
 
Ciaran Mooney
Ranch Hand
Posts: 74
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got ish,
1. Stupidly the encoding english to morsecode string arrays did'nt match the morsecode to english array but now they do,
2. Had to use a string split with 3 space reg expression (" ") to seperate each morse code word as below
Crazy bananas

 
Maneesh Godbole
Saloon Keeper
Posts: 11070
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done on figuring out the problem yourself
This question is not exactly applet related. I will move it to a more appropriate forum for you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic