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
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) |
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
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) |
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> | |
#define DECLARE_ENEMY_TYPE(n) \ | |
\ | |
typedef struct { \ | |
\ | |
char* n##_name; \ | |
\ | |
double health; \ |
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
def build_brick_pyramid(n, material = "*"): | |
if n <= 1: return material | |
counter = n - 1 | |
holder = "" | |
begin = [" "] * ((n * 2) - 1) |
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
{ | |
"get": [ | |
"(?i:get) +(?<packagename>io|rand);" | |
], | |
"pn": [ | |
"(\\( *(?P<operator>\\+|\\-|/|\\*|\\*\\*)", | |
" *(?P<operand0>\\d+(?:\\.\\d+)?|", | |
"\\(-\\d+(?:\\.\\d+)?\\)|\\w+|(?{group_num}))+", |
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
#!/usr/bin/env python3 | |
import sys | |
__author__ = "mynameajeff" | |
class StupidIdea: | |
def __init__(self, script_string): |
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
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 |
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
//allegro headers: | |
#include <allegro5/allegro.h> | |
#include <allegro5/allegro_image.h> | |
//~~~~~~~~~~~~~~~~~~~~~ | |
//standard headers: | |
#include <iostream> | |
#include <string> | |
//~~~~~~~~~~~~~~~~~~~~~ | |
#define ERROR_FAILED(arg1) { \ |
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
//allegro headers: | |
#include <allegro5/allegro.h> | |
#include <allegro5/allegro_image.h> | |
//~~~~~~~~~~~~~~~~~~~~~ | |
//standard headers: | |
#include <cstdio> | |
#include <vector> | |
//~~~~~~~~~~~~~~~~~~~~~ | |
class Animation { |
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> | |
#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; |