Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,42 @@
|
|||
' version 03-12-2016
|
||||
' compile with: fbc -s console
|
||||
|
||||
Function num_base(number As ULongInt, _base_ As UInteger) As String
|
||||
|
||||
If _base_ > 9 Then
|
||||
Print "base not handled by function"
|
||||
Sleep 5000
|
||||
Return ""
|
||||
End If
|
||||
|
||||
Dim As ULongInt n
|
||||
Dim As String ans
|
||||
|
||||
While number <> 0
|
||||
n = number Mod _base_
|
||||
ans = Str(n) + ans
|
||||
number = number \ _base_
|
||||
Wend
|
||||
|
||||
If ans = "" Then ans = "0"
|
||||
|
||||
Return "." + ans
|
||||
|
||||
End Function
|
||||
|
||||
' ------=< MAIN >=------
|
||||
|
||||
Dim As ULong k, l
|
||||
For k = 2 To 5
|
||||
Print "Base = "; k
|
||||
For l = 0 To 12
|
||||
Print left(num_base(l, k) + " ",6);
|
||||
Next
|
||||
Print : print
|
||||
Next
|
||||
|
||||
' empty keyboard buffer
|
||||
While Inkey <> "" : Wend
|
||||
Print : Print "hit any key to end program"
|
||||
Sleep
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue