Skip to content

Instantly share code, notes, and snippets.

View DenisBelmondo's full-sized avatar

Mason DenisBelmondo

View GitHub Profile
#lang racket/base
(require ffi/unsafe)
(define raylib (ffi-lib "libraylib"))
(define-cstruct _Color {
[r _ubyte]
[g _ubyte]
[b _ubyte]
#include <cmath>
#include <cstdio>
#include <raylib.h>
#include <raymath.h>
#include <vector>
static const auto TICK_RATE = 1.0 / 30.0;
static Vector2 playerPosition { 5, 5 };
static Vector2 playerDirection { 0, -1 };
// by Mason "Belmondo"
// based off of Mohsen Zare's implementation
shader_type spatial;
render_mode cull_back, depth_draw_always, specular_disabled;
uniform sampler2D albedo_texture : filter_nearest, repeat_enable, source_color;
uniform vec2 uv1_offset;
#!/usr/bin/env luajit2
local ffi = require 'ffi'
ffi.cdef [[
int glfwInit(void);
void glfwTerminate(void);
void glfwWindowHint(int hint, int value);
void* glfwCreateWindow(int width, int height, const char *title, void *monitor, void *share);
void glfwDestroyWindow(void *window);
#include <errno.h>
#include <fcntl.h>
#include <linux/fs.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#!/usr/bin/env python3
import ctypes
import threading
import time
import tkinter as tk
def _main() -> None:
done = False
import matplotlib.bezier as bezier
if __name__ == '__main__':
seg = bezier.BezierSegment([
(0, 0),
(16, 40),
(32, -32),
])
seg2 = bezier.BezierSegment([
#ifndef DYNAMIC_ARRAY_H
#define DYNAMIC_ARRAY_H
#ifndef DYNAMIC_ARRAY_MALLOC
#include <stdlib.h>
#define DYNAMIC_ARRAY_MALLOC malloc
#endif
#ifndef DYNAMIC_ARRAY_REALLOC
#include <stdlib.h>
(module
(func $Vector2Add (export "Vector2Add") (param f32) (param f32) (param f32) (param f32) (result f32) (result f32)
local.get 0
local.get 2
f32.add
local.get 1
local.get 3
f32.add
)