ABC problem: Difference between revisions
m
→{{header|FutureBasic}}
No edit summary |
|||
Line 4,518:
include "NSLog.incl"
local fn
NSUInteger i, j, length, count
Boolean letterFound
@[@"N", @"A"], @[@"G", @"T"], @[@"R", @"E"], @[@"T", @"G"], @[@"Q", @"D"], @[@"F", @"S"],¬
@[@"J", @"W"], @[@"H", @"U"], @[@"V", @"I"], @[@"A", @"N"], @[@"O", @"B"], @[@"E", @"R"],¬
for i = 0 to length - 1▼
letterFound = NO
for j = 0 to count - 1▼
CFStringRef subString = mid( testWord, i, 1 )
// NSLog( @"%@\n", subString )
NSLog( @"%@; %@ %@", subString, tempArr[0], tempArr[1] )
if not letterFound and ( subString == tempArr[0] ) or ( substring == tempArr[1] )
//tempArr[0] = -1
//tempArr[1] = -1
letterFound = YES
end if▼
next▼
if ( not letterFound ) then result = @"NO" : exit fn
next▼
end fn = result▼
▲@"NA", @"GT", @"RE", @"TG", @"QD", @"FS", @"JW", @"HU", @"VI",¬
▲@"AN", @"OB", @"ER", @"FS", @"LY", @"PC", @"ZM"] )
▲CFStringRef cfStr = fn StringUppercaseString( w )
▲NSUInteger length = fn StringLength( cfStr )
▲NSUInteger count = fn ArrayCount( blocks )
NSLog( @"treat: %@\n", fn CanSpell( @"treat" ) )
NSLog( @"squad: %@\n", fn CanSpell( @"squad" ) )
NSLog( @"cnfuse: %@\n", fn CanSpell( @"cnfuse" ) )
▲for i = 0 to length - 1
▲for j = 0 to count - 1
▲CFStringRef compareStr = fn ArrayObjectAtIndex( blocks, j )
▲end if
▲next
▲next
▲end fn = result
▲NSLog( @"a: Can blocks spell? %@", fn CanBlocksSpell( @"a" ) )
▲NSLog( @"Bark: Can blocks spell? %@", fn CanBlocksSpell( @"Bark" ) )
▲NSLog( @"BOOK: Can blocks spell? %@", fn CanBlocksSpell( @"BOOK" ) )
▲NSLog( @"COMMON: Can blocks spell? %@", fn CanBlocksSpell( @"COMMON" ) )
HandleEvents
Line 4,569 ⟶ 4,572:
conFUse: Can blocks spell? YES
</pre>
=={{header|Gambas}}==
|