I hereby claim:
- I am invasionofsmallcubes on github.
- I am eianni (https://keybase.io/eianni) on keybase.
- I have a public key ASAh5nf99-7D7ks37JuV2kKkc_czLn77ISecmqEze2SW6wo
To claim this, I am signing this object:
{-# LANGUAGE OverloadedStrings #-} | |
module Domain ( AreaRole, RoleToAreas, groupByIdentityType ) where | |
import Data.Function (on) | |
import Data.List (sortBy, groupBy) | |
import Data.Ord (comparing) | |
data AreaRole = AreaRole { | |
role :: String, |
// goods/base.go | |
package goods | |
type base struct { | |
name string | |
price float64 | |
exported bool | |
} |
I hereby claim:
To claim this, I am signing this object:
;; https://adventofcode.com/2019/day/1 | |
(def massDatabase []) ;; get the input in the link | |
(defn roundDown | |
[num] (int (Math/floor num))) | |
(defn fuelRequired | |
[mass] | |
(- (roundDown (/ mass 3)) 2) | |
) |
;; https://adventofcode.com/2019/day/1 | |
(def massDatabase []) ;; get the input in the link | |
(defn roundDown | |
[num] (int (Math/floor num))) | |
(defn fuelRequired | |
[mass] | |
(- (roundDown (/ mass 3)) 2) | |
) |
;; https://adventofcode.com/2019/day/2 | |
(def intcodeProgram []) | |
(defn op | |
[step program instruction] | |
(let [pos1 (nth program (nth program (+ step 1))) | |
pos2 (nth program (nth program (+ step 2))) | |
resultPos (nth program (+ step 3))] | |
(assoc program resultPos (instruction pos1 pos2)))) |
;; https://adventofcode.com/2019/day/2 | |
(def intcodeProgram []) ;; get from the exercise | |
(defn op | |
[step program instruction] | |
(let [pos1 (nth program (nth program (+ step 1))) | |
pos2 (nth program (nth program (+ step 2))) | |
resultPos (nth program (+ step 3))] | |
(assoc program resultPos (instruction pos1 pos2)))) |
;; https://adventofcode.com/2019/day/3 | |
;; EXERCISES | |
(ns cljbrave.core) | |
(defrecord Movement [direction length]) | |
(defrecord Coordinate [x y]) |
(ns cljbrave.day4) | |
(defn digits | |
[n] | |
(loop [result (list) | |
n n] | |
(if (pos? n) | |
(recur (conj result (rem n 10)) | |
(quot n 10)) | |
result))) |