There are crosses X68547


Statement
 

pdf   zip

Program a function @hay_cruces(M)@ which, given an array of dimensions fil*colfil * col (for fil,col3fil, col \geq 3) whose elements are "-" and "*", returns True when there is at least one cross. A cross is a pattern:

-*-

***

-*-

Sample session

Sample session
>>> M=[["-", "*", "-", "-"],
...    ["*", "*", "*", "*"],
...    ["-", "*", "-", "-"]]
>>> hay_cruces(M)
True
>>> M=[["-", "-", "-"],
...    ["*", "*", "*"],
...    ["-", "*", "-"],
...    ["-", "-", "-"]]
>>> hay_cruces(M)
False
Information
Author
InfBesos
Language
English
Translator
Original language
Spanish
Other languages
Catalan Spanish
Official solutions
Python
User solutions
Python