In [1]:
%load_ext autoreload
%autoreload 2
from rush import *
import matplotlib.pyplot as plt
import numpy as np
import time
import glob
In [2]:
s = State()
s.load_puzzle("jams/1.txt")
neighbors = s.get_neighbors()
# Plot everything
N = len(neighbors)+1
K = int(np.ceil(np.sqrt(N))) # Figure out a square grid to put these on

plt.figure(figsize=(10, 10))
plt.subplot(K, K, 1)
plt.title("Original")
s.plot()
for i, n in enumerate(neighbors):
    plt.subplot(K, K, i+2)
    n.plot()
    plt.title("Neighbor {}".format(i))
plt.tight_layout()
In [ ]: