⭐Getting Started
Welcome to the world of somewhat friendly computing!
Loading the OS
Currently all ways to use the OS are through GameJolt initially, if any other ways to use it show up I will add them.
#1 - GameJolt Play
Step 1: Press play on GameJolt
Step 2: Profit!
#2 - GameJolt Download
Step 1: Download the sb3 file from GameJolt
Step 2: Open the editor through the link provided on GameJolt or here
Step 3: Load the project into TurboWarp
Step 4: Profit!
The difference between OS and SS commands
There are 2 forms of command that can be sent to the operating system, OS level commands, and SS (SmareScript) commands.
OS commands are specifically for OS related stuff (Who coulda guessed), basically meaning that they run at a "higher" level than SS. Typically they run faster than a SS command due to being programmed directly through Scratch instead of running the SmareScript interpreter.
SmareScript, or SS commands, go directly to the SS interpreter which is the embedded programming language of SmileOS. To run an SS command directly you have to go through the run OS command.
SmareScript
Core Concepts
SmareScript is an interpreted programming language with a pseudo compiler, created specifically for SmileOS.
Syntax was inspired by Python, Lua, C++ and Basic. I would argue the language is easier to learn than all of these, however it remains fully capable of doing pretty complex stuff.
When a program is run it will continue until the main thread reaches the end of the compiled code.
Hello World
Creating a "Hello World" program is very simple in SmareScript.
SS always starts at the first line of a program.
A more complex program
Here's a piece of software to benchmark the speed of a variable sized loop:
As you can see, it's not a very complex language! However it does have some quirks that do need explaining.
Variables
As seen above, declaring a variable in SmareScript looks like this
It should also be noted that the compiler is very stupid! So make every variables name unique than the rest! Otherwise this may occur:
I would recommend avoiding using memory addresses directly.
SmareScript also has no form of variable types, if you attempt to parse a string as a number it will parse as 0. The words "true" and "false" also have special properties, being parsed as Booleans.
Changing variable values
Changing the value of a variable is as simple as writing the variables name and using one of the 5 operators.
Click here to learn more about modulo
Getting user input
SmareScript doesn't have any built in functions to wait for a user to import text. It is possible, but you will need to create your own routine for it.
So how would we go about it? Well lets see how the example program dealt with this.
Now there's a lot to unpack here. Lets first go over func(), jump(), and call().
Functions
Functions in SS dont have reserved any reserved names to start a program, as programs always start from the first line.
Functions are also stupid like variables so you still have to careful with names
The function above will print "Hello World" indefinitely. Tip: You can end any program at any moment by press shift + C
Anatomy of a function constructor
Creating a function looks like this
Functions use square brackets to contain the code within. You dont have to use strings to define a functions name
What's the difference between jump() and call()
Both jump() and call() will start a function the same way, the difference comes when the function ends.
When a function reaches the end of the code it contains, it checks if it should continue after the line of code that started it.
Basically call() tells the function to continue on after the call() function when it ends On the other hand jump() will not do this, and the function will continue after its closing bracket.
Make sure when you need a function to loop back on itself to NEVER use call() as it will create a perpetually expanding list of addresses that it needs to jump to before it can continue.
Last updated