Skip to main content
data compress
Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 184184 120 bytes

Inspired by Joey's answer.

for($d='0;?3,>5:.H7<1/9@E42-split'14 4111 4141 411 6B8CG='[$args[0][0]-65]-42;$d-1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_"200*($d%2*3+1))
$d=$d-shr1
sleep -m 70}

Test script:

$f = {

for($d='0;?3,>5:.H7<1/9@E42-split'14 4111 4141 411 6B8CG='[$args[0][0]-65]-42;$d-1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_"200*(($d%2)*3+1))
$d=$d-shr1
sleep -m 70}

}

&$f "A"
sleep -m 700
&$f "B"

I used a timing setup for beginers:

  • the dot duration is 200ms
  • the gap between elements is less then dot duration (70 ms)
  • the dash duration is 4 dot durations

Powershell, 184 bytes

Inspired by Joey's answer.

(-split'14 4111 4141 411 1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_")
sleep -m 70}

Test script:

$f = {

(-split'14 4111 4141 411 1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_")
sleep -m 70}

}

&$f "A"
sleep -m 700
&$f "B"

I used a timing setup for beginers:

  • the dot duration is 200ms
  • the gap between elements is less then dot duration (70 ms)
  • the dash duration is 4 dot durations

Powershell, 184 120 bytes

for($d='0;?3,>5:.H7<1/9@E42-6B8CG='[$args[0][0]-65]-42;$d-1){[Console]::Beep(880,200*($d%2*3+1))
$d=$d-shr1
sleep -m 70}

Test script:

$f = {

for($d='0;?3,>5:.H7<1/9@E42-6B8CG='[$args[0][0]-65]-42;$d-1){[Console]::Beep(880,200*(($d%2)*3+1))
$d=$d-shr1
sleep -m 70}

}

&$f "A"
sleep -m 700
&$f "B"

I used a timing setup for beginers:

  • the dot duration is 200ms
  • the gap between elements is less then dot duration (70 ms)
  • the dash duration is 4 dot durations
Source Link
mazzy
  • 7.2k
  • 2
  • 12
  • 22

Powershell, 184 bytes

Inspired by Joey's answer.

(-split'14 4111 4141 411 1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_")
sleep -m 70}

Test script:

$f = {

(-split'14 4111 4141 411 1 1141 441 1111 11 1444 414 1411 44 41 444 1441 4414 141 111 4 114 1114 144 4114 4144 4411')[$args[0][0]-65]|% t*y|%{[Console]::Beep(880,200*"$_")
sleep -m 70}

}

&$f "A"
sleep -m 700
&$f "B"

I used a timing setup for beginers:

  • the dot duration is 200ms
  • the gap between elements is less then dot duration (70 ms)
  • the dash duration is 4 dot durations