Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Morse code to english
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chalcids




PostPosted: Thu May 31, 2012 11:36 am   Post subject: Morse code to english

What is the best way to convert Morse code to English? I tried a for loop but i get the error of to many characters but it converts it well but i don't like the error. Any help?
Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: Thu May 31, 2012 11:48 am   Post subject: Re: Morse code to english

I'm not sure why you are getting an error for too many characters, you should be able to translate the Mores code letter by letter into English. (When I say a letter in Morse code, I mean a sequence of dots and dashes separated by a space equivalent to 3 dots)

Also, the use of a for loop is questionable unless you know in advance how long the message will be.
Amarylis




PostPosted: Thu May 31, 2012 2:53 pm   Post subject: RE:Morse code to english

I'm not entirely sure how morse code works, so my general suggestion would be:

Make a that converts 1 "morse string" into a letter
Define what the space between words would be (i.e. make it be a / or something)
run it on a conditional loop translating it character by character then adding the character into a string, or just displaying the characters themselves
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: