Jewels and stones: Difference between revisions

add SETL
(easylang)
(add SETL)
Line 2,373:
}</syntaxhighlight>
{{Out}}See it in running in your browser by [https://scalafiddle.io/sf/Cz1HXAT/0 ScalaFiddle (JavaScript)] or by [https://scastie.scala-lang.org/7ZCCN5hISRuDqLWTKVBHow Scastie (JVM)].
 
=={{header|SETL}}==
<syntaxhighlight lang="setl">program count_jewels;
show("aA", "aAAbbbb");
show("z", "ZZ");
 
proc show(jewels, stones);
print("'" + jewels + "' in '" + stones + "': " + count(jewels, stones));
end proc;
 
proc count(jewels, stones);
jewels := {j : j in jewels};
return #[s : s in stones | s in jewels];
end proc;
end program;</syntaxhighlight>
{{out}}
<pre>'aA' in 'aAAbbbb': 3
'z' in 'ZZ': 0</pre>
 
=={{header|Sidef}}==
2,114

edits