ABC problem: Difference between revisions

Content added Content deleted
(→‎{{header|FutureBasic}}: Changed output colors)
(→‎Insitux: improvement)
Line 5,126: Line 5,126:
=={{header|Insitux}}==
=={{header|Insitux}}==
<syntaxhighlight lang="insitux">
<syntaxhighlight lang="insitux">
(function in-block? c
(var find-idx #(when (let found (find % %1)) (idx %1 found)))
(function in-block? c (when (let block-idx (find-idx (substr? (upper-case c)) rem-blocks)) (var! rem-blocks drop block-idx)))
(when (let block-idx (find-idx (substr? (upper-case c)) rem-blocks))
(var! rem-blocks drop block-idx)))


(function can-make-word word
(function can-make-word word
Line 5,133: Line 5,134:
(.. and (map in-block? word)))
(.. and (map in-block? word)))


(join ", " (map #(str % " => " (can-make-word %)) ["A" "bark" "Book" "TREAT" "Common" "squaD" "CoNFuSe"])) ; Notice case insensitivity
(-> ["A" "bark" "Book" "TREAT" "Common" "squaD" "CoNFuSe"] ; Notice case insensitivity
(map #(str % " => " (can-make-word %)))

(join ", "))
</syntaxhighlight>
</syntaxhighlight>
{{out}}
{{out}}