Install deps & start the python broadcast:
python -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
python broadcast.py
(ns a10n | |
(:require [clojure.set :as set] | |
[clojure.string :as str])) | |
(defn i4t [t2e w2d val] | |
(if (empty? w2d) | |
(assoc t2e :end val) | |
(update t2e | |
(first w2d) | |
i4t (rest w2d) val))) |
(declare unparse) | |
(defn unparse-args [lang args] | |
(cond | |
(map? (first args)) | |
(update-vals (first args) (partial unparse lang)) | |
:else | |
(mapv (partial unparse lang) args))) | |
(defn unparse [lang data] |
{:deps {org.apache.logging.log4j/log4j-api {:mvn/version "2.17.2"} | |
org.apache.logging.log4j/log4j-core {:mvn/version "2.17.2"} | |
org.apache.logging.log4j/log4j-layout-template-json {:mvn/version "2.17.2"} | |
org.apache.logging.log4j/log4j-slf4j18-impl {:mvn/version "2.17.2"}}} |
{-# LANGUAGE DeriveFunctor, StandaloneDeriving #-} | |
import Data.Functor.Classes (Show1) | |
data ExprFunctor a = Literal Int | Plus a a | Times a a | |
deriving (Show, Functor) | |
data LineNumber a = LineNumber Int a | |
deriving (Show, Functor) |
;;Merry Christmas from | |
;;Metosin! Run this | |
;;hand-baked Clojure | |
;;cookie to find our | |
;;wish for this holiday | |
(reduce reduce reduce[, | |
[reduce[comp][eval,,,,, | |
replace]][{\e,,,,,,,,,, | |
(comment)\h,,,,,,,,,,,, | |
assoc\i,,,,,,,,,,,,,,,, |
;;Rauhaisaa joulua ja | |
;;tulevaa vuotta! Alla | |
;;pala käsinleivottua | |
;;clojurekoodia. Nauti! | |
(reduce reduce reduce[, | |
[reduce[comp][eval,,,,, | |
replace]][{\i,,,,,,,,,, | |
(comment)\ä,,,,,,,,,,,, | |
assoc\t,,,,,,,,,,,,,,,, | |
str},,,,,,,,,,,,,,,,,,, |
module Day8 where | |
import Data.List | |
parseLine l = (map sort $ take 10 w, map sort $ drop 11 w) | |
where w = words l | |
input = map parseLine . lines <$> readFile "input.8" | |
part1 i = |
module Day7 where | |
import Data.List | |
parse :: String -> [Int] | |
parse s = read ("["++s++"]") | |
input = parse <$> readFile "input.7" | |
example = [16,1,2,0,4,2,7,1,2,14] |
module Day6 where | |
import Debug.Trace | |
import Data.Array | |
step = concatMap u | |
where u 0 = [6,8] | |
u n = [n-1] | |
fishnaive init d = length (iterate step [init] !! d) |