A cute and glam programming language for dramatic dollies. 🎀 🎎
<3 Importing
<3 the standard
<3 library.
@inspo "std"
<3 <3 The structure
<3 <3 for storing
<3 <3 information
<3 <3 on a person.
slay bag Person {
msg: tea,
age: cash,
balance: change
}
<3 <3 Putting together a greeting.
slay move greet(name: tea) tea {
wisdom greeting: tea = "Hello, $name";
greeting
}
<3 <3 Checking whether the person is of
<3 <3 legal age.
slay move evalPerson(person: Person) sleep {
boo isLegal: vibe = false;
glam (person::age > 18){
is_legal = true;
}
istoo (person::age == 18){
isLegal = true;
}
frosty {}
(
is_legal ?
std::print("Legal!") :
std::print("Go home.")
)
}
<3 <3 Factorial sequence
<3 <3 with a `for-loop`.
slayy move factorialFor(end: cash) cash {
boo result: cash = 1;
loopz in (1~(end+1)) |idx| {
result = result * idx;
}
result
}
<3 <3 Factorial sequence
<3 <3 with a `while-loop`.
slayy move factorialWhile(end: cash) cash {
boo result: cash = 1;
boo iter: cash = 0;
rock (end != iter) {
result = result * iter;
iter = iter + 1;
}
result
}
slay move ageCheck(person: Person) vibe {
switchup (person::name){
"Aly" => true,
_ => false
}
}
move main() sleep {
wisdom purrson: Person = Person{
"Hello World!",
2024,
42.0
};
wisdom factFor: cash = factorialFor(5);
wisdom factWhile: cash = factorialWile(5);
wisdom checkedAge: vibe = ageCheck(purrson);
std::print(greet("Alyx"));
evalPersson(purrson);
std::print("$factFor");
std::print("$factWhile");
std::print("$checkedAge");
}
- Dollscript 🎀 🎎 by Alyx Shang 🖤.
- Licensed under the FSL v1.