text
stringlengths
0
897
- synthesized and digitized sounds
- mouse and keyboard input
- gamepads and joysticks
- simple networking
Using Mini Micro, you can write your own games and simulations, package them up for any platform (including web browsers), and share them with your friends or post them on sites like itch.io. The rest of this book will teach you what you need to know.
## Installing Mini Micro
You can download Mini Micro via the MiniScript home page at <https://miniscript.org>. Just click the link that says "Boot up the Mini Micro".
That will probably take you to a page that actually has Mini Micro running in demo mode, right within your web browser. Scroll on down and look for the download links, then click the one for your platform (macOS, Windows, or Linux).
On Mac or Windows, the download is a zip file. Double-click that to open it up, and in the case of Windows, you should then drag the contents out into another folder (i.e. don't try to run it directly from the zip file). On Linux, the download is a gzipped tar file; unpack that and place it wherever you like.
Then double-click the Mini Micro application. It should open a window that looks something like this:
![Mini Micro.](MiniMicroBoot.png)
The details will likely be different: the version number and build date will probably be later than this, and the tip that appears on the third line is selected randomly on each run. But if you see a welcome screen that looks basically like this, with no error messages, then you are ready to go!
If you do see an error message, the problem is most likely that it can't find or create a place to store your data. In that case, notice the two slots at the bottom of the window, below the black screen. Those represent *disk slots*. Click the top disk slot, and choose "Mount Folder..." from the menu that appears. ...
Before you move on, go back to the web page where you downloaded Mini Micro, and scroll down a bit more. You should see a link that says "Mini Micro Cheat Sheet". Download that too; it is a very short PDF that summarizes all the special Mini Micro functions and classes.
## Basic Commands
After the welcome messages, you will see a `]` prompt with a boxy blinking cursor, very much like a terminal window. This is Mini Micro's command-line interface. It is a REPL (Read, Eval, Print Loop) just like command-line MiniScript. So everything you've learned in the last week still applies! But there are some i...
First, command-line MiniScript is a thin layer on top of your native operating system (Windows, macOS, or Linux). So, for example, you have to use backslashes on Windows to separate parts of a file path. But Mini Micro is a virtual computer with its own operating system, and works the same regardless of what kind of ...
Similarly, command-line MiniScript is meant to integrate with the built-in command shell of your system. You navigate in your file system with commands like `cd` and `ls` or `dir`, which are all built-in shell commands, not part of MiniScript; and then you run `miniscript` as a separate command when you want to enter ...
In this regard, Mini Micro is easier than command-line MiniScript. The latter really requires you to know at least two languages: MiniScript, and your command shell language. These have different syntax that you have to keep straight. But in Mini Micro, it's all MiniScript, all the time; you only need to think about...
However, you will still need some commands for navigating around your virtual computer! These are very much like the ones you used in your Windows or Unix/Linux shell, but they are actually just MiniScript functions. These functions are predefined for you as part of the Mini Micro startup process, so they are ready f...
{i:"Mini Micro, commands;commands, in Mini Micro"}
| `pwd` | print working directory |
| `cd` *path* | change working directory |
| `dir` | list directory contents |
| `mkdir` *path* | create a new directory |
| `delete` *path* | delete a file or empty directory |
| `view` *path* | preview (almost) any file |
| `clear` | clear the screen |
| `load` *path* | load a program into memory |
| `run` | run the currently loaded program |
| `edit` | edit the currently loaded program |
| `save` | save the current program to disk |
| `reset` | clear loaded program and variables |
Try it! Type `pwd` into Mini Micro right now, and press Return. You should see:
```terminal
]pwd
/usr/
```
The current working directory on startup is "/usr/", which represents the root directory of the user disk.
user disk
: the place where all your files are stored; selected with the top disk slot, and referenced in file paths as `/usr`
system disk
: the read-only disk where all of Mini Micro's built-in code, images, sounds, and other data are stored; referenced in file paths as `/sys`
Now try listing the contents of your user disk with `dir`:
```terminal
]dir
/usr :
(Directory empty)
```
Assuming you just downloaded Mini Micro a few minutes ago, it's not surprising your user disk is empty! Remember, this is just your *Mini Micro* user disk. It's *not* the disk of your host (desktop PC) system, though of course ultimately your Mini Micro files must be stored there. We'll get more into the relationshi...
## Running the Demos
You may have caught above that there are two disks available in Mini Micro: `/usr` and `/sys`. (There can actually be a third, /usr2, which accesses a disk file or folder mounted in the second disk slot. But let's ignore that for now.)
The `/sys` disk is fun and important because it contains all the built-in goodies that come with Mini Micro. This includes a bunch of fun demos (demonstration programs) and mini-games. Our goal for today is just to play with these. If you thought yesterday was hard work, don't worry — today is pure fun!
Use the `cd` command to switch to the `/sys` disk, and then `dir` to list the directory contents.
```terminal
]cd "/sys"
]dir
/sys :
data/ DIR 2020-02-23 06:39:44
demo/ DIR 2020-03-26 12:32:28
help/ DIR 2019-11-16 08:02:50
lib/ DIR 2020-03-13 11:54:12
pics/ DIR 2020-03-13 13:02:16
sounds/ DIR 2020-03-13 12:42:50
startup.ms 8607 2020-03-17 17:16:14
tips.txt 1229 2019-08-09 16:41:40
```
Notice that we had to put quotation marks around `"/sys"` in the `cd` command. That's different from any Unix/Linux/Windows shell. Why is that?
D> Stop and see if you can answer that question yourself. Cover up the rest of the page below while you think about it. Hint: remember that Mini Micro doesn't have a separate command shell; it's all MiniScript, all the time.