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::hash_map::*; | |
use std::time::SystemTime; | |
#[derive(Hash, Copy, Clone, PartialEq, Debug, Eq)] | |
struct Vec3(i8, i8, i8); | |
#[derive(Hash, Copy, Clone, PartialEq, Debug, Eq)] | |
struct Vec4(i8, i8, i8, i8); | |
impl Vec4 | |
{ |
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::hash_map::*; | |
fn solve(crule: &RuleCont, rules: &HashMap<usize, Rule>, s: &str, offs: usize) -> (usize, bool) | |
{ | |
let mut moffs = offs; | |
match crule | |
{ | |
RuleCont::Seq(irules) => { | |
let mut valid = true; | |
let remoffs = moffs; |
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> |
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
#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 "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
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 <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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include "../lib.h" | |
typedef struct { | |
char *source; | |
char *dest; | |
} conn_t; |