Skip to content

Instantly share code, notes, and snippets.

View mynameajeff's full-sized avatar
💭
This account isn't dead I swear

Lorenz Schymanietz mynameajeff

💭
This account isn't dead I swear
View GitHub Profile
c = {
"true" : lambda x, y: x,
"false" : lambda x, y: y
}
#NOT = (λa.a FALSE TRUE)
NOT = lambda a: c[a]("false", "true")
#AND = (λa.λb.a b a)
c = {
"true" : lambda x, y: x,
"false" : lambda x, y: y
}
#NOT = (λa.a FALSE TRUE)
NOT = lambda a: c[a]("false", "true")
#AND = (λa.λb.a b a)
#include <stdio.h>
#define DECLARE_ENEMY_TYPE(n) \
\
typedef struct { \
\
char* n##_name; \
\
double health; \
def build_brick_pyramid(n, material = "*"):
if n <= 1: return material
counter = n - 1
holder = ""
begin = [" "] * ((n * 2) - 1)
{
"get": [
"(?i:get) +(?<packagename>io|rand);"
],
"pn": [
"(\\( *(?P<operator>\\+|\\-|/|\\*|\\*\\*)",
" *(?P<operand0>\\d+(?:\\.\\d+)?|",
"\\(-\\d+(?:\\.\\d+)?\\)|\\w+|(?{group_num}))+",
#!/usr/bin/env python3
import sys
__author__ = "mynameajeff"
class StupidIdea:
def __init__(self, script_string):
import System.Random
import System.IO
----rand function things----
-- https://stackoverflow.com/questions/19594655/random-number-in-haskell -- function thanks to Matt Davis :v
randomList :: Int -> [Double]
randomList seed = randoms (mkStdGen seed) :: [Double]
-- returns random seed
@mynameajeff
mynameajeff / Animation.cpp
Created October 16, 2017 19:05
Excerpt of larger Animation project
//allegro headers:
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
//~~~~~~~~~~~~~~~~~~~~~
//standard headers:
#include <iostream>
#include <string>
//~~~~~~~~~~~~~~~~~~~~~
#define ERROR_FAILED(arg1) { \
//allegro headers:
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
//~~~~~~~~~~~~~~~~~~~~~
//standard headers:
#include <cstdio>
#include <vector>
//~~~~~~~~~~~~~~~~~~~~~
class Animation {
#include <stdio.h>
#include <string.h>
#define NELEMS(x) (sizeof(x) / sizeof((x)[0]))
typedef struct {
unsigned long len; //length of array
int type; //type of array e.g. char*
float* array; //self-explanatory
} better_int;