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
-- compupro's pokehole program for ComputerCraft mining turtle | |
-- usage: save as "pokehole", and you can run "pokehole <number>" | |
-- it will generate a pokehole mine with some length determined | |
-- by <number>. I haven't tried this program in like two years, | |
-- so I have no idea if it works, but it probably does. | |
-- It looks for fuel in slot 1 | |
function doRefuelling () | |
turtle.select(1) | |
if turtle.getFuelLevel() < 20000 then | |
turtle.refuel() |
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 urllib | |
import urllib.request | |
import json | |
api_key = '' | |
mapset = { | |
"Bye Bye Yesterday - Taeyang's Good Good Time": "1026729", | |
"Crush (Radio Edit) - Collab Extra": "1531707" | |
} |
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 | |
class Guillotine: | |
def __init__(self): | |
self.triggered = False | |
self.guillotine = [False for _ in range(19)] | |
self.guillotine.append(True) | |
random.shuffle(self.guillotine) | |
def cut(self, n): |
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
//A client-side JavaScript port of the newarch.py Arch-style parliament diagram tool in https://github.com/slashme/parliamentdiagram | |
//License GPLv2.0 | |
//Total number of seats per number of rows in SVG | |
const TOTALS = [3, 15, 33, 61, 95, 138, 189, 247, 313, 388, 469, 559, 657, 762, 876, 997, 1126, 1263, 1408, 1560, 1722, 1889, 2066, 2250, 2442, 2641, 2850, 3064, 3289, 3519, 3759, 4005, 4261, 4522, 4794, 5071, 5358, 5652, 5953, 6263, 6581, 6906, 7239, 7581, 7929, 8287, 8650, 9024, 9404, 9793, 10187, 10594, 11003, 11425, 11850, 12288, 12729, 13183, 13638, 14109, 14580, 15066, 15553, 16055, 16557, 17075, 17592, 18126, 18660, 19208, 19758, 20323, 20888, 21468, 22050, 22645, 23243, 23853, 24467, 25094, 25723, 26364, 27011, 27667, 28329, 29001, 29679, 30367, 31061]; | |
/*Data object for a party to be drawn as an SVG group*/ | |
class SVGParty { | |
constructor(id, delegates, fill, stroke){ | |
this.id = id; |
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
class WritingBox { | |
/*Define a canvas as a WritingBox by instantiating a WritingBox with the id of the canvas | |
elemId: The id of the <canvas> element*/ | |
constructor(elemId){ | |
this.writingArea = document.getElementById(elemId); | |
this.gfxCtx = writingArea.getContext("2d"); | |
this.clickX = []; |