Renamed 'scripts' directory to 'examples'

Also allowed assignment within conditionals
This commit is contained in:
2026-05-26 23:40:18 +10:00
parent bbb1e38649
commit 92e4a41662
14 changed files with 34 additions and 110 deletions
+18
View File
@@ -0,0 +1,18 @@
//is 'n' a leap year
fn isLeapYear(n: Int) {
if (n % 400 == 0) return true;
if (n % 100 == 0) return false;
return n % 4 == 0;
}
{
print isLeapYear(1999);
}
{
print isLeapYear(2000);
}
{
print isLeapYear(2004);
}