Jewels and stones: Difference between revisions
no edit summary
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
No edit summary |
||
Line 845:
0
53
0
</pre>
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">window 1, @"Jewels and Stones"
local fn JewelsAndStones( jewels as CFStringRef, stones as CFStringRef ) as long
long index, count = 0
for index = 0 to len(stones) - 1
if ( fn StringContainsString( jewels, mid(stones,index,1) ) ) then count++
next
end fn = count
print fn JewelsAndStones( @"aA", @"aAAbbbb" )
print fn JewelsAndStones( @"z", @"ZZ" )
HandleEvents</syntaxhighlight>
{{out}}
<pre>
3
0
</pre>
|