プレイ日記
King 5kittens645
Ok, so i haven't been working on Y-D-B for awhile, but now i need help with something. That something is making dice. Basically i need to know how to store variables in ANS$ code because I've been trying at it for awhile now, and i still can't find out how to do it.
3そうだね
プレイ済み
返信[1]
親投稿
King 5kittens645
Here is another screenshot if it helps. Anyway, to say what i said better, i need to know if it is at all possible to store variables inside string. I just need a function that is like rolling dice, then depending on what number it is, it sends you to a different label (or space).
0そうだね
プレイ済み
返信[2]
親投稿
King 5kittens645
And one more screenshot. Basically i am trying to get it to read which ANS$ it got, then depending on which answer you got, it sets the ROLL variable to that number, then it prints the number below. But again, i can't get it to work, because instead it just prints "6" no matter what number you got, and i have no idea why.
0そうだね
プレイ済み
返信[3]
親投稿
Jacob CoolChalk
I'm pretty sure you need to use RND so it has a random number. Just make a variable with RND next to it. A=RND (6) the six is the highest the random number can go. The you should have the rest correct. IF A==1 etc.
0そうだね
未プレイ
返信[4]
親投稿
King 5kittens645
I'm not exactly sure what you meant, but i just ended up with what i had before, which isn't exactly what i wanted. If you can, could you give me an example program of what you were talking about, or maybe a screenshot? All i need is a way to store variables with strings... (well, if that is possible)
0そうだね
プレイ済み
返信[5]
親投稿
*J.P.* DEV NEWPICY3
i dont see how using arrays and strings would be helpful here because it just makes things a lot more complicated- are you trying to make it save each roll to look at later or use? or is it just a random roller your looking for?
0そうだね
プレイ済み
返信[6]
親投稿
Darkcon SGMXZYDarkcon354
@roll2 F=rnd(6) ' 0-5 remember that ans$[0]==0 then roll$="0" ans$[1]==0 then roll$="1" 'repeat above code to ans$[5], ect. ' finish code below by adding X,Y,Z locate X, Y,Z:print roll$ 'if you use gosub add RETURN here
0そうだね
プレイ済み
返信[7]
親投稿
Darkcon SGMXZYDarkcon354
sorry ans$[f]==0 then roll$="0" ans$[f]==1 then roll$="1"
0そうだね
プレイ済み