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
module Isometric | |
( Obj (..) , World , isometric , mark , render , seenFrom , solid | |
) where | |
import Codec.Picture (PixelRGBA8 (..), writePng, Image) | |
import Data.Monoid ((<>)) | |
import Data.Function (on) | |
import Data.List (transpose, genericLength, sortBy) | |
import Data.Ord (comparing) | |
import Data.Matrix (Matrix, fromList, toList, transpose) |
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 Codec.Picture( PixelRGBA8( .. ), writePng, Image) | |
import Control.Arrow (first,second) | |
import Data.Function (on) | |
import Data.List (sort, nub, sortBy, groupBy, nubBy, delete, zip4, (\\), zipWith4) | |
import Data.List.Split (chunksOf) | |
import Data.Monoid ((<>)) | |
import Data.Ord (comparing) | |
import Debug.Trace (trace) | |
import Graphics.Rasterific | |
import Graphics.Rasterific.Texture (uniformTexture) |
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 Codec.Picture( PixelRGBA8( .. ), writePng ) | |
import Graphics.Rasterific | |
import Graphics.Rasterific.Texture | |
import Graphics.Rasterific.Transformations | |
import Data.List | |
refl = transform $ applyTransformation | |
Transformation { _transformA = 0.0, _transformC = 1.0, _transformE = 0.0, | |
_transformB = 1.0, _transformD = 0.0, _transformF = 0.0 | |
} |
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 qualified Control.Monad as N (forM) | |
import qualified Data.Maybe as B (isJust, isNothing, fromJust, catMaybes) | |
import qualified Data.Char as C (isAsciiLower) | |
import qualified Data.Function as F (on) | |
import qualified Data.List as L (all, nub, groupBy, intercalate) | |
import qualified Data.List.Split as L (chunksOf) | |
import qualified Data.Map.Strict as M (Map, insert, empty, unions, findWithDefault) | |
import qualified Language.Words as W (allStringWords) | |
type Box = Maybe Char |
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
digraph G { | |
size = "4,4"; | |
"[1,1,1,1]" -> "[1,1,2]" [label="1"]; | |
"[1,1,2]" -> "[1,1,2]" [label="1/2"]; | |
"[1,1,2]" -> "[1,3]" [label="1/3"]; | |
"[1,1,2]" -> "[2,2]" [label="1/6"]; | |
"[1,3]" -> "[1,3]" [label="1/2"]; | |
"[1,3]" -> "[2,2]" [label="1/4"]; | |
"[1,3]" -> "[4]" [label="1/4"]; | |
"[2,2]" -> "[1,3]" [label="2/3"]; |
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 Data.List | |
import Data.List.Split (chunksOf) | |
import Data.Char | |
data Suit = Club | Heart | Diamond | Spade deriving (Show, Read, Eq) | |
data Sex = Out | In deriving (Show, Read, Eq) | |
data Side = Side { suit :: Suit , sex :: Sex} deriving (Show, Read) | |
instance Eq Side where x == y = (suit x == suit y) && (sex x /= sex y) | |
data Piece = Piece { north :: Side , east :: Side | |
, south :: Side , west :: Side } deriving (Show, Read, Eq) |
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 Data.Map as M | |
import Data.Maybe | |
import Numeric | |
learn :: [Bool] -> Map [Bool] Double -> Map [Bool] Double | |
learn hist brain = Prelude.foldr learn' brain [3..5] | |
where learn' n = M.insertWithKey (const (+)) (take n hist) 1.0 | |
guess :: Map [Bool] Double -> [Bool] -> Bool | |
guess brain hist = wAvg (Prelude.map guess' [2..4]) >= 0.5 |
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
" CUSTOM .VIMRC by JAMES BUCKLAND | |
" james.adam.buckland@gmail.com | |
" created June 01 2014 | |
" :so % | |
" | |
"PLUGINS | |
call pathogen#infect() " enable pathogen extention handler | |
filetype plugin indent on " idk, something to do with plugins | |
set laststatus=2 " i'll be honest, i have no idea what this does. but it makes |
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
# regular leader key | |
set -g prefix 'C-b' | |
bind-key 'C-b' send-prefix | |
set -g default-terminal "screen-256color" | |
set -sg escape-time 0 #Escape works without delay, important for Vim | |
#Star window and pane indexing at 1 | |
set -g base-index 1 | |
set -g pane-base-index 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
%typeset \sgn as an upright operator name, like \sin. ex: \sgn(x) | |
\DeclareMathOperator{\sgn}{sgn} | |
%rename built-in command \v to \vaccent, to make room for... | |
\let\vaccent=\v | |
% ...\v, which typesets a bold, upright vector. ex: \v a | |
\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} | |
% ... and \gv, which does the same for greek letters. ex: \gv\alpha |
NewerOlder