Skip to content

Instantly share code, notes, and snippets.

View benkyd's full-sized avatar
⌨️

Benjamin Kyd benkyd

⌨️
View GitHub Profile
@benkyd
benkyd / example_data.json
Last active October 15, 2025 09:47
SoMakeIt Member Distribution
{
"datetime": "2025-07-15T17:30:43.141Z",
"text": "SMIB\nAPP  6:30 PM\n\nSpace Open! (For about 4h)",
"timestamp_node_text": "6:30 PM",
"rawAttrs": {
"aria-label": "15 Jul at 6:30:43 PM",
"data-stringify-type": "replace",
"data-stringify-text": "[6:30 PM]",
"data-stringify-requires-siblings": "true",
"data-ts": "1752600643.141999",
fn mandlebrot_sochastic_supersample(&self, x: u32, y: u32, limit: u32) -> Option<u32> {
// first we need to make the pisson disc of out sampling point and generate c for them
let cx = self.view_zoom * (x as f64 / self.view_width as f64 - 0.5) + self.view_x;
let cy = self.view_zoom * (y as f64 / self.view_height as f64 - 0.5) + self.view_y;
// this is the fast bridson algorithm first outlined here:
// https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf
let pisson_disc_sample = |cx: f64, cy: f64| -> Vec<Complex<f64>> {
let mut ret = Vec::<Complex<f64>>::new();
let mut rng = rand::thread_rng();
extern crate olc_pixel_game_engine;
use crate::olc_pixel_game_engine as olc;
use rand::Rng;
const SIM_WIDTH: i32 = 500;
const SIM_HEIGHT: i32 = 500;
struct FerrousCellular {
map: Vec<bool>,
#include <iostream>
#include <chrono>
#include <random>
#include <vector>
#define SIZE 10000
using namespace std::chrono;
float floorY = 600.0f;
float drag = 0.01f;
float wallW = 20;
class Ball {
float x = 150.0f;
float y = 300.0f;
float g = .1f;
float vY = 0.0f;
@benkyd
benkyd / Vec3.h
Last active March 8, 2019 14:05
Vec3.h
template<class T>
struct Vec3 {
T x, y, z;
template<class P>
Vec3(P x, P y, P z) : x(x), y(y), z(z) {}
template<class P>
Vec3(P all) : x(all), y(all), z(all) {}
Vec3() : x(0), y(0), z(0) {}
inline Vec3& cross(const Vec3<T>& v) {
return Vec3 {
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#include <iostream>
#include <vector>
const int MAP_WIDTH = 40;
const int MAP_HEIGHT = 40;
struct Point {
#pragma once
const float DEG2RAD = 0.01745329251994329576923690768f;
const float RAD2DEG = 57.2957795130823208767981548141f;
inline float ToRadian(const float Degree) {
return (Degree * DEG2RAD);
}
inline float ToDegree(const float Radian) {