Challenge:
Given an ASCII art string representing a number, output that number.
Example:
Input:
&&&& ##### .====.. .&&&
$$$$$. %% %% % % . +. .
@@@ . @@ . = . = . ????
+++. && &&. % % = =
$$$ . @@@@@ # # . ===.
.$$$$$ .????.
Output: 1306
Input:
==== .$$.. &&&&&&. .@@@@ ?????
+++++ &. & $$ %% %% && &&
$$$ .==. @@ . @@ @@ . ??
. ### . @ @ . == $$$$$$$$ ??. .??
. .@@@. .%%. == .$$ &&&&& .
$$$$$. . .% . @@ .
Output: 18743
Periods are interference, you can ignore them
The complete list of numbers:
&&&&
% %
= =
% %
# #
????
&&&&
$$$$$
@@@
+++
$$$
$$$$$
#####
++ ++
# ##
@@
@@
???????
#####
%% %%
@@
&& &&
@@@@@
@@@@
%% %%
@@ @@
$$$$$$$$
$$
@@
######
$
####
+
?
$$$$$
&&&
+
????
= =
===
&&&&&&
$$
@@
==
==
%
$$
& &
==
@ @
%%
&&&&
@ @
&&&&
$
&
+
Rules:
- Your input is a string unless your language doesn't have a string type.
- The input is guaranteed to be exactly 6 characters "high." Numbers such as 8 and 3 have a whitespace buffer UNDER the number.
- If you write a function, it MUST return a numerical type.
- The ASCII art can be composed of ANY printable characters in no particular order (remember, you can ignore periods).
- No standard loopholes.
- Your program must handle any arbitrary ASCII number of reasonable length (as long as the result fits within a 32-bit signed integer).
- Input is guaranteed valid, undefined behavior is allowed with bad input.
- This is code-golf, shortest program wins.
More tests:
$$$$ ###### @@@@ . . .%%%% #####
##### $ . =====.. . ## ## ++ ++
+++ ####. +++. == == # ##
=== . + ### . ========. @@
.&&& . . ? . . @@@ ## @@ .
%%%%% $$$$$ ##### @@ ???????
> 15142
.&&&&. ?????? @@@@@ .++++
@ @ + . == == %% %%
.&&&&. ####.. = == . ++ ++
.. $ & $$ $$$$$$$$.
. &. . # && . ##
+. . ##### $$$$$$$ .==
> 9524
&$@+#%=?
. Are there any other characters that are valid? Will each row in a number always contain the same character? \$\endgroup\$.
appear as both a part of the character and a part of interference? \$\endgroup\$