Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
Fool Stack Developer

Emanuele Ianni invasionofsmallcubes

👻
Fool Stack Developer
View GitHub Profile
@invasionofsmallcubes
invasionofsmallcubes / main.c
Created Sep 2, 2020
main.c - lesson #1 - elementary programming
View main.c
#include <stdio.h>
int main() {
int j;
int i;
printf("Tell i\n");
scanf("%d", &i);
printf("Tell j\n");
scanf("%d", &j);
int sum = i + j;
View cloudSettings
{"lastUpload":"2020-04-20T11:00:05.184Z","extensionVersion":"v3.4.3"}
@invasionofsmallcubes
invasionofsmallcubes / aoc_day4.clj
Created Dec 24, 2019
Advent Of Code - 2019 - DAY 4 #adventOfCode2019
View aoc_day4.clj
(ns cljbrave.day4)
(defn digits
[n]
(loop [result (list)
n n]
(if (pos? n)
(recur (conj result (rem n 10))
(quot n 10))
result)))
@invasionofsmallcubes
invasionofsmallcubes / aoc_day3.clj
Last active Dec 23, 2019
Advent of Code Day 3 #adventOfCode2019
View aoc_day3.clj
;; https://adventofcode.com/2019/day/3
;; EXERCISES
(ns cljbrave.core)
(defrecord Movement [direction length])
(defrecord Coordinate [x y])
@invasionofsmallcubes
invasionofsmallcubes / aoc_day2_ex2.clj
Last active Dec 3, 2019
Advent of Code Day 2 + Ex 2 #adventOfCode2019
View aoc_day2_ex2.clj
;; 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))))
@invasionofsmallcubes
invasionofsmallcubes / aoc_day2_ex1.clj
Last active Dec 3, 2019
Advent Of Code - 2019 - DAY 2 - EX 1 #adventOfCode2019
View aoc_day2_ex1.clj
;; 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))))
@invasionofsmallcubes
invasionofsmallcubes / aoc_day1_ex2.clj
Last active Dec 3, 2019
Advent Of Code - 2019 - DAY 1 - EX 2 #adventOfCode2019
View aoc_day1_ex2.clj
;; 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)
)
@invasionofsmallcubes
invasionofsmallcubes / aoc_day1_ex1.clj
Last active Dec 3, 2019
Advent Of Code - 2019 - DAY 1 - EX 1 #adventOfCode2019
View aoc_day1_ex1.clj
;; 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)
)
@invasionofsmallcubes
invasionofsmallcubes / games-list.md
Last active Jan 31, 2020
Digital Board Game Night - Games List
View games-list.md
View keybase.md

Keybase proof

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: