Skip to content

Instantly share code, notes, and snippets.

View iandioch's full-sized avatar
Ag déanamh tada

Noah Ó Donnaile iandioch

Ag déanamh tada
View GitHub Profile
@iandioch
iandioch / input.in
Created December 10, 2017 21:59
Advent of code day 10 input
18,1,0,161,255,137,254,252,14,95,165,33,181,168,2,188
@iandioch
iandioch / crack.py
Created February 22, 2018 21:40
Crack a monoalphabetic cypher
ORDERED_ENGLISH = [c for c in "ETAOINSHRDLCUMWFGYPBVKJXQZ"]
# Dict mapping cypher letter to decrypted letter. Was empty in the beginning.
# Built up piece by piece, first by finding the H between T's and E's to create the
# words "the", "then", "them", "their". Confirmed "PYH" -> "THE".
# Noticed garbled form of the word "sincerity" in the middle of the text. Added
# mappings to fix it. Confirmed "AO" -> "RI".
# Text started to take shape. Noticed lots of garbled "of"s across the text.
# Added "L" -> "O". Also added "Z" -> "W" to fix "whatever".
known = {
@iandioch
iandioch / totients.go
Created December 31, 2015 02:28
Golang implementation of Euler's totient/phi function
/*
* Go implementation of Euler's product formula to find for the totient function (aka. phi function)
* https://en.wikipedia.org/wiki/Euler's_totient_function#Euler.27s_product_formula
*/
package main
import (
"fmt"
)
@iandioch
iandioch / cirlcey_spirally_thing.js
Created July 6, 2018 09:36
p5js random wee experiment
var fcount = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
noStroke();
smooth();