Skip to content

Instantly share code, notes, and snippets.

View XANOZOID's full-sized avatar
♾️
You can not win.

Xanozoid XANOZOID

♾️
You can not win.
  • The machine
View GitHub Profile
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()
@XANOZOID
XANOZOID / interpeter.js
Created December 26, 2022 10:15
interpreter for my language in progress
/// 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",
@XANOZOID
XANOZOID / game_script_lang.js
Last active August 12, 2023 16:16
New Lang (basically: Go but dynamic)
// 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
@XANOZOID
XANOZOID / main.c
Created January 15, 2024 13:36
Very bad benchmark
#include "vector_lib.h"
#include <stdio.h>
#include <time.h>
#include <windows.h>
int main() {
struct timespec start, end;
@XANOZOID
XANOZOID / comparison.txt
Created January 21, 2024 01:45
Super realistic and useful comparison between go and c++ performance
# Go:
iterations: 283694453
collisions: 1508042
passes: 283698
iterations: 281346118
collisions: 1360134
passes: 281349
iterations: 282386123
collisions: 1224686