Here is my one-liner.
This is a remake of a prior submission that was actually a one line program
that used line numbering.
Here is the version that can just be typed in at the BASIC command prompt.
The tricky bit is that it is only <255 characters if you use ? and not
PRINT! This line of code is 254 characters as shown below. Make sure you
don't get typos because of word-wrapping.
It is a bit of a bear to type in! Works for M100, T102, T200.
FORZ=0TO1:Z=0:V$="
"+CHR$(13)+CHR$(8)+"0123456789ABCDEF":E=INSTR(V$,INKEY$):IFE=1THENNEXTELSEF=(F-(E=2))MOD3:G=9*F+2-F^2:C=-C*(E=2)-(C*G+E-4)*(E>3ANDE<G+4):?:?MID$("BDH",F+1,1)":";:D=C:FORI=11*(F=0)-4TO0:J=G^I:X=INT(D*J):?MID$(V$,X+4,1);:D=D-X/J:NEXTI,Z
Instructions:
* type this in, press ENTER
* Press Enter once
you will see
D:00000
D stands for Decimal, B for Binary, H for Hexadecimal
:00000 == the current value for base conversion
Commands:
Enter = change base and re-display number. Base will rotate D->H->B->D etc.
Backspace = reset value to zero
0..9, A..F = keys to enter the value for conversion, limited by the current
base.
Value must be <65535 decimal, FFFF hex, 1111111111111111 binary
cheers
Steve