You may not know this, but you already know inkling. Inkling is a programming language that lets you follow your gut- you learn to program by doing what makes sense to you while learning to shift your thinking to grow as a programmer and as a thinker. Speak the language you code. Type what you want to say. Where will your inkling take you today?
Created by Marco B, Cooper LaRhette, Veda Ashok, Sam Gibson, Maya Pegler-Gordon, and Talia Bahar
- Simple and easy
- Statically typed
- Case sensitive
- Arrow functions
- Num
- Text
- List
- Bool
- Dict
- Set
- Add:
+
- Subtract:
-
- Multiply:
*
- Divide:
/
- Modulo:
%
- Less than or equal:
<=
- Less than:
<
- Greater than or equal:
>=
- Greater than:
>
- Equal:
==
- Not equal:
!=
- Decrement prefix:
--variable
- Increment prefix:
++variable
- Negate:
-variable
- Not:
!variable
- Decrement postfix:
variable--
- Increment postfix:
variable++
- Logical AND:
and
- Logical OR:
or
x is Num 5
y is Text “Hello World!”
z is always Num 10
y is “Inkling is amazing”
function helloWorld() is Text {
gimme "Hello world"
}
function countToX(x is Num) is Void {
for i is Num in range(0, x) {
display i
}
}
x is always (x is Text) is Num => {
gimme x
}
x < 0 ? gimme "negative" : gimme "positive"
if (x % 3 == 0) {
display "multiple of 3"
}
for i is Num in range(0,10) {
btw: for-loop execution
}
while (x < 0) {
btw: while-loop execution
}
btw: this is how you leave a single-line comment
fyi: if you need to leave a multi-line
you can leave it like this :xoxo
function fibonacci(x is Num) is Num {
if(x <= 1) {
gimme x
}
gimme fibonacci(x - 1) + fibonacci(x - 2)
}
function fibonacci(x) {
if (x <= 1) {
return x;
}
return fibonacci(x - 1) + fibonacci(x - 2);
}
function findFactorial(x is Num) is Num {
if(x == 0 or x == 1) {
gimme x
}
gimme x * findFactorial(x - 1)
}
function findFactorial(x) {
if (x === 0 || x === 1) {
return x;
}
return x * firstFactorial(x - 1);
}
function fizzbuzz(x is Num) is void {
for i is Num in range(0,x) {
if (i%3 == 0 and i%5 == 0) {
display "fizzbuzz"
} else if (i % 3 == 0) {
display "fizz"
} else if (i % 5 == 0) {
display "buzz"
} else {
display i
}
}
}
function fizzBuzz(x) {
for (let i = 1; i <= x; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log("fizzbuzz");
} else if (i % 3 === 0) {
console.log("fizz");
} else if (i % 5 === 0) {
console.log("buzz");
} else {
console.log(i);
}
}
}
function isPrime(x is Num) is Num {
start is Num 2
while(start <= x^0.5) {
if (x % start++ < 1) {
gimme false
}
}
gimme x > 1
}
function isPrime(x) {
var start = 2;
while (start <= Math.sqrt(x)) {
if (x % start++ < 1) {
return false;
}
}
return x > 1;
}
function findGreatest(a is Num, b is Num, c is Num) is Num {
if (a >= b and a >= c) {
gimme x
} else if (b >= a and b >= c) {
gimme b
} else {
gimme c
}
}
function findGreatest(a, b, c) {
if (a >= b && a >= c) {
return x;
} else if ( b >= a && b >= c) {
return b;
} else {
return c;
}
}
function negativeChecker(x is Num) is Bool {
gimme x < 0 ? true : false
}
function negativeChecker(x) {
return x < 0 ? true : false
}
- Type mismatch during declaration or assignment
- Assignment to a variable declared with the 'always' keyword (constants)
- Passing in
x
number of arguments where the function is declared withy
number of parameters andx !== y
- Passing in arguments with wrong type compared to parameter(s) declaration/the function signature
- Indexing out of bounds for lists and dictionaries
- Applying the
+
operator to variables that are not of typeText
orNum
- Having a
return
in a function that has a return type ofVoid
- Not returning anything in a function that is declared to return something
- Returning something that is not of the type declared in the function signature
- Trying to iterate through something that is not a list, set, dictionary, or string in a
for
loop
- Constant Folding
- Strength Reduction in Prefix Operator & Binary Operators
- Unreachable Code for While Loop
- Assignment Simplification