This file contains 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 <stdio.h> | |
#include <stdbool.h> | |
typedef struct TripleIterator | |
{ | |
int iterations; | |
int x, y, z; | |
} TripleIterator; | |
bool next_triple(TripleIterator *it) |
This file contains 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
const katex = require('katex'); | |
const assert = require('assert').ok; | |
let inline = { | |
throwOnError: false, | |
displayMode: false, | |
output: 'html' | |
}; | |
let display = { |
This file contains 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
#%% <- this is vscode stuff, this will run on the command line but plots might come out weird | |
import numpy as np | |
u32 = np.uint32 | |
i32 = np.int32 | |
def golden_ratio_sequence(i: u32) -> u32: | |
return u32(i) * u32(2654435769) # 0.614... in 0.32 fixed point | |
def reverse_bits32(x: u32) -> u32: | |
x = u32(x) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.min.js"></script> | |
<style> | |
body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: #1a1a1a; } | |
button { margin: 5px; padding: 8px 16px; background: #333; color: white; border: none; cursor: pointer; } | |
button:hover { background: #444; } | |
#controls { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); } | |
</style> |