Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Gapful-numbers/FutureBasic/gapful-numbers.basic
Normal file
30
Task/Gapful-numbers/FutureBasic/gapful-numbers.basic
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
_0 = 48 // ASCII code for 0 = 48
|
||||
|
||||
void local fn GenerateGaps( start as UInt64, count as NSInteger )
|
||||
NSInteger counter = 0
|
||||
UInt64 i = start
|
||||
|
||||
NSLog( @"First %d Gapful numbers >= %llu:", count, start )
|
||||
|
||||
while ( counter < count )
|
||||
CFStringRef string = fn StringWithFormat( @"%llu", i )
|
||||
UniChar character = fn StringCharacterAtIndex( string, 0 )
|
||||
if( ( i mod ( 10 * ( character - _0 ) + i mod 10 ) ) == 0 )
|
||||
NSLog( @"%3d : %llu", counter + 1, i )
|
||||
counter++
|
||||
end if
|
||||
i++
|
||||
wend
|
||||
end fn
|
||||
|
||||
local fn DoIt
|
||||
fn generateGaps( 100, 30 ) : NSLog( @"\n" )
|
||||
fn generateGaps( 1000000, 15 ) : NSLog( @"\n" )
|
||||
fn generateGaps( 1000000000, 15 ) : NSLog( @"\n" )
|
||||
end fn
|
||||
|
||||
fn DoIt
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue