Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 3
Ton Hospel
  • 15k
  • 1
  • 23
  • 45

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

Try it online!

Ton Hospel
  • 15k
  • 1
  • 23
  • 45

AltStyle によって変換されたページ (->オリジナル) /