[ Launch: Tributary inlet ] 81db45c62842f5d05064 by joxn
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
{-# OPTIONS_GHC -Wall -Werror #-} | |
module Roman( numerals ) where | |
import Data.List( unfoldr ) | |
numerals :: Integer -> String | |
numerals = concat . unfoldr getNextRoman | |
where | |
getNextRoman n | n >= 1000 = Just ("M", n - 1000) | |
| n >= 900 = Just ("CM", n - 900) | |
| n >= 500 = Just ("D", n - 500) |
I hereby claim:
- I am joxn on github.
- I am joxn (https://keybase.io/joxn) on keybase.
- I have a public key ASDJ6TfLy_ZePoakuPYeHVEdpPQWFj7qlwFiSK_3kIeClQo
To claim this, I am signing this object:
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 Board: | |
# details omitted | |
def solve_optimal(self): | |
# self.cur_color: Dict[Tile, Color] | |
# the current board state, what color is on each tile | |
# self.cur_placement: Dict[Color, Tile] | |
# the current board state, where each color is sitting now | |
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 math, itertools | |
def keyno(f): | |
return 12 * math.log2(f/440) + 49 | |
def gbfreq(n): | |
return 131072/(2048-n) | |
def keyfreq(k): | |
return math.pow(2, (k - 49)/12) * 440 |