プレイ日記
BoogerFace BlueDog100
How do I randomize letters?
3そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
If you mean to pick a random letter from a batch of predetermined letters, you can make a one-dimensional array with as many and whichever letters you want, then pick a random element from the array with the RND command. Example: DIM LETTERS[0] PUSH LETTERS,"A" PUSH LETTERS,"B" PUSH LETTERS,"C" PRINT LETTERS[RND(LEN(LETTERS))]
1そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
Also, the RANDOMIZE command only initializes the RND command series with a specified seed. You don't really need to use it or worry about it.
2そうだね
プレイ済み
返信[3]
親投稿
Zee Storybookten9
It's better to use methods that take up less memory. Though Oscar's method does work and has some advantages, here's my recommendation: use CHR$ combined with RND. PRINT CHR$(RND(26)+65) This can be slightly adjusted to use lowercase letters: PRINT CHR$(RND(26)+97) Then you'll use less memory.
2そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
@Zee I was actually going to post that method instead of mine, but I figured the array method may be a bit easier to understand and manipulate.
2そうだね
プレイ済み