Files
Toy/scripts/leapyear.toy
T
Ratstail91 6c055a0435 Implemented garbage collection
As a whole, this is still tentative.
2026-05-08 16:28:12 +10:00

20 lines
248 B
Plaintext

//find the leap years
fn isLeapYear(n: Int) {
if (n % 400 == 0) return true;
if (n % 100 == 0) return false;
return n % 4 == 0;
}
//check for string reuse
{
print isLeapYear(1999);
}
{
print isLeapYear(2000);
}
{
print isLeapYear(2004);
}