プレイ日記
McCutcheon CallistoESHE
I'm still rather green when it comes to BASIC. How would you use "FOR" and "PRINT" to display variables in this situation?
2そうだね
プレイ済み
返信[1]
親投稿
PChicken NerdChicken
Okay, you need to set up an array the right way to mak this work: DIM OUTCOME[<amount of elements>] OUTCOME[0]="String0" OUTCOME[1]="String1" OUTCOME[2]="String2" And then... FOR Y=0 TO LEN(OUTCOME[]) #You don't need step if it's only 1 in SmileBASIC #blah blah ?OUTCOME[Y] #[]is the array param thingy, you put the element array coordinate you want NEXT #Definitely need this, lol
0そうだね
プレイ済み
返信[2]
親投稿
PChicken NerdChicken
Oh, and unless you put OPTION STRICT at the beginning of your code you don't need to put $ for string vars. oh man i love being helpful
1そうだね
プレイ済み
返信[3]
親投稿
McCutcheon CallistoESHE
I guess a DIMension would be appropirate here. Is there a more impractical way to combine the names of variables?
1そうだね
プレイ済み
返信[4]
親投稿
McCutcheon CallistoESHE
Oh, I got it.
1そうだね
プレイ済み
返信[5]
親投稿
Aaron Krondelo
Yep, but you do need $ regardless of STRICT. That only requires you to specify variables.
0そうだね
プレイ済み
返信[6]
親投稿
PChicken NerdChicken
What? D: I am losing my mind
0そうだね
プレイ済み
返信[7]
親投稿
PChicken NerdChicken
No you don't! I just checked.
0そうだね
プレイ済み
返信[8]
親投稿
PChicken NerdChicken
Oops, didn't check it right, sorry. (yep, i'm losing my mind)
0そうだね
プレイ済み
返信[9]
親投稿
McCutcheon CallistoESHE
I'm a little bit old fashioned. I still use: "push=button(2)" "if push=16 then goto @A_BUTTON" To use button responses.
0そうだね
プレイ済み
返信[10]
親投稿
McCutcheon CallistoESHE
Er, "if push==16," sorry
0そうだね
プレイ済み
返信[11]
親投稿
Aaron Krondelo
easier to just do: B=BUTTON() IF B AND #A THEN do this IF B AND #B THEN do this IMO
0そうだね
プレイ済み
返信[12]
親投稿
PChicken NerdChicken
If you want to wait for a button: WHILE B != <Button code here> B=BUTTON() WEND
0そうだね
プレイ済み
返信[13]
親投稿
PChicken NerdChicken
Oh, the above one was the complicated/multiple button way: WHILE BUTTON() != #A WEND
0そうだね
プレイ済み
返信[14]
親投稿
PChicken NerdChicken
You should use WHILE, FOR, or REPEAT to make loops, and if you want your program to look kinda nice, use @labels
0そうだね
プレイ済み
返信[15]
親投稿
McCutcheon CallistoESHE
Regardless, I still use numbers to represent buttons. Its just easier for me :>
0そうだね
プレイ済み
返信[16]
親投稿
PChicken NerdChicken
I used to as well.
0そうだね
プレイ済み