Hmm, good points. I'm going to remove all the parens since they're unnecessary. I had felt that explicitly including == TRUE was more beginner-friendly but the latter approach is closer to real English so that's probably ideal. Thanks!
I've made many changes, particularly expanding GOTO and GOSUB. I'll probably split FOR loops and the additional notes on IF into a separate article as it's getting kind of long. Again, your thoughts appreciated! I'm rather burnt out for the day and wouldn't be surprised if I made a silly mistake somewhere.
Minor tpyo: The line GOTO REPEAT should be GOTO @REPEAT.
In choosing between HEALTH < 1 and HEALTH <= 0, a more experienced programmer would choose the latter, especially where HEALTH is not guaranteed to be an integer type (which of course it cannot be in SmileBasic V2, which has no integer type).
(I have also seen a game where, when HEALTH is 0, the player is alive, but doesn't have the strength to move. They have to wait until either they regenerate enough energy to move, or a monster comes around to finish them off. It added a tense, exciting 'race' between the two possible outcomes in some games!)
I wouldn't include the sentence "An interesting note: == TRUE is optional; ...", at least, not without indicating that it is optional for that particular instance (and some others), but not all others. It's too easy to infer that the commands IF B THEN ... and IF B == TRUE THEN ... behave the same. They do not, unless B is either TRUE or FALSE.
A label cannot "have any name you want": for instance, the label cannot include a space, or the + character, or any graphics or Japanese characters, or have more than 16 characters.
When you use phrasing such as "a more experienced programmer would choose the latter", I don't know if you are trying to suggest that I am not experienced, or just that a rookie might not know better. I don't think you meant it to be offensive, but it could read that way. I wouldn't say it's such a cut and dry situation; whether or not to consider 0.8 HP on a 1-100 scale to be alive or dead is a design decision, not a universal rule. Anyway, I had been thinking the < by itself would be easier to follow since it's a standard mathematical symbol, whereas <= and >= are slightly different than how you would write them on paper.
I had originally been writing IF X == TRUE instead of X to avoid going into too much detail and confusing the reader. I'll try to think of a good way to simplify it. I'll fix the bit on labels as well
As I said before, my idea of what makes an article 'good' is not the final word. You're absolutely entitled to disagree with me, and to leave sections the way they are despite my comments. You asked for my help, not for me to be boss of your writing, and I hope to honour that relationship properly.
I will stand by what I said, though. The health of a character partitions the state of that character into two distinct categories: alive and dead. The health is represented by a number. Numbers are partitioned, very naturally, at 0. An experienced programmer will map concepts in a way that causes the least amount of dissonance.
There is a partition at 1, yes, you can say numbers are divided into those greater than one, and those less than one, and one itself; or, partition numbers into those greater than 52.125, those less than 52.125, and 52.125 itself. But the most fundamental partition of numbers is at 0.
Or, put another way, the broadest qualitative aspect of health is alive or dead, the broadest qualitative aspect of numbers is nonnegative or negative. Where such a symmetry exists, choosing to break it is... well, untidy. When HEALTH is 5, that means 4.2 damage will kill you? Hm.
You're right that it is easier to recognize the code symbol < as the mathematical relation < than it is to recognize <= as ≤. As this relates the current issue, I would suggest that the expression HEALTH < 0 indicating death leads to a very natural interpretation of what HEALTH represents: the amount of damage that the player can endure before dying (for as long as that interpretation can make sense, i.e. for nonnegative numbers). "I can endure no damage before dying" does not mean the player is dead; indeed, the more natural interpretation of that sentence would be that the player is alive.
And I think starting out the tutorial with IF X == TRUE THEN ... is just fine... it's not that I advocate eliminating that kind of expression entirely, right from the beginning. I feel there should be one example of IF X THEN ... before the end - and you do have one example, in the line IF ENEMY THEN GOSUB @PRINTENEMY, so that covers that.
This is a good time to introduce two new types of values: TRUE and FALSE
I think a better phrasing would be, "This is a good time to introduce two new values: TRUE and FALSE". The values are 1 and 0, which are not of any particular 'type' (on a system level) beyond being numerical (and only the result values of some operators and some system variables). We can assign TRUE or FALSE to a variable like a number or string value also sends an implicitly misleading message, to call them like numbers, when (in this system) they are numbers. - You do mention this in the notes at the end, but I feel it's better to get everything straight from the first, rather than using unnecessarily misleading phrases first and correcting later.
Just so you know: I do consider your tutorials to be gifts, and I do not seem to be ungracious in receiving them. But, frankly, I don't consider myself the target audience. I'd be happy if I can help your gift be better received by those who would benefit from them. Overall, I approve. In particular, I like your @CALCDAMAGE example - I think it's effective at hinting how powerful subroutines can be, without requiring the reader to be a power programmer to recognize that. Above all else, do not let me stop you publishing what you think is fit to publish. It is a valuable contribution to the wiki.
OK, thanks again. I still personally prefer the approach of having beginners think in integers, but I'll probably go over better ways to approach the health problem (including <= 0 or using rounding) in a later lesson.
I should probably adjust the == TRUE again as you suggest. I'm glad you liked the CALCDAMAGE example, I spent an inordinately long amount of time trying to think of how to best illustrate GOSUBs in a small space and finally came up with that.
Here is a draft of the second part of the article, with FOR loops and that last part about IF: User:KevinFoley/Draft2
I still personally prefer the approach of having beginners think in integers
You don't say that anywhere. The assumption that everyone has the same simple-minded idea about health values - that they are integers - is unwarranted, and even insulting the intelligence of some of your readers, and confusing them. You're also showing them brittle code: even if the assumption of integer health values holds for the particular implementation coded by one developer, and the code runs fine and bug-free, that code will break if the next developer decides that health should be in units of one-tenth, rather than units of one. Don't start them out with bad coding habits, and making unstated assumptions and brittle code, start them out with good habits.
And whether dealing in integers or not, the value that partitions positive from negative is zero, so it's more natural to have the expression that partitions alive from dead have that value, zero, rather than another value that makes an assumption about the domain.
I should probably adjust the == TRUE again as you suggest.
I'm sorry if I didn't make myself clear, I was trying to suggest that as it is now (having IF XIS6 == TRUE THEN ... near the beginning and IF FOUNDSWORD THEN ... later) looks good to me, I don't think it needs adjusting.
In Draft2, you're missing some @ symbols, and one of your tos and some of your xs are not capitalized.
I would introduce NEXT statement with the form that includes the variable name. Again: start them with good habits. It is good programming practice to be sure you know, for each end-of-loop line, what the corresponding start-of-loop line is. Afterwards, perhaps, indicate that the variable can be omitted, but where there is a tool to help you keep your code straight, it's best to use it unless there's a compelling reason not to.
You should reorganize the section:
If we wanted to print the values from 3 to 6, we would change the previous example to start
FOR X = 3 TO 6
Each repetition of a loop is known as an iteration. This loop has 6 iterations (0,1,2,3,4,5).
Each repetition of a loop is known as an iteration. This loop has 6 iterations (0,1,2,3,4,5). If we wanted to print the values from 3 to 6, we would change the previous example to start
FOR X = 3 TO 6
Otherwise "This loop" appears to be referring to 3 TO 6 rather than 0 TO 5.
You might want to mention that a STEP value of 0 can be used to make infinite loops without GOTOs:
FOR FOREVER = 0 TO 1 STEP 0
' Code that will run, over and over, forever
Combining this with another concept you describe gives another structure that you might, or might not, want to include.
FOR STOP_LOOPING = 0 TO 1 STEP 0
' Code that gets executed at least once
' if it should get executed another time, leave STOP_LOOPING alone
' if this is the last time, set STOP_LOOPING to 1
Thanks for the feedback and corrections. Sorry I've been taking several days to respond in each case, I've been much busier lately, but these tutorials are still on my to-do list. I'm in a hurry at the moment but have made most of the corrections and started adding a thanks to you in the "notes" at the end of each tutorial.
Are you talking about preset sound effects and BGM for PTC3? I haven't found a specification for them...
It depends. I imagine the numbers already used in PTC2 are used for the same sounds in PTC3, so adding to the bottom of the list (with a note that they're PTC3 only) would make most sense. On the other hand, if the sound system gets a major overhaul in PTC3 so that it doesn't resemble PTC2, that might be an argument for a new set of pages.
Pixel wanted to do something and he misread the directions.
I can't rollback edits more than one deep, but I can try one after the other. I'm telling you because doing so remove the edit summary from the wiki's changes page and I didn't want you to freak out when your re-categorization disappears.
Edit: Turns out it does record it, but it still disappears in activity. Also that it can't be done one after the other. At any rate, your edit still doesn't show but the page should be as you left it.
I don't quite understand what's going on; for my edit to "List of Preset Music", rather than just an unexplained 'undo', I thought it would be more polite to give a reason: a direct quote from the Category:Audio page that clearly indicates that it belongs.
As long everyone agrees that the categories end up being right, the purpose of the edit summary disappears, and I don't mind if you remove it.
I think he understands, he just thought I meant all the pages except BEEP- and DRUMDEMO, when I said all the programs (except those two). You obviously wanted to make it clear why it was in that category, so I didn't want you to think your statement was being ignored.
Er, I'm not sure that applies anymore, but you also might try contacting them about the other bugs at "email@example.com" (at least, I think that's the right address for that. It's what is listed under the English company information page.)
Well, it's a wiki. If you think it's worth adding now, go right ahead. I wasn't going to add anything about V3 I until I actually have V3 and have seen for myself, but I won't compel you to do the same.
I suppose it would be of no use to anyone to have it on the page at this time, and if they wanted to know that, they would be looking at the "Petit Computer 3" page. If I find any information on the specific syntax, I may add that.
I'm not sure how to contact the admins, hopefully one will see this.
I'm seeing two problems with the wiki. First, when I create a new page, it appears on the home page of the wiki in a box titled "New programs", even though I never indicated that the page was about a program (at least, I don't think I did).
Second, I created a page "/ (Operator)", and when I try to create a link to it in the "List of Operators" page, the system seems to be getting confused by the fact that / is a delimiter in URLs: w://x/y/z.
Right... not saying your suggestion is wrong, just offering an alternative suggestion that I imagine would be much easier to implement. It does not fix the problem "the box titled 'New programs' contains stuff that's not new programs", but it does fix the problem "the box contains stuff other than the title of the box indicates", making the first problem moot.
You're right; I don't think we should make assumptions about what the new page should be. I'm not the one who made the home page box thing, but hopefully Lumage/TriforceOfKirby can fix it. Or if not, I'll go figure it out myself lol.
OHHH, goodness, I thought you were talking about something entirely different. I was being silly and thought you said that new pages automatically had the "Programs" category placed on it. If it's just a header you're unhappy with, I can fix that. Sorry about that; I had just woken up when I read this page and I guess I wasn't fully aware of the situation.
I wasn't unhappy with the header of the box per se (nor was I unhappy with of the contents of the box per se), I was unhappy that the header of the box and the contents of the box didn't jibe. One solution is to try and change the contents to match the header, which SmokedSausageFTW wrote about, another solution was to change the header to match the contents. I see you've taken the second option.
While I'm grousing, I may as well bring up another point. When I click "Edit" on a page, the editing page comes up - in bits and pieces (perhaps my computer/browser is a bit slow). While the page is loading, I can click in the "Add a summary of your edit" box and start typing, and when the page finishes loading, the cursor moves to the big editing box on the left for editing the contents of the page. So, I end up with half the summary in the summary box, and the second half at the end of the page's main text. It is aggravating. A rule of interface design is: don't ever move the focus (text-entry cursor, or selected button, that kind of thing) from where the user has indicated they want the focus, unless there's a good reason to.
There's also a flaw in that the wiki didn't give the page the title I told it to give the page - it capitalized the first letter.
(- I'm not mad, BTW, but I do believe things should be improved where the cost isn't unreasonable, and that can only happen when the areas that can be improved are known. So, I make them known.)
I also don't think I can change the Wikia code which capitalizes the first letter of the page; this is probably done on Wikia's end, and it's not like I can hack into their servers and tell them to change their naming scheme lol. I'm not familiar with all the editable Wikia script pages though, so maybe it's possible. I just have a hunch that these are things we can't change on our side; we have to work with what Wikia gives us, and these back-end things are done on their servers.
I'll try, but I'm sure you know how contacting big companies about little problems goes. They may not seem little to us, but to them, it's not nearly as important as the thousands of other things they've got to deal with. Things that are obviously broken will come before annoyances with implementation issues. I'm glad that you're observant enough to notice these flaws and passionate enough to try to fix them, but please don't be disgruntled if nothing comes of this.
I'll let you know what Wikia says about these two things.
I assumed that the majority of pages being made would be programs, and any that aren't would not cause so much of a problem for a complaint to be made.
I can check again if there is some way to filter the results it gets from the RSS feed, but I doubt it, because of the way it is set up. Em... Well, there is another way to do it that I really REALLY don't like.
And no, it is not case sensitive and only looks for the sequence of letters. Of course, I'm sure there pages that would still slip through, but this accounts for the mass of command type pages. What do you think? Do you want it?
The original problem was with the assumption that any new page would be for a program... I don't think the proper fix is to assume that any page that's not for a program will have one word from a specific list, and any page that is for a program will not. Better not to make any assumptions you don't need to. You know you have code which will show new pages, so when the title of the box is "New pages", everything's fine.
I'd agree, if it wasn't organized such as it is. There are very few cases I can think of where new resource pages that don't fall into one of those categories, and would therefore contain the term in the page title.
I originally suggested the box because we get many visitors who only are here to download programs. Having a "correctly titled" section that has results that they don't want doesn't help so much as having a sometimes incorrectly titled box that has what they are looking for.
Right, so it seems our conflicting viewpoints comes down to different priorities. I'd like the page to be correct and accurate even if it's not the most relevant or attention-grabbing information, and you'd like a feature that will appeal to certain users even if it doesn't do a perfect job. (This is the same kind of tension I see between the marketing department and the engineering department... and, a successful company needs both, generally.)
Well, I'm not the decision maker. I'm not making demands either, this is just FYI. Consider this a memo from the engineering department to management, as a contrast to marketing considerations. The decision is in management's hands.
It may be possible to develop a system that just maintains a list of pages in the "Programs" category. I believe it's possible to 'subscribe' to the "Programs" category, so that when a page is added, you get an e-mail. I haven't investigated how RSS feeds work, but could that 'subscribe' function be tweaked to work the way we want? Or, could the e-mails be directed to a different system that maintains the list, and the front page queries that system when it renders the "New programs" box? (Of course, the next question management will ask itself is: is it worth the trouble, considering the alternate implementation of filter-words you suggest?)
"Thanks for contacting us. It is not possible to not automatically capitalize page titles, as the software relies on pages being named that way. However, you can make it look like a page has a different title using the DISPLAYTITLE magic word - it doesn't change the URL, only the displayed page name. You can read more about that magic word towards the end of https://www.mediawiki.org/wiki/Help:Magic_words#Technical_metadata
Regarding editor focus switching - we're currently working on a completely overhauled visual editor which shouldn't have these kinds of issues. You can read more about it here: http://community.wikia.com/wiki/Help:VisualEditor. (As such we're unlikely to tweak the older visual editor much further - it'll get phased out, eventually.)"
"Resources" seems like a less informative name for a category than "Programming"; it's like replacing "This is something useful for making programs" with "This is something useful". Some people don't visit the wiki to make programs, they're just looking for games or applications to download, so there's a difference. But, it doesn't bother me. Every wiki has its own odd ways, I guess.
Well, that's why I made it "System Guides". The over-arching category is "Resources", so even if we did have a category called "Programming", it would still be under "Resources". So really I replaced "Programming" with "System Guides".