Instantly share code, notes, and snippets.

• Sort options
Created Feb 23, 2015
Kakuro solver in Python
View kakuro.py
 import itertools from copy import deepcopy def possible_combinations(values, n, total): # generate all combinations of given values with given sum return [combination for combination in itertools.combinations(values, n) if sum(combination) == total] def make_aval(board, clues): """ Generates a set of all digits you can use in each cell, just like you do in sudoku board
Last active Sep 23, 2018
kanji data for NHK News Web Easy
View kanji_easy.json
 { "desc": "kanji frequency for NHK News Web Easy, 1855 articles from 2014-12-02 to 2016-07-15", "source": "https://gist.github.com/adrian17/836b97ee5740b20e63edbe35251d6bc1", "label": "easy news", "total": 158118, "list": [ [ "人", 5093 ],
Created Jul 22, 2014
TH autobomb patcher
View patcher.py
 import shutil import os games = [ {"name": "th10", "offset": 0x25013, "data": [0xf6, 0x05, 0x5c, 0x4e, 0x47, 0x00, 0x02, 0x0f, 0x84, 0x52, 0x01, 0x00, 0x00]}, {"name": "th11", "offset": 0x30679, "data": [0xf6, 0x05, 0xc0, 0x93, 0x4c, 0x00, 0x02, 0x0f, 0x84, 0xd5, 0x02, 0x00, 0x00]}, {"name": "th12", "offset": 0x3619b, "data": [0xf6, 0x05, 0xd0, 0x49, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0xe8, 0x01, 0x00, 0x00]}, {"name": "th125", "offset": 0x3ace8, "data": [0xf6, 0x05, 0x10, 0xb2, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0xf9, 0x00, 0x00, 0x00]}, {"name": "th13", "offset": 0x42925, "data": [0xf6, 0x05, 0x14, 0x4c, 0x4e, 0x00, 0x02, 0x0f, 0x84, 0x2c, 0x01, 0x00, 0x00]}, {"name": "th14", "offset": 0x4d2c4, "data": [0xf6, 0x05, 0x9c, 0x8a, 0x4d, 0x00, 0x02, 0x0f, 0x84, 0x00, 0x01, 0x00, 0x00]}
Created Oct 15, 2017
View gist:445f1b8ebbe0020256cbbc355a17bd9d
 printf 'à____]\0k“ôç¹ñ6\$s8,gã®]•TÍNäsÐÐs«ÒÜ@:ñ=/¸Â-¶ ‡ß9¿Í~ë¬PJdÆv³—Q›¹­E¶çøäkƒ5bÉoŠ€ÁÚN®È@ëPuÞ¨Ä3×¶*<§†N]¥:µV»jUÑÁYÑ.qGÄ uá–vPå.úU!Ð\äŒÞ, ìÓè¬_'|xz -dqqFraw
Created Apr 5, 2017
 #include #include #include int main() { std::regex pattern(R"((\d+) #(.+)# (\d+) ([\d.]+))"); std::string line = "83 #Electric Sander# 7 57.00"; // imagine that's inside the while() loop
Created Jan 18, 2017
View gist:2e4df101b03175fa9c36d25cbef7e9dd
 #include #include #include #include #include #include using namespace std::chrono;
Last active Nov 10, 2016
View ub14.txt
 import timeit import time import subprocess lines = [ "a = ''", "a = ' '", "a = ' '", "a = 'a'", "a = 'a b a b '*100",
Created Aug 24, 2016
Python implementation of anagram solver
View main.py
 from collections import defaultdict import string words = open("enable1.txt").read().splitlines() print(max(len(x) for x in words)) def add(a, b): return tuple(x+y for x, y in zip(a, b)) def over(a, b):
Last active Aug 24, 2016
slightly simpler and slower anagram generator implementation
View main.cpp
 #include #include #include #include #include #include #include #include using namespace std; using namespace std::experimental;
Created Jul 25, 2016
concepts diagn
View main.cpp
 template using id=T; template concept bool A = requires(T a) { a==a; }; template concept bool B = A && // (1) basic usage A && // (2) duplicate concept check A && // (3) different concept check that happens to work on the same type here
You can’t perform that action at this time.