%%HP:T(3)F(.);
@ MRS, a tiny Morse Code program by Joe Horn
\<< RCLF SWAP BIN 1 OVER SIZE @ save user's binary mode
  FOR n DUP n DUP SUB
    "-ETIANMSURWDKGOHVF-L-PJBXCYZQ" SWAP POS R\->B \->STR @ position -> binary
    DUP SIZE 1 - 4 SWAP SUB 1 OVER SIZE @ convert binary number to morse code
    FOR b DUP b DUP SUB @ loop through morse code string
      CASE DUP "1" SAME @ dah?
        THEN 880 .3 BEEP @ dah
        END DUP "0" SAME @ dit?
        THEN 880 .1 BEEP @ dit
        END .4 WAIT @ pause between dits & dahs
      END DROP
    NEXT DROP .2 WAIT @ pause between letters (added to previous pause)
  NEXT DROP STOF @ restore user's binary mode
\>>
