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
""" Script to find the (hopefully) least number of moves to solve a Waffle (wafflegame.net/) | |
The program works by greedily trying to find loops, in which N squares can be moved in a circle to where they should be, | |
which means we have corrected N squares in N-1 moves. | |
There's probably a lot of room for optimizations if you want it to run in 0.0000001 seconds instead of 0.000001. | |
(For example; I have never seen it need n squares in a loop and then later finding a loop with a length < n which | |
probably means logically it doesn't need to try shorter loops than the last loop found) | |
Author: Anton (@ntoonio) |
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
import random | |
import time | |
import sys | |
def createTest(a, n): | |
l = [] | |
for _ in range(0, n): | |
l.append([0 for _ in range(0, a)]) | |
l[-1][random.randint(0, a - 1)] = 1 |
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/python3 | |
from mcrcon import MCRcon | |
import json | |
import datetime | |
import time | |
import os | |
import json | |
import math | |
import argparse | |
import random |
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
VERSION_MANIFEST_URL = "https://launchermeta.mojang.com/mc/game/version_manifest.json" | |
import json | |
import requests | |
import argparse | |
import urllib.request | |
rManifest = requests.get(VERSION_MANIFEST_URL) | |
manifest = rManifest.json() |
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
<html> | |
<head> | |
</head> | |
<body> | |
<pre id="output"> | |
</pre> | |
<script src="GameOfLife.js"></script> |