{{ message }}

Instantly share code, notes, and snippets.

💤
procrastinating

# Nattawut Phetmak neizod

💤
procrastinating
Last active Sep 12, 2021
View undividable_clique.py
 #!/usr/bin/env python3 from itertools import combinations def is_undividable_clique(family, number): for subgraph in combinations(family, 4): if sum(subgraph) % number == 0: return False return True
Created Sep 5, 2021
View bruteforce-grid.py
 #!/usr/bin/env python3 # change params here N = 3 M = 3 PRINT_UNIQUE_ANSWERS = True
Last active May 26, 2021
Megagon SVG!
View generate.py
 #!/usr/bin/env python3 # NOTE # LAYERS is a non-empty list of integers. # The n-gon can be determine by calc_ngon(LAYERS), e.g., #LAYERS = [1, 2, 2] # heptagon (not constructible) #LAYERS = [1, 4, 3] # heptadecagon (17 sides) #LAYERS = [2, 2, 3, 2] # tetracontadigon (42) #LAYERS = [4, 1, 4, 3, 2, 2] # 360-gon
Created Jun 14, 2012
[Blockly] Quicksort - Recursive

# Quicksort

Since Blockly doesn't accept function's argument & every variables is global. So I made a recursive stack just for this.

See the picture or copy this xml code and paste into XML tab in this page to see live demo yourself.

May the code be with you. :3

Last active Sep 27, 2020
IMO 2020 Problem 3: Pebbles
View pebbles.py
 #!/usr/bin/env python3 import sys from argparse import ArgumentParser from itertools import combinations from random import seed, shuffle, randrange sumsupto = lambda n: n*(n+1)//2 tco = lambda t: f'\033[01;{31+t[1]}m{t[0]:02}\033[00m'
Created Aug 7, 2018
Kirkpatrick–Seidel algorithm
View ulti-chull.ipynb
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Mar 2, 2020
View antumbra.ipynb
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Oct 4, 2011 — forked from 140bytes/LICENSE.txt
Affine Cipher