ABC problem: Difference between revisions
Content added Content deleted
(→Insitux: move and slightly improve) |
FordArthur (talk | contribs) |
||
Line 5,018: | Line 5,018: | ||
=={{header|Insitux}}== |
=={{header|Insitux}}== |
||
<syntaxhighlight lang="insitux"> |
<syntaxhighlight lang="insitux"> |
||
(var find-idx #(when (let found (find % %1)) (idx %1 found))) |
|||
(function in-block? c |
|||
(when (let block (find (substr? (upper-case c)) rem-blocks)) |
(function in-block? c (when (let block-idx (find-idx (substr? (upper-case c)) rem-blocks)) (var! rem-blocks drop block-idx))) |
||
(var! rem-blocks remove [block]))) |
|||
(function can-make-word word |
(function can-make-word word |
||
Line 5,027: | Line 5,026: | ||
(join ", " (map #(str % " => " (can-make-word %)) ["A" "bark" "Book" "TREAT" "Common" "squaD" "CoNFuSe"])) ; Notice case insensitivity |
(join ", " (map #(str % " => " (can-make-word %)) ["A" "bark" "Book" "TREAT" "Common" "squaD" "CoNFuSe"])) ; Notice case insensitivity |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
A => true, bark => true, Book => false, TREAT => true, Common => false, squaD => true, CoNFuSe => |
A => true, bark => true, Book => false, TREAT => true, Common => false, squaD => true, CoNFuSe => true |
||
</pre> |
</pre> |
||