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 Answer

deleted 58 characters in body
Source Link
Ton Hospel
  • 15k
  • 1
  • 23
  • 45

Perl 5 -p, 83 bytes

  • Mess: nothing
  • Square: 0
  • Triangle: 1
  • Rectangle: 2
($z)=grep++$$_{"@+"-$_*~-$.
}==$.,0,/$/,-1}{@F<2|$.<2or
$_=$$$$_{"@+"-$_*~-$.}==$.,0,/$/,-1
}{$.<2or$_=$$z{$z>0||$.}?$z%2:2x@F>1&&2x!$z

Try it online!

11 bytes wasted on checking the minimal sizesTry it online!

Perl 5 -p, 83 bytes

  • Mess: nothing
  • Square: 0
  • Triangle: 1
  • Rectangle: 2
($z)=grep++$$_{"@+"-$_*~-$.
}==$.,0,/$/,-1}{@F<2|$.<2or
$_=$$z{$z>0||$.}?$z%2:2x!$z

Try it online!

11 bytes wasted on checking the minimal sizes

Perl 5 -p, 83 bytes

  • Mess: nothing
  • Square: 0
  • Triangle: 1
  • Rectangle: 2
($z)=grep++$$_{"@+"-$_*~-$.}==$.,0,/$/,-1
}{$.<2or$_=$$z{$z>0||$.}?$z%2:@F>1&&2x!$z

Try it online!

Post Undeleted by Ton Hospel
added 74 characters in body
Source Link
Ton Hospel
  • 15k
  • 1
  • 23
  • 45

Perl 5 -p, 7983 bytes

  • Mess: nothing
  • Square: 0
  • Triangle: 1
  • Rectangle: 2
/$/;($z)=grep++$$_{"@+"-$_*~-$.}==$.,0,
1,-1}{$.<2or$_=$$$$_{"@+"-$_*~-$.
}==$.,0,/$/,-1}{@F<2|$.<2or
$_=$$z{$z>0||$.}?$z%2:2x!$z

Try it online! Try it online!

11 bytes wasted on checking the minimal sizes

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!

Perl 5 -p, 83 bytes

  • Mess: nothing
  • Square: 0
  • Triangle: 1
  • Rectangle: 2
($z)=grep++$$_{"@+"-$_*~-$.
}==$.,0,/$/,-1}{@F<2|$.<2or
$_=$$z{$z>0||$.}?$z%2:2x!$z

Try it online!

11 bytes wasted on checking the minimal sizes

Post Deleted by Ton Hospel
Source Link
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!

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