SHARE
TWEET

Untitled

a guest Jan 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. generateMorse(time: any, phrase: string) {
  2.     phrase = phrase.toUpperCase();
  3.     this.morseDisplay = [];
  4.     for (const p of phrase) {
  5.       if (p === ' ') {
  6.         time += 3 * this.dot;
  7.       } else if (this.MORSE[p] !== undefined) {
  8.         time = this.createSound(time, this.MORSE[p]);
  9.         time += 2 * this.dot;
  10.       }
  11.  
  12.       const morseOuput = new MorseOutput();
  13.       morseOuput.morseText = p;
  14.       morseOuput.morseValue = this.MORSE[p];
  15.       this.morseDisplay.push(morseOuput);
  16.     }
  17.  
  18.     return time;
  19.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top