Added trivial standard library and search paths.
This commit is contained in:
30
stdlib/io.krak
Normal file
30
stdlib/io.krak
Normal file
@@ -0,0 +1,30 @@
|
||||
__if_comp__ __C__ __simple_passthrough__ """
|
||||
#include <stdio.h>
|
||||
"""
|
||||
|
||||
void print(char* toPrint) {
|
||||
__if_comp__ __C__ {
|
||||
__simple_passthrough__ """
|
||||
printf(toPrint);
|
||||
"""
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void print(int toPrint) {
|
||||
__if_comp__ __C__ {
|
||||
__simple_passthrough__ """
|
||||
printf("%d", toPrint);
|
||||
"""
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void print(float toPrint) {
|
||||
__if_comp__ __C__ {
|
||||
__simple_passthrough__ """
|
||||
printf("%f", toPrint);
|
||||
"""
|
||||
}
|
||||
return;
|
||||
}
|
||||
9
stdlib/math.krak
Normal file
9
stdlib/math.krak
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
int NotPi = 3;
|
||||
float Pi = 3.141592654;
|
||||
|
||||
int fibanacci(int num) {
|
||||
if (num < 2)
|
||||
return 1;
|
||||
return fibanacci(num-1) + fibanacci(num-2);
|
||||
}
|
||||
Reference in New Issue
Block a user