Introduction
SimpleScript is a beginner-friendly scripting language designed for ease, power, and readability. Whether you are new to programming or an experienced developer, SimpleScript offers features to streamline your workflow.
Why Choose SimpleScript?
- Ease of Use: Simple syntax and structure.
- Versatility: Automate tasks or build web tools.
- Powerful Features: Built-in functions and flexible structures.
- Active Community: Share, learn, and grow.
Keywords
These are reserved words used in SimpleScript for program structure and logic.
let: Declare a variable
print: Output a value
if / then / endif: Conditional logic
for / to / do / endfor: Looping from one value to another
while / do / endwhile: Loop while a condition is true
input: Take user input
function / endfunction: Define a function
call: Call a function
return: Return a value from a function
break / continue: Loop control
and / or / not: Logical operators
Data Types
- Number: e.g., 10, 3.14
- String: e.g., "Hello, World"
- Boolean:
true
orfalse
- Null: Represents no value
- List: Arrays like [1, 2, 3]
Built-in Functions
len(list)
: Length of listpush(list, value)
: Add to endpop(list)
: Remove last itemjoin(list, sep)
: Join into stringsplit(str, sep)
: Convert to listreverse(list)
: Reverse itemssort(list)
: Sort itemsmap(list)
: Transform valuesfilter(list)
: Filter truthy valuessum(list)
: Total summax(list)
, min(list)
: Find max/minSyntax
Basic SimpleScript syntax:
let x = 10
print x
if x > 5 then
print "x is greater than 5"
endif
Examples
let sum = 0
for i = 1 to 10 do
sum = sum + i
endfor
print sum