ScripticXLearn programming visually
Platform
Problems
Community
Leaderboard
Learn
Docs
MiniScript+ basicsVariablesOperators and expressionsInput and outputConditions and decisionsLoopsStringsSums, counts, and extremaDigits of a numberDivisibility and prime numbersNumeric sequences and recurrencesNumber basesFunctions and parametersRecursion
Examples
Basic programsConditionsInput and outputLoopsAlgorithmsWorking with textDigit problemsBase conversionsFunctions and recursionEncode text with a key
What's newHelpContact
Loading…

Examples

MiniScript+

ExamplesMiniScript+
Fundamentals
Basic programsConditionsInput and output
Programming patterns
LoopsAlgorithmsWorking with textDigit problemsBase conversionsFunctions and recursionEncode text with a key
Examples/Basic programs

Basic programs

Small MiniScript+ programs for output, variables, calculations, and first decisions.

On this page
Display two messagesStore and display a valueCalculate a resultMake a decisionWhat to change

These examples isolate one concept at a time. Open any block in the editor, run it, and then change its values.

Display two messages#

PRINT displays one value per instruction.

MS+hello.mspMiniScript+
1PRINT "Hello"2PRINT "World"

Expected result: Hello, then World.

Store and display a value#

The first instruction assigns a number; the second reads it.

MS+variable.mspMiniScript+
1score = 52PRINT score

Expected result: 5.

Calculate a result#

Expressions can reuse earlier results.

MS+calculation.mspMiniScript+
1first = 5 + 32result = first * 23PRINT result

Expected result: 16.

Expected output:

TXTPlain text
16

Make a decision#

The block runs only when the condition is true.

MS+decision.mspMiniScript+
1value = 102​3IF value > 5 THEN4  PRINT "Large"5END

Expected result: Large.

Change value to 3 and run the program again. No message is displayed because the condition becomes false.

What to change#

Change an initial value, predict the output, then run again. Assignment changes state; PRINT only displays a value. Without INPUT, all data already comes from the code. Read variables and operators.

NextConditions

On this page

Display two messagesStore and display a valueCalculate a resultMake a decisionWhat to change