Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Binary-digits/AppleScript/binary-digits-3.applescript
Normal file
15
Task/Binary-digits/AppleScript/binary-digits-3.applescript
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
on intToBinary(n)
|
||||
set binary to (n mod 2 div 1) as text
|
||||
set n to n div 2
|
||||
repeat while (n > 0)
|
||||
set binary to ((n mod 2 div 1) as text) & binary
|
||||
set n to n div 2
|
||||
end repeat
|
||||
|
||||
return binary
|
||||
end intToBinary
|
||||
|
||||
display dialog ¬
|
||||
intToBinary(5) & linefeed & ¬
|
||||
intToBinary(50) & linefeed & ¬
|
||||
intToBinary(9000) & linefeed
|
||||
Loading…
Add table
Add a link
Reference in a new issue