mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Adjusted timetable
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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!
|
||||
@@ -24,6 +24,7 @@ output(name);
|
||||
|
||||
*/
|
||||
|
||||
//TODO: Not yet functional
|
||||
fn makeCounter() {
|
||||
var counter: int = 0;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//TODO: functions don't work yet
|
||||
//TODO: Not yet functional
|
||||
|
||||
//find the leap years
|
||||
fn isLeapYear(n: int) {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
|
||||
|
||||
var answer = 42;
|
||||
|
||||
var question: string = "How many roads must a man walk down?";
|
||||
|
||||
print question;
|
||||
@@ -1,11 +0,0 @@
|
||||
var loops = 0;
|
||||
|
||||
while (true) {
|
||||
if (++loops < 15532) {
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
assert loops == 15532, "Yuki loop failed (break + continue)";
|
||||
Reference in New Issue
Block a user