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
/* | |
* FE Editor - GBA Fire Emblem (U) ROM editor | |
* | |
* Copyright (C) 2008-2011 Hextator, | |
* hextator (AIM) hextator@gmail.com (MSN) | |
* | |
* Major thanks to Zahlman (AIM/MSN: zahlman@gmail.com) for optimization, | |
* organization and modularity improvements. | |
* | |
* This program is free software; you can redistribute it and/or modify |
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
/* | |
* FE Editor - GBA Fire Emblem (U) ROM editor | |
* | |
* Copyright (C) 2008-2011 Hextator, | |
* hextator (AIM) hextator@gmail.com (MSN) | |
* | |
* Major thanks to Zahlman (AIM/MSN: zahlman@gmail.com) for optimization, | |
* organization and modularity improvements. | |
* | |
* This program is free software; you can redistribute it and/or modify |
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
/* | |
* FE Editor - GBA Fire Emblem (U) ROM editor | |
* | |
* Copyright (C) 2008-2011 Hextator, | |
* hextator (AIM) hextator@gmail.com (MSN) | |
* | |
* Major thanks to Zahlman (AIM/MSN: zahlman@gmail.com) for optimization, | |
* organization and modularity improvements. | |
* | |
* This program is free software; you can redistribute it and/or modify |
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
public String ASCIIToUnicode(byte[] data) | |
{ | |
String output = ""; | |
for (int i = 0; i < data.length; i++) | |
{ | |
switch (data[i]) | |
{ | |
case 0: | |
output += "[X]"; |
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
-- Author: CT075 | |
import Data.List | |
import Data.Maybe | |
dictGet :: (Eq k) => k -> [(k,v)] -> Maybe v | |
dictGet key = foldr (\(k,v) acc -> if key == k then Just v else acc) Nothing | |
resolveLink :: [Char] -> [([Char], [Char])] -> [Char] | |
resolveLink ln links = foldl (\acc (x, y) -> replacePrefix acc x y) ln links |
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
-- Author: CT075 | |
import Data.List | |
import Data.Maybe | |
dictGet :: (Eq k) => k -> [(k,v)] -> Maybe v | |
dictGet key = foldr (\(k,v) acc -> if key == k then Just v else acc) Nothing | |
resolveLink :: [Char] -> [([Char], [Char])] -> [Char] | |
resolveLink ln links = foldl (\acc (x, y) -> replacePrefix acc x y) ln (sortBy symCmp links) |
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/python | |
# Written by CT075 | |
import functools, random | |
# TODO: Make a dynamic programming solution | |
# The reason I cast between tuple and list is so the lru cache doesn't | |
# complain about lists being an "unhashable type" | |
@functools.lru_cache(maxsize=64) | |
def find_soln(targ, nums, cache={}): |
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
#lang racket | |
(define (is-triangular n) | |
(let ([q (+ 1 (* 8 n))]) | |
(eqv? (integer-sqrt q) (sqrt q)))) | |
(define (encode-string str) | |
(encode-charlist (string->list str))) | |
(define (encode-charlist clist) |
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
# Written by CT075 | |
from operator import mul | |
from functools import reduce, lru_cache | |
from math import sqrt, ceil | |
@lru_cache(maxsize=64) | |
def prime_factors(n): | |
for i in range(2, ceil(sqrt(n))+1): | |
if n % i == 0: return [i] + prime_factors(n/i) |
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
# Written by CT075 | |
import json | |
# Turn the string read from matrix.txt into a 2d list | |
def process_matrix(data): | |
data = '[[' + data | |
data = data.replace('\n', '],[') | |
data = data[:-2] + ']' | |
return json.loads(data) |
OlderNewer