0 Members and 2 Guests are viewing this topic.
Code: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRD
Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRD
lol, but really, the End statements aren't needed?
Quote from: matthias1992 on November 20, 2010, 12:57:55 pmQuote from: ScoutDavid on November 20, 2010, 12:52:11 pmCode: [Select]:Prompt E,N:If E=2 and N=1:Disp "NRML:If E != 2 or N!=1:Then:If E=2 or N=1:Then:Disp "ALMST NRML:Else:Disp "WEIRD80bytes, for the first challengeThis is missing two end statements plus it could be optimized to this:Code: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRDYours uses 6 bytes more, and mine is not missing two end statements. It is the end of a program so it does not need them.
Quote from: ScoutDavid on November 20, 2010, 12:52:11 pmCode: [Select]:Prompt E,N:If E=2 and N=1:Disp "NRML:If E != 2 or N!=1:Then:If E=2 or N=1:Then:Disp "ALMST NRML:Else:Disp "WEIRD80bytes, for the first challengeThis is missing two end statements plus it could be optimized to this:Code: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRD
Code: [Select]:Prompt E,N:If E=2 and N=1:Disp "NRML:If E != 2 or N!=1:Then:If E=2 or N=1:Then:Disp "ALMST NRML:Else:Disp "WEIRD80bytes, for the first challenge
:Prompt E,N:If E=2 and N=1:Disp "NRML:If E != 2 or N!=1:Then:If E=2 or N=1:Then:Disp "ALMST NRML:Else:Disp "WEIRD
Quote from: ScoutDavid on November 20, 2010, 01:33:04 pmCode: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRDN(E=2 won't work because if E is 2, and N is 2, it will still say Normal because N*(2=2 is 2, which is trueE=2 or N=1 won't work because if E=2 and N=1, it will still display almost normal because 1 Or 1 = 1third one works though
Quote from: Xeda112358 on November 20, 2010, 01:15:59 pmQuote from: matthias1992 on November 20, 2010, 12:57:55 pmQuote from: ScoutDavid on November 20, 2010, 12:52:11 pmCode: [Select]:Prompt E,N:If E=2 and N=1:Disp "NRML:If E != 2 or N!=1:Then:If E=2 or N=1:Then:Disp "ALMST NRML:Else:Disp "WEIRD80bytes, for the first challengeThis is missing two end statements plus it could be optimized to this:Code: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRDYours uses 6 bytes more, and mine is not missing two end statements. It is the end of a program so it does not need them.I was refering to ScoutDavid's code not yours.Quote from: Builderboy on November 20, 2010, 02:01:14 pmQuote from: ScoutDavid on November 20, 2010, 01:33:04 pmCode: [Select]Prompt E,NIf N(E=2Disp "NRMLIf E=2 or N=1Disp "ALMST NRMLIf ((N!=1)E!=2Disp "WEIRDN(E=2 won't work because if E is 2, and N is 2, it will still say Normal because N*(2=2 is 2, which is trueE=2 or N=1 won't work because if E=2 and N=1, it will still display almost normal because 1 Or 1 = 1third one works though Ok scrap it I thought I was good at basic, I guesss I was wrong
1->GAMEPrgmADisp ":D
If GAME=1:ThenDisp "You Lost9001->Game
yes, it compiles it as another program, but places the EXEC in the final product. But if you do return, then it WON'T go back to the main prog, it end the whole thing. To go back to the main prog, redirect to the last line of code.EDIT: and yes ENDs are needed too
In certain cases you don't need an End, if it is on the last line of an IfThen statement. Like this saves 2 bytes in the subprogram by not including the End1st programCode: [Select]1->GAMEPrgmADisp ":Dsub programCode: [Select]If GAME=1:ThenDisp "You Lost9001->Game
I doubt many people will participate if the programs to optimize are The Reign of Legends 3.