Skip to main content
Commonmark migration
Source Link

Bash+coreutils,  64 60 bytes

tr a-z 35344526512513031462452313|sed s/./\&z-+/g|dc -eIK?^p

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6z-+4z-+5z-+5z-+0z-+^p

IK     Push 10, then 0 to the stack
6z-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result

Bash+coreutils,  64 60 bytes

tr a-z 35344526512513031462452313|sed s/./\&z-+/g|dc -eIK?^p

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6z-+4z-+5z-+5z-+0z-+^p

IK     Push 10, then 0 to the stack
6z-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result

Bash+coreutils,  64 60 bytes

tr a-z 35344526512513031462452313|sed s/./\&z-+/g|dc -eIK?^p

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6z-+4z-+5z-+5z-+0z-+^p

IK     Push 10, then 0 to the stack
6z-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result
added 8 characters in body; added 10 characters in body
Source Link

Bash+coreutils, 64 64 60 bytes

dc -e"IK`trtr a-z 35344526512513031462452313|sed 'ss/./& 3\&z-+/g'`^p"g|dc -eIK?^p

Try it online!Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6 3IK6z-+4 3+4z-+5 3+5z-+5 3+5z-+0 3+0z-+^p

IK     Push 10, then 0 to the stack
6 36z-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result

Bash+coreutils, 64 bytes

dc -e"IK`tr a-z 35344526512513031462452313|sed 's/./& 3-+/g'`^p"

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6 3-+4 3-+5 3-+5 3-+0 3-+^p

IK     Push 10, then 0 to the stack
6 3-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result

Bash+coreutils,  64 60 bytes

tr a-z 35344526512513031462452313|sed s/./\&z-+/g|dc -eIK?^p

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6z-+4z-+5z-+5z-+0z-+^p

IK     Push 10, then 0 to the stack
6z-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result
Source Link

Bash+coreutils, 64 bytes

dc -e"IK`tr a-z 35344526512513031462452313|sed 's/./& 3-+/g'`^p"

Try it online!

Takes a string in lowercase, outputs zero for falsy, nonzero for truthy

#Explanation

Uses tr and sed to create a dc program that looks like (for the example input 'hello'):

IK6 3-+4 3-+5 3-+5 3-+0 3-+^p

IK     Push 10, then 0 to the stack
6 3-+  Push 6 (three more than the dots minus dashes in 'h'), subtract 3, and accumulate
...    Do the same for all other letters, so the stack now has the total dots minus dashes
^      Raise 10 to this power - precision is zero so this turns negative/positive to falsy/truthy
p      Print result