Determine if a string is collapsible: Difference between revisions

Added Uiua solution
(→‎{{header|RPL}}: HP-49 version)
(Added Uiua solution)
 
(One intermediate revision by one other user not shown)
Line 3,312:
Length: 1 <<<A>>>
</pre>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
, ('')
('"If I were two-faced, would I be wearing this '
'one?" --- Abraham Lincoln ')
('..11111111111111111111111111111111111111111111'
'11111111111111111117777888')
('I never give \'em hell, I just tell the truth, '
'and they think it\'s hell. ')
(' '
' --- Harry S Truman '): e.Strings
= <Each Show e.Strings>;
};
 
Each {
s.F = ;
s.F t.I e.X = <Mu s.F t.I> <Each s.F e.X>;
};
 
Brackets {
e.X, <Lenw e.X>: s.L e.X =
<Prout <Symb s.L> ': <<<' e.X '>>>'>;
};
 
Show {
(e.X) = <Brackets e.X>
<Brackets <Collapse e.X>>
<Prout>;
};
 
Collapse {
= ;
s.C s.C e.S = <Collapse s.C e.S>;
s.C e.S = s.C <Collapse e.S>;
};</syntaxhighlight>
{{out}}
<pre>0: <<<>>>
0: <<<>>>
 
72: <<<"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln >>>
70: <<<"If I were two-faced, would I be wearing this one?" - Abraham Lincoln >>>
 
72: <<<..1111111111111111111111111111111111111111111111111111111111111117777888>>>
4: <<<.178>>>
 
72: <<<I never give 'em hell, I just tell the truth, and they think it's hell. >>>
69: <<<I never give 'em hel, I just tel the truth, and they think it's hel. >>>
 
72: <<< --- Harry S Truman >>>
17: <<< - Hary S Truman >>></pre>
 
=={{header|REXX}}==
Line 3,890 ⟶ 3,941:
</pre>
 
=={{header|Uiua}}==
<syntaxhighlight lang="uiua">
S ← {""
"\"If I were two-faced, would I be wearing this one?\" --- Abraham Lincoln"
"..1111111111111111111111111111111111111111111111111111111111111117777888"
"I never give 'em hell, I just tell the truth, and they think it's hell. "
" --- Harry S Truman "
"The better the 4-wheel drive, the further you'll be from help when ya get stuck!"
"headmistressship"
"aardvark"
"😍😀🙌💃😍😍😍🙌"
"unnecessary bookkeeping"}
 
Collapse ← ≡(⊂:□⊜⊢+1⊛.°□.)
≡(&p""≡(&p$"_ chars \t«_»" ⊸⧻°□)) Collapse S
</syntaxhighlight>
{{out}}
<pre>
0 chars «»
0 chars «»
 
71 chars «"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln»
69 chars «"If I were two-faced, would I be wearing this one?" - Abraham Lincoln»
 
72 chars «..1111111111111111111111111111111111111111111111111111111111111117777888»
4 chars «.178»
 
72 chars «I never give 'em hell, I just tell the truth, and they think it's hell. »
69 chars «I never give 'em hel, I just tel the truth, and they think it's hel. »
 
72 chars « --- Harry S Truman »
17 chars « - Hary S Truman »
 
80 chars «The better the 4-wheel drive, the further you'll be from help when ya get stuck!»
77 chars «The beter the 4-whel drive, the further you'l be from help when ya get stuck!»
 
16 chars «headmistressship»
14 chars «headmistreship»
 
8 chars «aardvark»
7 chars «ardvark»
 
8 chars «😍😀🙌💃😍😍😍🙌»
6 chars «😍😀🙌💃😍🙌»
 
23 chars «unnecessary bookkeeping»
18 chars «unecesary bokeping»
</pre>
=={{header|Visual Basic .NET}}==
{{trans|C#}}
159

edits