I keep hearing that thinking outside the box is a goal worth achieving, but how can I tell if I'm successfully doing it?
To solve this dilemma I have already wrote a Brainwave-to-ASCII-translator which in theory should produce outputs like
#
+------------+ #
| thinking | #
| | #
+------------+ #
#
or
#
+------+ #
| | thinking #
| | #
| | #
+------+ #
#
which make it fairly easy to tell whether one is thinking outside the box or not. (The #
are not part of the output and represent new lines.)
However, due to a bug sometimes only a smaller section of the output is returned:
| | #
+---------+ #
thinking #
#
+#
|#
inking |#
#
#
The Task
Please help me to automatically classify the Brainwave-to-ASCII-translator output by writing a program or function which reads an ascii-reprensentation and returns whether thinking
is in the box, outside of it or it could not tell from the input.
Input
A set of same-length strings either as a list or delimited by newlines containing
- the string
thinking
or valid pre- or suffixes thereof - the characters
+-|
forming a rectangular box or valid parts of it - spaces
- NO
#
, those are only included in the challenge to mark the ends of the input lines.
Output
- a truthy value if
thinking
is outside the box - a falsy value if
thinking
is in the box - a distinct third maybe value if it can not be determined from the input whether
thinking
is in the box or not
Examples
Truthy:
#
+------+ #
| | thinking #
| | #
| | #
+------+ #
#
| | #
+---------+ #
thinking #
#
+#
|#
|#
inking |#
thinking #
-------+ #
++ # (thinking is not in the box, so it must be outside)
++ # (this is also the smallest possible box)
+ #
t#
+----+# (The box is not wide enough to contain "thinking")
---# (The box is not high enough to contain "thinking")
---#
As string input:
" \n +------+ \n | | thinking \n | | \n | | \n +------+ \n "
" | | \n +---------+ \n thinking "
" \n +\n |\n |\ninking |"
"thinking \n-------+ "
" ++ \n ++ "
"+ \n t"
"+----+"
"---\n---"
"g++"
"k\n+"
Falsy:
#
+------------+ #
| thinking | #
| | #
+------------+ #
#
+---------------#
| #
| #
| thinking #
| #
king | #
------+ #
+---#
|thi#
+---#
-#
n#
-#
As string input:
" \n +------------+ \n | thinking | \n | | \n +------------+ \n "
" +---------------\n | \n | \n | thinking "
" | \nking | \n------+ "
"+---\n|thi\n+---"
"-\nn\n-"
Maybe:
thinking#
g|#
think#
-----#
| |# (box large enough to possibly contain the string)
| |#
+--#
| #
# (empty input)
As string input:
"thinking"
"g|"
"|t"
"-\ni"
"h\n-"
"think\n-----"
"| |\n| |"
" +--\n | "
""
Rules
- This is code-golf, so try to use as few bytes as possible.
- The maybe value can be chosen freely as long as it's different from the truthy/falsy value and is the same for all maybe-inputs. It can also be an error.
- You can assume that the input is always valid (eg. contains no other chars than
+-ghiknt|
, no more than one box, ...).
+\n+
, box too small for a word \$\endgroup\$