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 <stdint.h> | |
#include <malloc.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <string.h> | |
#include <stdarg.h> | |
#define MAX_WORDS 13000 // leave room for some tinkering | |
#define LENGTH 5 |
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
from __future__ import print_function | |
import sys | |
LENGTH = 5 | |
RIGHT_LETTER_RIGHT_PLACE = 1 | |
RIGHT_LETTER_WRONG_PLACE = 2 | |
SCORE_NONE = 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
void getSpecialWord(uint16_t _n, char* buffer) { | |
static uint16_t w; | |
w = 0; | |
const uint8_t* b = answers; | |
static uint16_t n; | |
n = _n + 1; | |
static uint8_t additionTable[256]; | |
static uint8_t tableReady = 0; | |
static uint8_t c; | |
static uint8_t mask; |
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
GRAPHICS = True # uses cv2 to display board | |
import z80 # pip3 --install z80, but modified to make af visible | |
import binascii | |
import time | |
if GRAPHICS: | |
import cv2 | |
import numpy as np | |
zoom = 5 |
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
function finder(obj, keyToFind, level=7, soFar='', searched=new Set) { | |
if (level<=0 || typeof obj != 'object' || obj === null || searched.has(obj)) return; | |
searched.add(obj) | |
if (keyToFind in obj) { | |
console.log(soFar + '.' + keyToFind) | |
} | |
for (let key in obj) { | |
try { |
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
# Public Domain / CC0 license | |
import sys | |
import re | |
import zlib | |
infile = sys.argv[1] | |
outfile = sys.argv[1].replace(".txt",".bin") | |
data = [0 for i in range(32768)] |
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
// simply read a 32k Gameboy cartridge | |
// public domain / CC0 | |
#define CHUNK_SIZE 16 | |
uint16_t address; | |
uint16_t globalChecksum; | |
uint16_t correctGlobalChecksum; | |
uint8_t headerChecksum; | |
uint8_t correctHeaderChecksum; |
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
// try to read a badly damaged 32k Gameboy Cartridge | |
const uint32_t aPins[16] = { PB8, PB9, PC13, PB7, PA0, PA1, PA2, PA3, | |
PA4, PA5, PA6, PA7, PB0, PB1, PB10, PB11 }; | |
const uint32_t dPins[8] = { PB4, PB3, PA9, PA8, PB15, PB14, PB13, PA10 }; | |
// all 5V tolerant: PB4, PB3, PA9, PA8, PB15, PB14, PB13, PA10 | |
uint16_t address; | |
uint16_t RD = PB5; |
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
document.body.style.backgroundColor="rgb(255,250,196)"; |
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
(function(){ | |
function getColor(tag) { | |
m = tag.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i); | |
if ( m ) | |
return [parseInt(m[1]),parseInt(m[2]),parseInt(m[3]),255]; | |
m = tag.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i); | |
return m ? [parseInt(m[1]),parseInt(m[2]),parseInt(m[3]),parseInt(m[4])] : null; | |
} | |
function realBackgroundColor(elem) { |