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 <deque> | |
#include <cstdio> | |
#include <numeric> | |
using namespace std; | |
const int L = -1; | |
const int R = 1; | |
int rules[6][2][3] = {{{1,L,1},{1,L,0}}, |
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
Inductive nat : Set := | |
| O : nat | |
| S : nat -> nat. | |
Theorem zero_no_succ: forall n, S n <> O. | |
Proof. intros. unfold not. intro H0. inversion H0. Qed. | |
Theorem succ_eq_succ: forall m n, S m = S n -> m = n. | |
Proof. intros. inversion H. reflexivity. Qed. |
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 | |
# 1+ interpreter with : not printing newline | |
# as discussed at https://codegolf.stackexchange.com/q/209529/110698 | |
# Parcly Taxel, 2022 | |
# https://gist.github.com/Parcly-Taxel/0bc9ed77c2f6fe0e4ec976d3121e340a | |
import sys | |
from collections import deque | |
s, sd = deque(), {} |
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 Kinross | |
# Bézier curves, elliptical arcs, lines, ellipses and paths | |
import numpy as np | |
from functools import lru_cache | |
from cmath import rect, polar | |
from .matrices import mt | |
from .algebra import ccquad, fproot | |
from .regexes import pcomm_re, number_re, sf, ssf | |
from .bernpol import berneval, bernmul, bernraise, bernder | |
from .bernpol import bernroots, bernvdm, x_conic |
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.7 | |
import numpy as np | |
N = 1024 | |
rng = np.arange(N) + 1 | |
theta = rng * np.pi * (3 - np.sqrt(5)) | |
r = 5 * np.sqrt(rng) | |
pts = r * (np.cos(theta) + 1j * np.sin(theta)) | |
with open("phyllo.svg", 'w') as f: |
NewerOlder