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
// vim: noet | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
size_t th_utf8_decode_beta(uint32_t *out, const char *s_) { | |
const unsigned char *s = (const unsigned char*)s_; | |
if ((*s & 0xC0) != 0xC0) { | |
*out = *s; |
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 <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdbool.h> | |
#include <math.h> | |
#include "../lib.h" | |
typedef enum { | |
SHUT, |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include "../lib.h" | |
typedef struct { | |
char *source; | |
char *dest; | |
} conn_t; |
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 <stdio.h> | |
#include <inttypes.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
char* read_file(const char *path) { | |
FILE *f = fopen(path, "rb"); | |
if (f == NULL) |
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
instructions = [] | |
f = open("input.grs", "r") | |
src = str(f.read()) | |
f.close() | |
def var_emit(line): | |
name = line[1:].strip() | |
instructions.append(["MAKEVAR", name]) |
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 "builder.h" | |
// | |
// Begins construction of string | |
// | |
struct StringBuilder sbstart() { | |
return (struct StringBuilder) { | |
.str = NULL, | |
.size = 0, | |
.capacity = 0 |
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 <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
typedef struct { | |
const char *src; | |
} _obj_Parser; |
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 "particle_system.h" | |
#include "camera.h" | |
#include <SDL2/SDL_render.h> | |
#include <stdint.h> | |
static int particle_rand(u32 *seed) { | |
return (((*seed = *seed * 214013L + 2531011L) >> 16) & 0x7fff); | |
} | |
/// Create partcile system |
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
use std::collections::btree_set::*; | |
type Id = usize; | |
#[derive(Debug)] | |
pub struct BucketArray<T> | |
{ | |
items: Vec<T>, | |
free: BTreeSet<usize> | |
} | |
impl<T> BucketArray<T> |