October 2020 Archives

Finding Squares in Matrices

I don't usually take part in the Perl Weekly Challenge but one of this week's challenges caught my eye. I thought it could be a fun thing to attempt and decided to use Zydeco to help solve it.

The problem is that you're given a matrix of 0s and 1s:

You need to find any squares (equal length sides) where all four corners are 1s:

Applying Operators to Coderefs

In algebra, there's this pretty funky concept:

(f+g)(x) = f(x) + g(x)

And I was thinking if $f and $g were coderefs, what could $f + $g be?

About Toby Inkster

user-pic I'm tobyink on CPAN, IRC and PerlMonks.