Given an input string, write a program that outputs the total number of lines and curves it has.
The Challenge
- Take input from
STDIN, or any other input method. - Output to
STDOUT, or any other output method, the total number of lines and curves contained in the string, in that order, based on the below table in the code snippet. - Any non-alphanumeric characters should be ignored.
- Standard loopholes are forbidden.
- This is code-golf, so shortest code wins.
Clarifications
- The lines and curves are determined by the font used on Stackexchange for
code blocks. - Circles (like
O, o, 0) and dots (i, j), are considered to be 1 curve each. - Input can be a string, list of characters, stream of characters, bytecodes etc.
- Output can be an array of integers, tuple of integers, comma-separated string, etc. The two numbers must be separate, so
104is not valid, but10,4,10 4,10\n4,[10,4],(10, 4), and so on is. - Heading and trailing whitespace is perfectly acceptable.
Sample Input and Output
# Format: str -> line, curve hi -> 4, 2 HELLO WORLD -> 20, 4 l33+ 5pEak -> 13, 8 +=-_!...?~`g@#$%^ -> 1, 2 9001 -> 5, 3 O o O o O o -> 0, 6 Character Table
Char | Lines | Curves 0 | 1 | 1 1 | 3 | 0 2 | 1 | 1 3 | 0 | 2 4 | 3 | 0 5 | 2 | 1 6 | 0 | 1 7 | 2 | 0 8 | 0 | 2 9 | 0 | 1 A | 3 | 0 B | 1 | 2 C | 0 | 1 D | 1 | 1 E | 4 | 0 F | 3 | 0 G | 2 | 1 H | 3 | 0 I | 3 | 0 J | 1 | 1 K | 3 | 0 L | 2 | 0 M | 4 | 0 N | 3 | 0 O | 0 | 1 P | 1 | 1 Q | 0 | 2 R | 2 | 1 S | 0 | 1 T | 2 | 0 U | 0 | 1 V | 2 | 0 W | 4 | 0 X | 4 | 0 Y | 3 | 0 Z | 3 | 0 a | 0 | 2 b | 1 | 1 c | 0 | 1 d | 1 | 1 e | 1 | 1 f | 1 | 1 g | 1 | 2 h | 1 | 1 i | 3 | 1 j | 1 | 2 k | 3 | 0 l | 3 | 0 m | 3 | 2 n | 2 | 1 o | 0 | 1 p | 1 | 1 q | 1 | 1 r | 1 | 1 s | 0 | 1 t | 1 | 1 u | 1 | 1 v | 2 | 0 w | 4 | 0 x | 4 | 0 y | 1 | 1 z | 3 | 0
s2 curves or 1? Is the stem injboth a line and curve? It would be best if you could just list the required values for all of the letters. \$\endgroup\$oshould be 0 lines, 1 curve \$\endgroup\$