Skip to content

Instantly share code, notes, and snippets.

View laserbat's full-sized avatar

Olga Ustiuzhanina laserbat

View GitHub Profile
#!/usr/bin/python3
from __future__ import annotations
import copy
import string
from collections.abc import Callable
from enum import Enum, auto
from functools import cached_property
from types import MappingProxyType
data a <-> b = Arp (a -> b) (b -> a)
arp :: (a -> b) -> (b -> a) -> a <-> b
arp = Arp
(.>) :: (a <-> b) -> (a -> b)
(.>) (Arp a _) = a
(.<) :: (a <-> b) -> (b -> a)
(.<) (Arp _ b) = b
This file has been truncated, but you can view the full file.
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3,5,6,1,4],[3,6,1,2,4,5],[4,5,2,1,6,3],[5,4,6,3,2,1],[6,1,4,5,3,2]]}
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3,5,6,1,4],[3,6,2,1,4,5],[4,5,1,2,6,3],[5,4,6,3,2,1],[6,1,4,5,3,2]]}
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3,5,6,1,4],[3,6,2,5,4,1],[4,5,1,3,6,2],[5,4,6,1,2,3],[6,1,4,2,3,5]]}
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3,5,6,1,4],[3,6,4,5,2,1],[4,5,2,1,6,3],[5,1,6,3,4,2],[6,4,1,2,3,5]]}
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3,5,6,4,1],[3,5,1,2,6,4],[4,6,2,3,1,5],[5,4,6,1,2,3],[6,1,4,5,3,2]]}
{"F":[[1,2,3,4,5,6],[2,1,4,3,6,5],[3,4,5,6,1,2],[4,3,6,5,2,1],[5,6,1,2,3,4],[6,5,2,1,4,3]],"G":[[1,2,3,4,5,6],[2,3
@laserbat
laserbat / lc0.config
Created November 19, 2022 13:54
Maia chess config
threads=1
task-workers=0
out-of-order-eval=false
max-prefetch=0
minibatch-size=1
nncache=0
smart-pruning-factor=0
#include <complex.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <tgmath.h>
#define SR 44100
#define SIMPLE_HARMONIC
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define W (1080 / 2)
#define H (1920 / 2)
#define MAX_HEADER 128
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#ifdef __SIZEOF_INT128__
typedef __uint128_t block_t;
#else
#warning "128-bit integers not supported, using 64-bit blocks!"
typedef uint64_t block_t;
#endif
#!/usr/bin/python3
from collections import defaultdict
with open("input.txt", "r", encoding="utf8") as file:
data = [[int(char) for char in line.strip()] for line in file.readlines()]
S = 5
W, H = len(data), len(data[0])
@laserbat
laserbat / day_1.sed
Last active December 14, 2021 20:17
2021 AOC in sed
#!/bin/sed -Enf
# Note: this code is intended for GNU sed, other implementations of sed might have issues running it.
#
# Usage:
# $ ./day_1.sed < ./input.txt
G
s/\n/;/m
h
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define W 1920
#define H 1080
const double start_x = 0.1;
const double start_y = 0;