Skip to content

Instantly share code, notes, and snippets.

View metalunk's full-sized avatar

Ryusuke Chiba metalunk

  • Roppongi, Tokyo, Japan
View GitHub Profile
@metalunk
metalunk / nine.py
Created February 16, 2020 02:45
I created a Nine puzzle solver using the Taboo search. But this is not enough smart to solve difficult instances...
import logging
from copy import copy
from typing import List
class Nine:
EMPTY_GRID = 0
_DISTANCE_MAP = [
[0, 1, 2, 3, 2, 3, 4, 3, 4, 5], # 0
<?php
/**
* Class Permutation
*
* i.e.
* input: 'abc'
*
* We want to enumerate all the leaves
*