Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / changing letters

Author
Message
hpfan273
17
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 13th May 2007 11:46
hi... i'm working on a morse code encoder thing... how would i change the letters to the morse code symbols?

this is my code:



if the person that wanted there word to say: sensor
how would i change it to this: ... . -. ... --- .-.

with the spaces inbetween... and i want it so that it works with any word they type in... also... if they decide that they want to type a full blown sentance... how would i replace the spaces in the sentence with a "space | space"?

thanx for your help... it's much appreciated

Why do they turn against me? Especially when i need them the most?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th May 2007 22:09
Create an array called something like Morse$ and dimension it to 26 (number of letters in the alphabet):

When the word is entered, loop through it getting the ASCII value of each character. Deduct 64 from this value to give you the array element which stores that letter's morse code.

Build up the word in morse and print it.

This should get you started:



TDK_Man

Login to post a reply

Server time is: 2024-04-26 04:35:28
Your offset time is: 2024-04-26 04:35:28