ScripticXLearn programming visually
Platform
Problems
Community
Leaderboard
Learn
Docs
BasicsVariablesLoopsInput / Output
Examples
BasicsLoopsConditionsAlgorithms
What's newHelpContact
Loading…

Documentation

MiniScript+

DocumentationMiniScript+
Getting started
MiniScript+ basics
Language basics
VariablesLoopsInput and output
Documentation/Input and output

Input and output

Read values from the user and present results clearly with INPUT and PRINT.

On this page
Display outputRead inputComplete exampleInput checklistRepeating input

Input brings values into a program. Output communicates the program's result.

Display output#

PRINT accepts text, numbers, variables, and expressions.

MS+MiniScript+
1name = "Mara"2score = 953​4PRINT "Student:"5PRINT name6PRINT score + 5

Use short labels when a number would otherwise be ambiguous.

Read input#

INPUT pauses the program, reads a value, and stores it in a variable.

MS+MiniScript+
1INPUT age2PRINT age

The variable becomes available to every instruction that follows.

Complete example#

This program reads two values and prints their sum:

MS+MiniScript+
1PRINT "First number:"2INPUT first3​4PRINT "Second number:"5INPUT second6​7sum = first + second8PRINT "Sum:"9PRINT sum

Input checklist#

  • Give every input a meaningful variable name.
  • Explain what value is expected before reading it.
  • Validate ranges when only certain values are accepted.
  • Keep the final output concise and unambiguous.

Testing

Run the same program with normal values, boundary values, and unexpected values. This makes assumptions visible before they become bugs.

Repeating input#

Combine INPUT with a loop when several values must be processed.

MS+MiniScript+
1total = 02​3FOR index = 1 TO 34  INPUT value5  total = total + value6END7​8PRINT total

The program reads exactly three values and prints their total.

PreviousLoops

On this page

Display outputRead inputComplete exampleInput checklistRepeating input