Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

MorseCode Translation: decoding incorrectly

 
Ranch Hand
Posts: 74
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic