text stringlengths 0 897 |
|---|
The wiki is cross-referenced using tags that appear on the bottom of most pages, making it easy to explore and find related topics. It also features a large number of "how to" articles demonstrating how to solve specific problems, for example, how to move a sprite towards a target. Just type "how to" into the Search ... |
MiniScript forums |
: <https://forums.miniscript.org/> |
The MiniScript forums are an online discussion board for the MiniScript community. Posts to the board are divided into topics, similar to Discord, but while Discord messages are real-time and tend to disappear quickly, posts to the forums stick around for a long time and end up indexed by search engines such as Google... |
## Third-Party Sites |
These are sites that are not directly associated with the MiniScript maintainers, but nonetheless include some useful MiniScript-related content. |
YouTube |
: <https://youtube.com> |
I doubt I have to explain YouTube to anyone! The 900-pound-gorilla of video-sharing sites, YouTube includes videos about just about everything, including MiniScript. Unfortunately it can be a little hard to find, especially since a recent (and completely unrelated) scripting language related to Bitcoin has also start... |
There is a MiniScript channel which contains official MiniScript videos; you can find that via <http://bit.ly/miniscript-channel>. If you're a visual learner, you may find this a helpful resource. |
Reddit |
: <https://www.reddit.com/r/MiniScript/> |
Reddit is a discussion site that bills itself as "the front page of the internet." It's divided into topic areas called "subreddits," and the URL above takes you directly to the subreddit for MiniScript. At the moment, this area gets less traffic than the Discord server or forums, but if you like Reddit's format or a... |
StackOverflow |
: <https://stackoverflow.com/> |
StackOverflow is a question/answer site for programmers. No, it's *the* question/answer site for programmers! Professionals and serious hobbyists frequently make use of this site when they have a problem. The first step is always to search for an existing question; very often if you're stuck on something, someone el... |
When that fails, then you can post a new question here, and very often get a good answer within days. Other users will vote on which answers are the best, and the original questioner can mark one answer as "accepted," all of which helps later searchers find an answer likely to work. |
StackOverflow can be a little intimidating to new users; it has pretty strict guidelines about what constitutes a programming question, not duplicating a previous question, etc. Don't let it scare you! Everyone there is there either to get help, or give help (or both). And everyone was a first-time user at some poin... |
## Other places to find MiniScript code |
The last two sites we'll consider in this chapter are not really discussion sites, though they do have some limited commenting features. They're really *project* sites, where people who have put a lot of work into a MiniScript or Mini Micro project have decided to share it with the world. These can be really helpful ... |
GitHub |
: <https://github.com> |
GitHub is a very popular source code hosting site, based on the *git* version control system. Using git, you can push a copy of your project (source code, images, and other files) up to GitHub, where other people can clone your project to make their own variation, or even suggest fixes or enhancements to yours. Use o... |
In the meantime, though, you can browse other people's projects on GitHub. On the wiki under "open-source projects" you will find a list of games/apps/programs written in MiniScript; those are mostly or entirely links to GitHub. Click on any of those to go to the GitHub project, and then start clicking on file or fol... |
Itch.io |
: <https://itch.io/games/tag-minimicro> |
Itch.io is a project hosting site that is mostly about serving compiled, ready-to-run games and other software projects. However, in the case of Mini Micro games (which you will find using the URL above), you can usually get to the source code just by pressing Control-C during the game, and then poking around. |
D> You can *usually* but not *always* do this because it is possible to package your Mini Micro game in such a way that breaking with Control-C is disabled. To learn how, go to the MiniScript Wiki and search for "bootOpts.grfon". |
The itch.io community is generally very friendly and supportive. If you like any of the Mini Micro games you find here, post a comment to let the author know! And someday, when you've created something fun or interesting, consider posting it as a project here for others to enjoy. You can package your app as a web bu... |
## The tip of the iceberg |
The internet is vast, and of course we've only scratched the surface with this survey. It's also always in motion, so by the time you read this, there may be other good places to get help or find other MiniScript users. Don't be afraid to poke around, and ask the folks you meet in one place if there is anywhere else ... |
This has been a short chapter, if you only read it — but as always in this book, you learn more from *doing* than from merely reading! So if you haven't already, I highly recommend you go check out these sites. All of them are free to use and welcoming to newcomers. |
A> **Chapter Review** |
A> - You reviewed the official MiniScript sites and resources. |
A> - You learned about some third-party sites that also have some MiniScript content. |
A> - You discovered project-hosting sites where you may find sophisticated MiniScript programs to learn from. |
{chapterHead: "Day 3: Variables and Comments", startingPageNum:27} |
{width: "50%"} |
 |
Q> Any fool can write code that a computer can understand. Good programmers write code that humans can understand. |
Q>— Martin Fowler (software developer and author) |
A> **Chapter Objectives** |
A> - Learn how *variables* are used to hold values in memory. |
A> - Use *comments* to leave notes for your future self (or others). |
A> - Start thinking about how to write code that is clear and easy to read. |
## Keeping values for later |
So far, every program you've written has created values right where they are used -- mainly on a `print` statement. |
```miniscript |
print "Hey " * 3 |
``` |
The example above multiplies `"Hey "` by three, resulting in `"Hey Hey Hey "`, and then immediately passes it to the `print` function. This is like assembling a sandwich in the kitchen, and then immediately eating it. |
There's nothing wrong with that; in fact it's a perfectly fine way to eat a sandwich. But sometimes your recipe is too complex to do all at once; some steps need to be done ahead of time. Or sometimes you want to make your sandwich in the morning, and eat it at lunch. |
In such cases, you need to store your intermediate results somewhere. Let's imagine you're more organized in the kitchen than most people (including me!). You have a large number of tupperware containers, and a dry-erase marker you use to label each one whenever you put something in it. So you might build a sandwich... |
In computer programming, we have a similar concept, but the tupperware containers are called *variables*. A variable has a name (the label) and stores a value, so you can easily retrieve it later. You store something in a variable by using the equals sign, called the *assignment operator* in this case. |
variable |
: a name associated with a storage location that can hold a value |
assignment |
: storing a value in a variable by use of the `=` operator |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.