Help with my guess the number game with feedback one-liner in Family BASIC

Started by childishbeat, August 17, 2019, 01:31:22 am

Previous topic - Next topic

childishbeat

How can the following code be reduced in characters while still entirely being in one line, and also have a space between the words TOO and LOW/HIGH without a space being rendered along with the winning text (CORRECT, which I changed to RIGHT due to Family BASIC having limitations on how many characters one line can consist of)?:
0N=RND(10)+1:F.T=0TO0:I."WHAT'S MY NUMBER? (1-10) ",G:T=G<>N:L=G<N:H=G>N:R=G=N:A=T*-79:B=H*-71:C=R*-71:?CHR$(A+5)CHR$(A)CHR$(A)CHR$(L*-76)CHR$(L*-79)CHR$(L*-87)CHR$(B+1)CHR$(B+2)CHR$(B)CHR$(B+1)CHR$(C+11)CHR$(C+2)CHR$(C)CHR$(C+1)CHR$(C+13)".":N.
These examples of Family BASIC code act as models to hopefully help you help me reduce the code in characters because I've attempted to use them, all in failure:
0N=RND(10)+1:F.T=0TO0:I."WHAT'S MY NUMBER? (1-10) ",G:T=G<>N*-79:L=G<N:H=G>N*-71:R=G=N*-71:?CHR$(T+5)CHR$(T)CHR$(T)CHR$(L*-76)CHR$(L*-79)CHR$(L*-87)CHR$(H+1)CHR$(H+2)CHR$(H)CHR$(H+1)CHR$(R+11)CHR$(R+2)CHR$(R)CHR$(R+1)CHR$(R+13)".":N.
0N=RND(10)+1:F.T=0TO0:I."WHAT'S MY NUMBER? (1-10) ",G:T=G<>N:L=G<N:H=G>N:R=G=N:F.X=0TOLSTEP1:?"TOO LOW.":N.:F.Y=0TOHSTEP1:?"TOO HIGH.":N.:F.Z=0TORSTEP1:?"CORRECT.":N.:N.
0N=RND(10)+1:F.T=0TO0:I."WHAT'S MY NUMBER? (1-10) ",G:T=G<>N:L=G<N:H=G>N:R=G=N:A=T*-79:B=H*-71:C=R*-71:0F.S=1TO15:DATAA+5,A,A,L*-76,L*-79,L*-87,B+1,B+2,B,B+1,C+11,C+2,C,C+1,C+13:READS:?CHR$(S);:N.:?".":N.