プレイ日記
NagatoYuki newtonyic1
it says syntax error on line 71 can anyone help me
6そうだね
プレイ済み
返信[1]
親投稿
Stewart segludian
I can help. You are running into an assignment vs. comparison problem. If you say f=1 you are assigning the value 1 to the variable f. If you say something like f==1, you are checking is the variable f equal to 1 and returning a true/false depending on if it is or not. So on line 71 the first = should be ==, but your second = should remain just =. The >= is fine as is too.
3そうだね
プレイ済み
返信[2]
親投稿
Scientist Speedy1101
Declaration: f=0 Comparison: IF f==0 THEN blabla
1そうだね
プレイ済み
返信[3]
親投稿
NagatoYuki newtonyic1
got it
0そうだね
プレイ済み
返信[4]
親投稿
L. Lohadaa
Just to throw it out there, the reason for this change is because in the original BASIC you needed the LET command (e.g. LET F=1) to assign, so the IF command could use the same single equal sign without problems. But since SmileBASIC omitted LET, another symbol had to be created for IF. They chose the double equal sign ==.
1そうだね
未プレイ
返信[5]
親投稿
NagatoYuki newtonyic1
i knew the = and == special functions but i couldn't see it right here. i got a question. how do you use rnd( and randomize. i want to randomize 1 and -1 so i can use it.i'm trying to make pong and randomize the starting point of the ball from 14 to 28 horizontally and randomize it's starting direction
0そうだね
プレイ済み
返信[6]
親投稿
NagatoYuki newtonyic1
that's how far i've gotten. also how can i get rid of the traces of the ball without adding blank spaces?
0そうだね
プレイ済み
返信[7]
親投稿
V360 TheV360
You could use CLS, then redraw the border and ball. For example: WHILE 1 VSYNC 1 'Wait a frame before advancing CLS 'Clear text screen ... draw border and ball ... WEND
0そうだね
プレイ済み
返信[8]
親投稿
Stewart segludian
If you just want to move text around, maybe the attached will help.
1そうだね
プレイ済み
返信[9]
親投稿
NagatoYuki newtonyic1
i'm not that advanced Steward. but i'll copy your program and see if i can learn something
0そうだね
プレイ済み
返信[10]
親投稿
Stewart segludian
For a random number between 14 and 28, I think RND(15) + 14 should do the trick.
1そうだね
プレイ済み
返信[11]
親投稿
NagatoYuki newtonyic1
what does rnd(15) mean?
0そうだね
プレイ済み
返信[12]
親投稿
Stewart segludian
rnd gives you a random number between 0 and the entered value - 1. You only get whole numbers. If you want numbers with a decimal point then you would want rndf (hope I spelled that right) which gives you a random number between 0 and 1 which you could scale to the desired range by multiplication.
2そうだね
プレイ済み