有没有算法可以找到下面这个ASCII-art图像?
+
+
+++
+++++++
++ ++
++ + ++
++ +++ ++
++ + ++
++ ++
+++++++
+++
在下面的文本主体中?
(注:该链接指向一个文件下载地址)
+ + + ++ + +++ + +
+ ++ + + ++++ + + + + + + +++ +++ +
+ + + ++ ++ ++ + ++ + + + + +
+ ++ + ++ + + + ++ ++ + +
++++++ + + + ++ + + + + ++ + + +
+ + + + + ++ + ++ + + + +
+++ + ++ + + + +++ + + ++ +
+++++ + + + + + + + +
+ + + + + + + + + + + +
++ + + + ++ + + + ++
我必须用黄色突出显示对应于完整形状的ASCII艺术图像。请参见附图:
![Enter image description here](https://istack.dev59.com/UaYhv.webp)
现在,我有两个二维数组数据: [100][100] 和 SlimeTorpedo 数组: [13][11]。
如@kjartan所述(第3-4个项目),以下是如何进行检测的代码:
int match = 0;
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
//Compare DataArr[i][j] with SlimeTorpedoArr[i][j]
//Look for "checked" position in the picture ("+"),
//which corresponds to a checked position in the
//slime torpedo array.
//match++;
}
}
如何解决这个问题的一般指导方针是什么?