-
Notifications
You must be signed in to change notification settings - Fork 1
Language Syntax
SharkBlocks00 edited this page Jul 13, 2025
·
4 revisions
This page documents the syntax of the Mrya programming language as it stands.
Variables are declared using the let keyword.
let variableName = value
- variableName should be a valid identifier.
- value can be a string (in quotes) or a number.
let greeting = "Hello, Mrya!"
let age = 25
Mrya outputs text or variable values using the output() command.
output(expression)
-
expressioncan be a string literal, a variable or a concatenated string.
output("Welcome to Mrya")
output(greeting)
Functions are declared using func functionname = define()
func greet = define(who) {
output("Hello " + who)
}
- Functions do return values using
returninside the function, therefore you can do let member = greet("Member"), functions also support variables in the define() section and will become more useful after if statements and user input are added.
func giveNumber = define(num) {
return num
}
let myVar = giveNumber(42)
output(myVar)
Inputs are declared using request()
let variable = request("expression")
-
expressioncan be a variable previously declared. - You can also use request() inside an output().
let color = request("What's your favorite color? ")
let food = request("Favorite food? ")
output("You like " + color + " and eat " + food + ".")
If you have any further questions or suggestions, please open an issue!