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
template do_draw(w:int, color:uint, body:untyped) = | |
kinc_g4_begin(w) | |
body | |
kinc_g4_end(w) | |
kinc_g4_swap_buffers() | |
proc nim_update() {.exportc.} = | |
do_draw 0, 0: | |
nimPipeline.kinc_g4_set_pipeline() | |
var matrix:KincMatrix3x3 = kinc_matrix3x3_identity() |
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
/// from StackOverflow | |
function isNumeric(str) { | |
if (typeof str != "string") return false // we only process strings! | |
return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... | |
!isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail | |
} | |
const types = { | |
STRING: "string", | |
NUMBER: "number", |
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
// script with an amount and rest argument | |
script move_right_rest(amount, ...rest) { | |
// the "times" loop | |
(amount) times x ++; | |
// standard for each loop (i is scoped to this block) | |
for (var i = 0; i < rest; i ++) // ++i will not be added | |
x += rest[i]; | |
} | |
// scripts can't be passed around, events can be passed around in variables |
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
#include "vector_lib.h" | |
#include <stdio.h> | |
#include <time.h> | |
#include <windows.h> | |
int main() { | |
struct timespec start, end; |
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
# Go: | |
iterations: 283694453 | |
collisions: 1508042 | |
passes: 283698 | |
iterations: 281346118 | |
collisions: 1360134 | |
passes: 281349 | |
iterations: 282386123 | |
collisions: 1224686 |
OlderNewer