🏳️⚧️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add(firstNum: num, secondNum: num) -> num { | |
return firstNum + secondNum; | |
} | |
var result: num = add(1, 2); | |
print(result as str); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pow(base: num, powerTo: num) -> num { | |
return base ** powerTo; | |
} | |
var result: num = pow(2, 8); // -> 256 | |
print(result as str); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def primeFactors(n: num) -> void { | |
while (n % 2 == 0) { | |
print("2"); | |
n /= 2; | |
} | |
// For all non-even divisors | |
for (var i: num = 3; i * i <= n; i += 2) { | |
while (n % i == 0) { | |
print(f"{i}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isPrime(n: num) -> bool { | |
if (n <= 1) { | |
return false; // Never a prime | |
} else if (n == 2 || n == 3) { | |
return true; // Base primes | |
} else if (n % 2 == 0 || n % 3 == 0) { | |
return false; // Easy base prime checks | |
} | |
for (var i: num = 5; i * i <= n; i += 6) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The validation scheme for an option that is an object. | |
* @since 0.11.0 | |
*/ | |
export type KipperConfigObjectValidatorScheme = { | |
[key: string]: "string" | "boolean" | "array<string>" | KipperConfigObjectValidatorScheme; | |
} | |
/** | |
* The validation scheme for the Kipper config. |
OlderNewer