home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 February
/
Ahoy_Magazine_86-02_1986_Double_L.d64
/
ternary
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
232b
|
10 lines
0 rem << cd26-4a >>
1 rem commodare #22-4 :
2 rem ternary turnabout
3 rem solution by david hoffner
4 rem
5 b=3 : f=b+1
10 input"decimal";d
20 c=int(d/b):e=int(f*(d/b-c)):a$=right$(str$(e),1)+a$:if c then d=c:goto 20
30 print"base"b": "a$