- Juni 2014
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Turtle | |
import Prelude hiding (FilePath) | |
import Data.Either (rights) | |
import qualified Control.Foldl as F | |
import qualified Data.Text as T | |
import Data.Text() |
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
% use with > pdflatex --jobname=games-p1 games.tex | |
\documentclass{article} | |
\usepackage{graphics} | |
\usepackage{amsfonts,amssymb,amsmath} | |
\usepackage{tikz} | |
\usetikzlibrary{positioning} | |
\pgfrealjobname{games} | |
\begin{document} | |
\beginpgfgraphicnamed{games-p1} |
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: Martin Heuschober | |
% License: CC-BY-4.0 | |
% see https://creativecommons.org/licenses/by/4.0/ | |
\documentclass{article} | |
\usepackage[paperwidth=55cm | |
,paperheight=45cm | |
,left=1cm | |
,right=1cm | |
,top=1cm |
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
{- my (=ε/2) haskellous version of the game called mastermind -} | |
import Data.List.Split (splitOneOf) | |
{- has to be fetched with | |
foo@bar~> cabal update | |
foo@bar~> cabal install split | |
-} | |
import Random | |
main = do |
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 Transformer (dec2bin, bin2dec, dec2hex, hex2dec, num2letters, letters2num) where | |
dec2bin :: Int -> [Int] | |
dec2bin n | |
|n==0 = [] | |
|otherwise = (dec2bin (div n 2))++[mod n 2] | |
bin2dec :: [Int] -> Int | |
bin2dec bs = foldl1 (\x y ->x*2+y) bs |
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 MyCombinatorics where | |
import Data.List ( (\\), | |
sort) | |
import Control.Applicative ( liftA2, | |
Applicative, | |
pure) | |
(^*) :: (a -> b) -> (b -> c) -> a -> c | |
f ^* g = g . f |
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 MyCombinatorics where | |
import Data.List ( (\\), | |
sort) | |
import Control.Applicative ( liftA2, | |
Applicative, | |
pure) | |
(^*) :: (a -> b) -> (b -> c) -> a -> c | |
f ^* g = g . f |
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
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE ViewPatterns #-} | |
{-# LANGUAGE BangPatterns #-} | |
import Control.Monad | |
import Control.Monad.Random |
OlderNewer