PHP, 195(削除) 195 (削除ここまで) 205 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);;$x[$s
$x[$s]=++$i;$m=$i==$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1 && $i>2$z==1&&$i>2?R:($i==$z?$m):M)):M;?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings. Wasted a couple to make it shapely ;)
Fixed a few issues now... Test runs produce this.
$_="
$_="
$_""
;say
RESULT:S
=============
$_=
"no
t a
squ
are
";#
RESULT:R
=============
$
_=
"So
this
"."".
shape;
RESULT:T
=============
$_="or
even,
this
way
!!
"
RESULT:T
=============
as
smiley
asd
A
RESULT:M
=============
X
RESULT:M
=============
XX
RESULT:M
=============
cccc
a
aa
cccc
RESULT:M
=============
PHP, 195 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);
$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1 && $i>2?R:$m):M?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings. Wasted a couple to make it shapely ;)
PHP, (削除) 195 (削除ここまで) 205 bytes
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);$x[$s
]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1&&$i>2?R:($i==$z?$m:M)):M;?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings.
Fixed a few issues now... Test runs produce this.
$_="
$_="
$_""
;say
RESULT:S
=============
$_=
"no
t a
squ
are
";#
RESULT:R
=============
$
_=
"So
this
"."".
shape;
RESULT:T
=============
$_="or
even,
this
way
!!
"
RESULT:T
=============
as
smiley
asd
A
RESULT:M
=============
X
RESULT:M
=============
XX
RESULT:M
=============
cccc
a
aa
cccc
RESULT:M
=============
PHP, 191195 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s;
$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1&&$i>2$z==1 && $i>2?R:$m):M;M?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings. Wasted a couple to make it shapely ;)
PHP, 191 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1&&$i>2?R:$m):M;
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings
PHP, 195 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);
$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1 && $i>2?R:$m):M?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings. Wasted a couple to make it shapely ;)
PHP, 204191 bytes
Added the > 2 character restriction:
<?$r=substr$a=$argv[1];$r=substr($argv[1]$a,-2,1)=="
"=="\n"?strrev($argv[1]$a):$argv[1];
foreach$a;foreach(explode("
""\n",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?'T'T:'M';M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?'S'S:($z==1&&$i>2?'R'R:$m):M;
Original 181 bytes:
<?$r=substr($argv[1],-2,1)=="
"?strrev($argv[1]):$argv[1];
foreach(explode("
",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo $z==1&&key($x)==$i?S:($z==1?R:$m);
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings (original was 190 bytes)
PHP, 204 bytes
Added the > 2 character restriction:
<?$r=substr($argv[1],-2,1)=="
"?strrev($argv[1]):$argv[1];
foreach(explode("
",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?'T':'M';}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?'S':($z==1&&$i>2?'R':$m):M;
Original 181 bytes:
<?$r=substr($argv[1],-2,1)=="
"?strrev($argv[1]):$argv[1];
foreach(explode("
",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo $z==1&&key($x)==$i?S:($z==1?R:$m);
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings (original was 190 bytes)
PHP, 191 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1&&$i>2?R:$m):M;
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings