Guest User

Untitled

a guest
Jan 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment