hi, I don't post in the 20 lines challenge because my problem is not only for the 20lc. I have some bugs when I try to put 5 commands per line. I'll use a very small example:
sync on
sync rate 40
do
cls
set cursor 0,0
if spacekey()=1 then print "The spacekey is down."
inc tut
print tut
sync
loop
this code work well, but it's maybe too long => I try to put 5 commands per lines, as in the 20lc:
sync on:sync rate 40:do:cls:set cursor 0,0
if spacekey()=1 then print "The spacekey is down." : inc tut:print tut:sync:loop
Error : command out of place, so I have to put the loop in the third line :
sync on:sync rate 40:do:cls:set cursor 0,0
if spacekey()=1 then print "The spacekey is down." : inc tut:print tut:sync
loop
and then, it doesn't work, I cannot see anything .. I heard that the do doesn't like a CLS just
after him, so I tried this one, but it frozen my computer :
sync on:sync rate 40:do
cls
set cursor 0,0
if spacekey()=1 then print "The spacekey is down." : inc tut:print tut:sync
loop
So, I tried some others way to compress the code, and I come to this one :
sync on:sync rate 40:do
cls
set cursor 0,0
if spacekey()=1 then print "The spacekey is down.":inc tut:print tut
sync
loop
now, it don't freeze my computer anymore, but there's still a problem : it doesn't print anything when I don't press the spacekey ... what's appening ? the programm read the commands as if it was with an IF .. ENDIF =>
if spacekey()=1
print "The spacekey is down."
inc tut
print tut
endif
but it isn't what I want, so I cannot write anything after a IF THEN.. My new code is now :
sync on:sync rate 40:do
cls
set cursor 0,0
if spacekey()=1 then print "The spacekey is down."
inc tut:print tut:sync
loop
Okay, it work, now I try to compress more :
sync on:sync rate 40:do
cls:set cursor 0,0:if spacekey()=1 then print "The spacekey is down."
inc tut:print tut:sync
loop
oh no ! now, the ClS doesn't work, so I have to fund an other way... :
sync on:sync rate 40:do
cls
set cursor 0,0:if spacekey()=1 then print "The spacekey is down."
inc tut:print tut:sync
loop
Now, it work, it's a 4 lines programm, and with 5 commands per line, I can have it in two lines. Now, my question : is it the same for everybody, or only for me ??
I'm following John, but I'm not john.
Lol, it is funnier in french
