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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<project source="2.7.1" version="1.0"> | |
This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/). | |
<lib desc="#Wiring" name="0"/> | |
<lib desc="#Gates" name="1"/> | |
<lib desc="#Plexers" name="2"/> | |
<lib desc="#Arithmetic" name="3"/> | |
<lib desc="#Memory" name="4"> | |
<tool name="ROM"> | |
<a name="contents">addr/data: 8 8 |
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 Control.Applicative (Alternative) | |
import Control.Monad | |
import GHC.Base (Alternative (empty, (<|>))) | |
-- Proving that Option is a Functor, a Monad, an Applicative and more! | |
data Option a = Some a | None | |
deriving (Show, Eq) | |
-- 1. it is a functor! (surprise) |
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 <stdio.h> | |
int main() { | |
int r = 4; | |
while (r--) { | |
for (int o = 7; o >= 0; putchar(" #"[(((0x7cf5 >> 0x4*r) & 0xf) >> o-- & 1)])); | |
putchar('\n'); | |
} | |
return 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
/ |
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
make_game ← {¯2 + {?⍵ ⍵⍴3}⍵} | |
sum_hv ← {g←⍵ ⋄ (+/¨) ¨ ({⍵⌷g}¨⍳≢g) ({⍵⌷⍉g}¨⍳≢g)} | |
sum_dlr ← {g←⍵ ⋄ y←≢g ⋄ (+/) ¨ ({⍵ (y-⍵-1)⌷g}¨⍳y) ({⍵ ⍵⌷g}¨⍳y)} | |
won_hv ← +/¨ 1 ¯1 × { t←≢⍵ ⋄ ∨/ t (¯1×t)∘.=sum_hv ⍵} | |
won_dg ← 1 ¯1 × {t←≢⍵ ⋄ ∨/ t (¯1×t)∘.=sum_dlr ⍵} | |
idx_empt_map ← {(⍵=0)×({{⍵∘.,⍵}⍳≢⍵} ⍵)} | |
idx_empt ← {(,idx_empt_map ⍵)~⊂0 0} | |
at ← {(g r c)←⍵ ⋄ (r c⌷g)←⍺ ⋄ g} | |
emul_emp ← {g←⍵ ⋄ ⍺ {(r c)←⍵ ⋄ ⍺ at g r c} ¨idx_empt ⍵} | |
won_fl ← { { ({⌈/⊃⌈/⍵}⍵) ({⌊/⊃⌊/⍵}⍵) } (won_hv ⍵) (won_dg ⍵)} |
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
// $ gcc pack.c -o pack | |
// $ ./pack e "Hello World!" | ./pack d | |
// Hello World! | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
#include <math.h> |