Pangram checker: Difference between revisions

no edit summary
(Applesoft BASIC)
No edit summary
Line 1,997:
"The quick brown fox jumps over the lazy dog." is a pangram.
</pre>
 
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
include "NSLog.incl"
 
local fn IsPangram( pangramString as CFStringRef ) as BOOL
NSUInteger i, count
BOOL result
CFStringRef lcPanStr = fn StringLowerCaseString( pangramString )
CFMutableSetRef mutSet = fn MutableSetWithCapacity( 0 )
count = len(lcPanStr)
for i = 0 to count - 1
if ( fn CharacterSetCharacterIsMember( fn CharacterSetLowercaseLetterSet, fn StringCharacterAtIndex( lcPanStr, i ) ) )
MutableSetAddObject( mutSet, fn StringWithFormat( @"%c", fn StringCharacterAtIndex( lcPanStr, i ) ) )
end if
next
if fn SetCount( mutSet ) >= 26 then result = YES else result = NO
end fn = result
 
 
CFStringRef testStr, trueStr, falseStr
CFArrayRef array
 
trueStr = @"Is a pangram"
falseStr = @"Not a pangram"
 
array = @[¬
@"My dog has fleas.",¬
@"The quick brown fox jumps over the lazy do.",¬
@"The quick brown fox jumped over the lazy dog.",¬
@"The quick brown fox jumps over the lazy dog.",¬
@"Jackdaws love my big sphinx of quartz.",¬
@"What's a jackdaw?",¬
@"Watch \"Jeopardy!\", Alex Trebek's fun TV quiz game.",¬
@"Pack my box with five dozen liquor jugs.",¬
@"This definitely is not a pangram.",¬
@"This is a random long sentence just for testing purposes."]
 
for testStr in array
if ( fn IsPangram( testStr ) )
NSLog( @"%13s : %@", fn StringUTF8String( trueStr ), testStr ) else NSLog( @"%s : %@", fn StringUTF8String( falseStr ), testStr )
end if
next
 
HandleEvents
</syntaxhighlight>
{{output}}
<pre>
Not a pangram : My dog has fleas.
Not a pangram : The quick brown fox jumps over the lazy do.
Not a pangram : The quick brown fox jumped over the lazy dog.
Is a pangram : The quick brown fox jumps over the lazy dog.
Is a pangram : Jackdaws love my big sphinx of quartz.
Not a pangram : What's a jackdaw?
Is a pangram : Watch "Jeopardy!", Alex Trebek's fun TV quiz game.
Is a pangram : Pack my box with five dozen liquor jugs.
Not a pangram : This definitely is not a pangram.
Not a pangram : This is a random long sentence just for testing purposes.
</pre>
 
 
 
 
=={{header|Fōrmulæ}}==
715

edits