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
#!/usr/bin/env python | |
import sys | |
import argparse | |
import json | |
branch_instrs = [ | |
'b', | |
'bl', | |
'beq', |
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
Tetris has these pieces: | |
[][] [][] [][] [] [][][][] [] [] | |
[][] [][] [][] [][] [] [] | |
[] [][] [][] | |
If you associate a 4-byte sequence with each of these pieces and use the method | |
below to turn a tetris game with a specific piece sequence and move sequence | |
into a program using those sequences, it seems possible that that program could | |
itself be a tetris game that can write itself into memory or to some io device. |
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
def rol(r,n): | |
return (r << n) | (r >> (32 - n)) | |
def crcgen(r3,r4): | |
r6 = rol(r3,8) & 0xff00 | |
r0 = rol(r4,0) & 0xff | |
r3 = rol(r3,24) & 0xffffff | |
r4 = r3 ^ r0 | |
r0 = rol(r4,8) & 0xffffff00 | |
r0 = rol(r0,20) & 0xfffff |
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
from PIL import Image | |
img = Image.new(mode="RGB", size=(8,8)) | |
pixels = [ ] | |
# Black | |
pixels.append((0,0,0)) | |
# Greys and white | |
for i in range(15): | |
v = int((i + 1) * (255 / 15)) |
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
use serde_json; | |
pub enum And<T,U> { | |
These(T,U) | |
} | |
pub enum Field<T> { | |
Named(&'static str,T) | |
} |
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
#[cfg(any(test, feature = "fuzzer"))] | |
use rand::prelude::*; | |
use rand::Error; | |
use random_lfsr_256_galois::{LFSRGalois, LFSRGaloisBuilder}; | |
// A pseudo RNG which uses a slice for all entropy. It iterates a given slice | |
// many times, scrambling the bits through an LFSR in subsequent passes so that | |
// the fuzzer maintains a relationship between the original input bits and the | |
// output with some predictability. |
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
Fixpoint nat_lt (a : nat) (b : nat) : bool := | |
match b with | |
| 0 => false | |
| (S b1) => | |
match a with | |
| 0 => true | |
| (S a1) => nat_lt a1 b1 | |
end | |
end. |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
import tty | |
import time | |
import uuid | |
import signal | |
import socket | |
import argparse |
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
/* no warnings in desmet c 2.4 | |
C> C88 FORBIDDE.C | |
C> BIND FORBIDDE.O | |
*/ | |
#include <stdio.h> | |
struct X { | |
int typ; | |
int x_str; | |
int next; |
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 <graph.h> | |
#include <math.h> | |
#include <float.h> | |
#include <dos.h> | |
#include <malloc.h> | |
int *buf; | |
unsigned short off; | |
double direction; |
NewerOlder