Adjusted timetable

This commit is contained in:
2025-02-18 08:34:29 +11:00
parent 639250f028
commit 3a82593e4d
8 changed files with 24 additions and 41 deletions

View File

@@ -1,11 +1,13 @@
//TODO: Not yet functional
//advent of code thingy
var arr = [
3, 4,
4, 3,
2, 5,
1, 3,
3, 9,
3 , 3
3, 4,
4, 3,
2, 5,
1, 3,
3, 9,
3, 3,
];
var total = 0;

View File

@@ -1,17 +1,17 @@
//calculate the nth fibonacci number, and print it
//can't use functions yet
var counter: int = 0;
var first: int = 1;
var second: int = 0;
//This causes integer overflow, but that's fine for now
while (counter < 100_000) {
var third: int = first + second;
first = second;
second = third;
var third: int = first + second;
first = second;
second = third;
print third;
print third;
++counter;
++counter;
}

View File

@@ -1,4 +1,4 @@
//TODO: functions don't work yet
//TODO: Not yet functional
//example of the fibonacci sequence
fn fib(n: int) {
@@ -11,4 +11,5 @@ for (var i = 1; i <= 10; i++) {
print i .. ":" .. fib(i);
}
//Note to self: yes, the base case in 'fib()' is 'n < 2', stop second guessing yourself!
//Note to my future self: yes, the base case in 'fib()' is 'n < 2', stop second guessing yourself!
//Note to my past self: don't tell me what to do!

View File

@@ -24,6 +24,7 @@ output(name);
*/
//TODO: Not yet functional
fn makeCounter() {
var counter: int = 0;

View File

@@ -1,4 +1,4 @@
//TODO: functions don't work yet
//TODO: Not yet functional
//find the leap years
fn isLeapYear(n: int) {

View File

@@ -1,8 +0,0 @@
var answer = 42;
var question: string = "How many roads must a man walk down?";
print question;

View File

@@ -1,11 +0,0 @@
var loops = 0;
while (true) {
if (++loops < 15532) {
continue;
}
break;
}
assert loops == 15532, "Yuki loop failed (break + continue)";