I hereby claim:
- I am 46bit on github.
- I am 46bit (https://keybase.io/46bit) on keybase.
- I have a public key whose fingerprint is 8866 3A0E CFCF 0786 D478 1D9D 8DA9 2997 13A7 9B14
To claim this, I am signing this object:
| // Serial code | |
| #include "stdhapr.h" // https://gist.github.com/46bit/8890761 | |
| #include "lpc17xx_timer.h" | |
| TIM_TIMERCFG_Type TIM_ConfigStruct; | |
| TIM_MATCHCFG_Type TIM_MatchConfigStruct; | |
| #define SEG7_0 0b11111100 | |
| #define SEG7_1 0b01100000 | |
| #define SEG7_2 0b11011010 |
| #include "lpc17xx_i2c.h" | |
| #include "lpc17xx_pinsel.h" | |
| #include "lpc17xx_uart.h" | |
| #include "lpc17xx_gpio.h" | |
| #include "lpc17xx_nvic.h" | |
| #include "lpc17xx_gpdma.h" | |
| #include "lpc17xx_adc.h" | |
| #include "lpc17xx_dac.h" | |
| #include <math.h> | |
| #include <string.h> |
I hereby claim:
To claim this, I am signing this object:
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <math.h> | |
| #include "postman.h" | |
| int main(int argc, char *argv[], char **envp) | |
| { | |
| // Parse AIs from stdin or command-line arguments. | |
| int i, ai_count = argc - 1; |
| struct game { | |
| struct character *characters_head, *characters_tail; | |
| struct player *players_head, *players_tail; | |
| struct round *rounds_head, *current_round, *rounds_tail; | |
| }; | |
| struct round { | |
| struct card *cards_head, *current_card, *cards_tail; | |
| struct player *start_player, *current_player; | |
| struct move *current_move; |
| match "posts/*.md" $ do | |
| route $ metadataRoute (\m -> | |
| constRoute $ | |
| (fromMaybe "year" $ Data.Map.lookup "year" m) ++ | |
| "/" ++ | |
| (fromMaybe "title" $ Data.Map.lookup "title" m) ++ | |
| ".html") | |
| compile $ pandocCompiler | |
| >>= loadAndApplyTemplate "templates/default.html" postCtx | |
| >>= relativizeUrls |
| data State = State { name :: Int | |
| , transitions :: [Transition] | |
| , accepting :: Bool | |
| } deriving (Show) | |
| data Transition = Transition { input :: Char | |
| , next :: State} deriving (Show) | |
| accept :: String -> Maybe State -> Bool | |
| accept _ Nothing = False | |
| accept [] (Just State {accepting = a}) = a |
| module TM ( | |
| State, | |
| Symbol, | |
| Direction(..), | |
| Transition, | |
| ZipTape, | |
| TM, | |
| prettyTransition, | |
| prettyZipTape, | |
| prettyTM, |
| import TM | |
| import Data.Maybe | |
| main :: IO () | |
| main = print . TM.prettyTM . TM.executeTM $ | |
| TM.createTM "bbc" [(0, 'a', 'b', TM.Idle, 1), (1, 'b', 'c', TM.Right, 1)] |