Jewels and stones: Difference between revisions

add ABC
(→‎K: add)
(add ABC)
 
(One intermediate revision by the same user not shown)
Line 388:
Result: 0
</pre>
=={{header|ABC}}==
<syntaxhighlight lang="abc">HOW TO RETURN stones count.in jewels:
PUT 0 IN count
FOR stone IN stones:
IF stone in jewels: PUT count+1 IN count
RETURN count
 
WRITE "aAAbbbb" count.in "aA"/
WRITE "ZZ" count.in "z"/</syntaxhighlight>
{{out}}
<pre>3
0</pre>
 
=={{header|Ada}}==
<syntaxhighlight lang="ada">with Ada.Text_IO;
Line 2,282 ⟶ 2,295:
0
</pre>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
= <Prout <Jewels ('aAAbbb') ('aA')>>
<Prout <Jewels ('ZZ') ('z')>>;
};
 
Jewels {
() (e.Jewels)
= 0;
(s.Stone e.Stones) (e.Jewels), e.Jewels: e.X s.Stone e.Y
= <+ 1 <Jewels (e.Stones) (e.Jewels)>>;
(s.Stone e.Stones) (e.Jewels)
= <Jewels (e.Stones) (e.Jewels)>;
};</syntaxhighlight>
{{out}}
<pre>3
0</pre>
 
=={{header|REXX}}==
2,114

edits