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 "cw_prng.h" | |
#include <stdio.h> | |
uint64_t cw_g64(struct CW_Rng* rng) { | |
rng -> weyl += rng -> s; | |
uint64_t out = rng -> xbits; | |
rng -> abits += out; | |
out = (out >> 1)*(rng -> abits | 1); | |
out ^= rng -> weyl; | |
rng -> xbits = out; |
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 "brainfuck.h" | |
#define CHECK_DP(interp) ((interp -> data_pointer) < (interp -> memsize)) | |
int bf_init(bf_Interpreter* interp, const char* fpath, size_t memsize) { | |
// Allocate memory | |
unsigned char* mem_alloc; | |
mem_alloc = (unsigned char*) calloc(memsize, sizeof(unsigned char)); | |
if (mem_alloc == NULL) { | |
printf("Failed to allocate %d chars of memory\n", memsize); | |
return FAILURE; |
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
# | |
# A toy S-expressions lexer and parser written in pure python. | |
# Copyright 2023 Nikhil R. | |
# | |
from collections import namedtuple | |
from io import StringIO | |
T_INT_LITERAL = 1; | |
T_FLOAT_LITERAL = 2; |
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
import os | |
import sys | |
import time | |
from PIL import Image | |
import ctypes | |
h_stdout = ctypes.windll.kernel32.GetStdHandle(ctypes.c_long(-11)); | |
ctypes.windll.kernel32.SetConsoleMode(h_stdout, ctypes.c_short(0x200)); | |
def _win_mov_cursor(x, y): |