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
#!/usr/bin/env ruby | |
require "net/http" | |
require "uri" | |
require "json" | |
require "base64" | |
class Imgur | |
API_KEY = "15a6efd29935f62ea87579a8325d945a" | |
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 System.IO | |
import System.Posix | |
import Network | |
import Network.Socket hiding (accept) | |
import Data.List | |
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
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
Please try to write in here | |
Hey look it's a new line! |
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
; Alice's point of view | |
yourbikes A | |
mapwidth 15 | |
mapheight 15 | |
map Aa.............. | |
map a.............. | |
map ............... | |
map .#............ | |
map .............. | |
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
yourbikes A | |
mapwidth 15 | |
mapheight 15 | |
map Aa.............. | |
map a.............. | |
map ............... | |
map .#............ | |
map .............. | |
map ..#.......... | |
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
+-------+-------+ | |
| | | | |
| A1-> | <-B | | |
| | | | |
+-------+-------+ | |
| ^ | | | |
| A2 | | | |
| | | | |
+-------+-------+ |
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
1. Map each ant to the number of ants it's fighting. | |
2. For each number, keep it only if all of its opposing neighbors are larger. | |
Example: | |
A A A - | |
A B C D | |
A1 A2 A3 -- | |
A1 B3 C2 D1 |
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
A-A-A | |
-A-A- | |
B-B-B | |
-B-B- | |
1-1-1 | |
-3-3- | |
2-3-2 | |
-1-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
data NumTree a b = NumNode (a, b) (Maybe [NumTree a b]) | |
| NumNil | |
deriving (Eq, Show) | |
data Tree a = Node a (Maybe [Tree a]) | |
| Nil | |
deriving (Eq, Show) | |
numberTree :: Tree a -> State Int (NumTree Int a) | |
numberTree Nil = return NumNil |
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
# cat packages | xargs apt-get install | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following package was automatically installed and is no longer required: | |
libgmp3-dev | |
Use 'apt-get autoremove' to remove them. | |
The following extra packages will be installed: | |
libgmp-dev libgmp10 libgmp3-dev libgmpxx4ldbl zlib1g-dev | |
Suggested packages: |
OlderNewer