Word wheel: Difference between revisions

Content added Content deleted
(Initial FutureBasic task solution added)
Line 1,528: Line 1,528:
local fn CountCharacterInString( string as CFStringRef, character as CFStringRef ) as NSUInteger
local fn CountCharacterInString( string as CFStringRef, character as CFStringRef ) as NSUInteger
end fn = len(string) - len( fn StringByReplacingOccurrencesOfString( string, character, @"" ) )
end fn = len(string) - len( fn StringByReplacingOccurrencesOfString( string, character, @"" ) )



local fn IsLegal( wordStr as CFStringRef ) as BOOL
local fn IsLegal( wordStr as CFStringRef ) as BOOL
Line 1,535: Line 1,534:
if count < 3 || fn StringContainsString( wordStr, @"k" ) == NO then exit fn = NO
if count < 3 || fn StringContainsString( wordStr, @"k" ) == NO then exit fn = NO
for i = 0 to count - 1
for i = 0 to count - 1
if fn CountCharacterInString( letters, mid( wordStr, i, 1 ) ) < fn CountCharacterInString( wordStr, mid( wordStr, i, 1 ) )
if fn CountCharacterInString( letters, mid( wordStr, i, 1 ) ) < fn CountCharacterInString( wordStr, mid( wordStr, i, 1 ) )
Line 1,584: Line 1,582:
woke
woke
</pre>
</pre>





=={{header|Go}}==
=={{header|Go}}==