プレイ日記
ĦHarry Ramstrong
Somebody mentioned that Strings are nothing but arrays. So, then, this code comes to mind. I use output variables as auto/local variables. Oh, dear. Abuse of SmileBasic already. :p
3そうだね
プレイ済み
返信[1]
親投稿
CJ CJ_Metzger
Oh, Ramstrong! I haven't heard from you in a long time! I'm randomous from Nintendo Life.
1そうだね
未プレイ
返信[2]
親投稿
ĦHarry Ramstrong
Looking at your Mii, I thought that was you even before reading your text. Funny, eh? I don't know what you look like. Still don't. I'm ultra busy since I take on a new job. I'd be lucky to get 1 hour per day. So far Pokemon Shuffle got it, but I may have to drop it soon in favor of this.
1そうだね
プレイ済み
返信[3]
親投稿
ĦHarry Ramstrong
I'm having trouble changing the loop from FOR loop to WHILE loop. I keep getting error: Uninitialized variable in 0:11. Yet, the FOR loop version works just fine.
1そうだね
プレイ済み
返信[4]
親投稿
CJ CJ_Metzger
Haha, that is funny! I haven't had time to work with SmileBASIC yet either; I'm hoping to be able to make stuff soon too!
2そうだね
未プレイ
返信[5]
親投稿
L. Lohadaa
I can't read codes properly yet, but does PI in line 6 do anything in the WHILE loop? Looks to me it's for the FOR loop.
1そうだね
未プレイ
返信[6]
親投稿
ĦHarry Ramstrong
Got it! It seems SB doesn't like uninitialized return variables. It's also picky regarding function call format. Oh, well. Keep on learning new things, I guess. :)
1そうだね
プレイ済み
返信[7]
親投稿
calc84 calc84maniac
I understand the concept of using output variables as auto variables, but is there any real purpose when you're always assigning an integer? Seems messy to always have to put the output value somewhere. Also, my mind is being blown right now that functions and commands with a single OUT variable are completely interchangeable.
0そうだね
プレイ済み
返信[8]
親投稿
ĦHarry Ramstrong
Yep. It is messy. Some languages allow you to ignore them when doing function call, hence my earlier confusion. I'm still learning things, though. The normal way to do it is via explicit stack, but push/pop is an extra line. Array variable is an extra var. Of course, if you know of a better way, feel free to share! :D
0そうだね
プレイ済み
返信[9]
親投稿
calc84 calc84maniac
You can use VAR to specify local variables. I usually use OPTION STRICT, which forces you to declare variables before they are used, so it's clear when I'm accessing a local variable in a function rather than a global variable.
1そうだね
プレイ済み
返信[10]
親投稿
ĦHarry Ramstrong
Updated version using VAR. Thanks, calc84! Looking good!
0そうだね
プレイ済み
返信[11]
親投稿
Mike Bluerobin2
Hello I am pixelrobin (bluerobin2)
0そうだね
プレイ済み