Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Binary-digits/FutureBasic/binary-digits.basic
Normal file
16
Task/Binary-digits/FutureBasic/binary-digits.basic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
local fn IntegerToBinaryStr( x as NSInteger ) as CFStringRef
|
||||
CFStringRef resultStr : resultStr = @""
|
||||
|
||||
while ( x )
|
||||
resultStr = fn StringByAppendingString( fn StringWithFormat( @"%lu", x && 1 ), resultStr )
|
||||
x = x >> 1
|
||||
wend
|
||||
end fn = resultStr
|
||||
|
||||
NSLog( @" 5 = %@", fn IntegerToBinaryStr( 5 ) )
|
||||
NSLog( @" 50 = %@", fn IntegerToBinaryStr( 50 ) )
|
||||
NSLog( @"9000 = %@", fn IntegerToBinaryStr( 9000 ) )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue