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
{- | |
lockpick.hs | |
Copyright (C) 2020 Jonathan Lamothe <jonathan@jlamothe.net> | |
This work is licensed under the Creative Commons CC BY-SA 3.0 License. | |
To view a copy of the license, visit | |
<https://creativecommons.org/licenses/by-sa/3.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
module Pizza ( Pizza (..) | |
, Topping (..) | |
) where | |
data Pizza = Pizza [Topping] | |
deriving (Eq, Show) | |
data Topping = | |
Pepperoni | | |
GreenPepper | |
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 Graphics.UI.SDL as SDL | |
import qualified Graphics.UI.SDL.Primitives as Draw | |
main = SDL.withInit [SDL.InitEverything] $ do | |
SDL.setVideoMode 640 480 32 [SDL.Fullscreen] | |
>>= drawScreen | |
eventLoop | |
drawScreen :: SDL.Surface -> IO () | |
drawScreen s = 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
#include <stdint.h> | |
#define CRC16 0x8005 | |
uint16_t gen_crc16(const uint8_t *data, uint16_t size) | |
{ | |
uint16_t out = 0; | |
int bits_read = 0, bit_flag; | |
/* Sanity check: */ |