Perl 5 -p, 79 bytes
- Mess: nothing
- Square: 0
- Triangle: 1
- Rectangle: 2
/$/;($z)=grep++$$_{"@+"-$_*~-$.}==$.,0,
1,-1}{$.<2or$_=$$z{$z>0||$.}?$z%2:2x!$z
Ton Hospel
- 15k
- 1
- 23
- 45
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange-p, 79 bytes/$/;($z)=grep++$$_{"@+"-$_*~-$.}==$.,0,
1,-1}{$.<2or$_=$$z{$z>0||$.}?$z%2:2x!$z