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
servers = ( | |
{ | |
address = "irc.lainchan.org"; | |
chatnet = "lainchan"; | |
port = "6697"; | |
use_tls = "yes"; | |
tls_verify = "yes"; | |
autoconnect = "yes"; | |
} | |
); |
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 Text.Parsec | |
data Term = Plus Term Term | |
| Minus Term Term | |
| Div Term Term | |
| Mult Term Term | |
| Number Integer | |
deriving (Show) | |
type TermParser a = Parsec String () a |
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
;-*-syntax:COMMON-LISP;Package:(RT :use "COMMON-LISP" :colon-mode :external)-*- | |
#|----------------------------------------------------------------------------| | |
| Copyright 1990 by the Massachusetts Institute of Technology, Cambridge MA. | | |
| | | |
| Permission to use, copy, modify, and distribute this software and its | | |
| documentation for any purpose and without fee is hereby granted, provided | | |
| that this copyright and permission notice appear in all copies and | | |
| supporting documentation, and that the name of M.I.T. not be used in | | |
| advertising or publicity pertaining to distribution of the software | |
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.Monoid | |
import Control.Monad | |
import Control.Applicative | |
(<<>>) :: (Monad m, Monoid a) => m a -> m a -> m a | |
a <<>> b = (<>) <$> a <*> b | |
(<<>) :: (Monad m, Monoid a) => m a -> a -> m a | |
a <<> b = (<>) <$> a <*> (return b) |
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 TemplateHaskell #-} | |
import System.IO | |
import Text.Parsec | |
import Control.Monad.State | |
import Control.Monad | |
import Control.Monad.Loops | |
import Control.Lens | |
import Data.Maybe | |
import Data.Map.Strict (Map) |
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
data Verb = Look | |
| Take | |
| Drop | |
| Put | |
deriving (Enum, Show, Eq) | |
data Thing = Player | |
| Lantern | |
| Sword | |
| Bag |
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
"alien" by "whiteline" | |
the sick bay is a room. | |
the corridor is a room. | |
the freezer is a room. | |
the sick bay is west of the corridor. |
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
;;;; Fibonacchi recursive tree solution in non-exponential time challenge code. | |
(defun fib (n) | |
(check-type n (integer 0 *)) | |
(labels ((fib-inner (n) | |
(case n | |
((0) 0) | |
((1) 1) | |
(otherwise (+ (fib (- n 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
(defun convert (string) | |
(let ((designators '(("0y" . 2) | |
("0o" . 8) | |
("0x" . 16)))) | |
(cond ((string= "" string) 0) | |
((every #'digit-char-p string) | |
(parse-integer string)) | |
((> (length string) 2) | |
(parse-integer string | |
:start 2 |
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
struct struct_i_want_to_put_inna_list { | |
struct list_head nextelem; | |
int mydata; | |
}; | |
struct list_head my_list; | |
INIT_LIST_HEAD(&my_list); | |
struct struct_i_want_to_put_inna_list *current_elem; |