Archiverse Internet Archive
投稿のみ 投稿と返信
前のページ(最近)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
次のページ(過去)
返信[1]
親投稿
Ed CPFace
If you've never programmed before, it IS very complicated at first. If you have programmed before, this is actually one of the simpler ways to make graphic games, especially on a console. Either way, you might consider getting it just for the games other people are making.
2そうだね
プレイ済み
返信[16]
親投稿
Ed CPFace
@Frood This DOES seem to be the way to give Slot 1 its own variable pool, using EXEC instead of USE. It seems like Slot 1 variables aren't visible in Slot 0 programs, but you should be able to access them through functions.
0そうだね
プレイ済み
返信[15]
親投稿
Ed CPFace
@calc84 YOU GOT IT! I could have sworn that I tried that already and it didn't work, but... THAT DID IT! I'll have to make some adjustments, but I think I know what to do from here. THANK YOU!
0そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
So excited!
1そうだね
プレイ済み
返信[13]
親投稿
Ed CPFace
@zag Go to smilebasic.com and check out the full instruction list. Look up the instructions I used here to see their full definitions so that you can learn how to use them to create the effects you want.
1そうだね
プレイ済み
返信[12]
親投稿
Ed CPFace
@zag
1そうだね
プレイ済み
返信[10]
親投稿
Ed CPFace
@Frood Hey, no problem! Your post IS good general advice. :)
1そうだね
プレイ済み
返信[7]
親投稿
Ed CPFace
I know I'm sort of trying to force OO ideas into a structured environment, and rather inelegantly at that, but if I could make a variable defined in Slot 0 visible to a function in Slot 1, it would at least look very neat to someone using it to write a program. I suspect I'm going to have to ditch rigorous design for ease of use and just have users copy/paste my functions into their programs.
1そうだね
プレイ済み
返信[6]
親投稿
Ed CPFace
I guess there's only so much you can say about the subject without seeing my code, but I do already have sort of "black box" functions that deal with data in a way the programmer never has to see. My trouble is how to create that data in the first place in a way that my functions can see and, if possible, the programmer doesn't have to bother with.
1そうだね
プレイ済み
返信[5]
親投稿
Ed CPFace
If I could give the user a syntax like this: USE 1 INITGUI(MAXELEMENTS) NEWGUI BTN ID,"START",X,Y,#RED ... that would be perfect. But I don't see how I can do that given the way SmileBASIC defines variable scope.
1そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
The problem is that I need these data structures to be visible to an entire family of functions. Passing a structure into a function only passes it by value, and anything defined inside a function is a local variable that's erased when the function ends. I know there are workarounds - DEF FUNC X OUT X - but one of my goals with this library is to make the syntax as simple as possible.
1そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
Check out smilebasic.com and take a read through the online instruction manual. If you've never programmed before, making your own programs might be overwhelming, but the community is busy making games and utilities that you can download and play with it.
2そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
Does anyone know a way to make my variables global across all Slots? The only other solution I can think of is that people will need to copy and paste my functions into their program to get them to work.
1そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
I define my variables globally in Slot 0 and USE 1, which contains my library. But when I try to use the function NEWGUI, it gives me a type mismatch error on line 18, where I try to FILL my array. The conclusion I've come to is that my global variables in Slot 0 are out of scope for any functions running from Slot 1.
1そうだね
プレイ済み
プレイ日記
Ed CPFace
I'm having some problems with the USE command relating to the scope of my variables. My functions make use of global variables to talk back and forth to one another. Ideally, someone who uses my library should have the option to load it into another slot and USE it from there.
2そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
To be honest... I don't think I do enough with data structures that I would need it. But I saw your example. I think I get the gist of it if the need ever comes up.
0そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
My best guess is that they wrote a program that made a string out of the characters they wanted, saved it to a text file, opened it in the editor, and copied and pasted.
1そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
Lines 1-4 establish 10 variables. If you do the math, each variable is a digit equal to one less than the number of underscores in its name. The function _$ takes three numbers and returns the character you get by combining the characters. So _$ 1,0,3 returns ASCII character 103. So lines 5-9 print out a message one character at a time. Looking up the codes, you get "Hello World!" Fun puzzle!
3そうだね
プレイ済み
プレイ日記
Ed CPFace
Quick tip! LEN can be used to return the number of elements in any array!
4そうだね
プレイ済み
返信[5]
親投稿
Ed CPFace
@Salkcin989 Petit Tanks! It's a tank war game that I started on a couple weeks ago, but I put it down when I realized that I'd need a good GUI library if I was ever going to get anywhere with it. There's a WIP version if you want to try it. Public Key [ND251EDD]
1そうだね
プレイ済み