Re: [M100] One liner submission: base converter

2023-01-09 Thread John R. Hogerhuis
On Mon, Jan 9, 2023, 5:56 PM Alex ... wrote: > Maybe this is cheating but MFORTH gives me this one liner arbitrary base > converter.  > > : BC BASE @ >R BASE ! . R> BASE ! ; > > Examples: > 255 16 BC FF > 23 2 BC 10111 > HEX D2 DECIMAL 8 BC 322 > Yeah Forth takes the cake on interactive stuff

Re: [M100] One liner submission: base converter

2023-01-09 Thread Alex ...
Maybe this is cheating but MFORTH gives me this one liner arbitrary base converter.  : BC BASE @ >R BASE ! . R> BASE ! ; Examples: 255 16 BC FF 23 2 BC 10111 HEX D2 DECIMAL 8 BC 322 - Alex On Sat, Jan 7, 2023, 15:51 Ken Pettit wrote: > Yep, > > Pretty much the same with the one liner I made

Re: [M100] One liner submission: base converter

2023-01-07 Thread Ken Pettit
Yep, Pretty much the same with the one liner I made from John's character rasterization program ... just remove the line number "1" in front and it will still run from interactive mode. But I think your infinite loop is 2 characters shorter than mine! I used STEP0 which take 5 bytes where

Re: [M100] One liner submission: base converter

2023-01-07 Thread Stephen Adolph
thanks Ken, Not exactly new work, but it always bothered me that I had to use a line number before. so not really a "one liner". The use of a never ending for loop solved that! On Sat, Jan 7, 2023 at 2:19 PM Ken Pettit wrote: > On 1/7/23 8:30 AM, Stephen Adolph wrote: > > Here is my

Re: [M100] One liner submission: base converter

2023-01-07 Thread Ken Pettit
On 1/7/23 8:30 AM, Stephen Adolph wrote: Here is my one-liner. 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 Hey Steve, I had seen this submission before but never really tried to run

[M100] One liner submission: base converter

2023-01-07 Thread Stephen Adolph
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