Skip to content

Instantly share code, notes, and snippets.

View invasionofsmallcubes's full-sized avatar
👻
Fool Stack Developer

Emanuele Ianni invasionofsmallcubes

👻
Fool Stack Developer
View GitHub Profile
@invasionofsmallcubes
invasionofsmallcubes / onumitama.js
Created May 2, 2022 23:08
A FizzBuzz TDD Kata done using only Github Copilot
// create a function called onumitama that accepts a number and returns 'LaL'
function onumitama(num) {
// if num is divisible by 3 and by 5, return 'LaLPoP'
if (num % 3 === 0 && num % 5 === 0) {
return 'LaLPoP'
}
// if num is divisible by 3, return 'LaL'
if (num % 3 === 0) {
return 'LaL'
}
@invasionofsmallcubes
invasionofsmallcubes / main.c
Created September 2, 2020 14:31
main.c - lesson #1 - elementary programming
#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;
{"lastUpload":"2020-04-20T11:00:05.184Z","extensionVersion":"v3.4.3"}
@invasionofsmallcubes
invasionofsmallcubes / aoc_day4.clj
Created December 24, 2019 01:49
Advent Of Code - 2019 - DAY 4 #adventOfCode2019
(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 December 23, 2019 00:29
Advent of Code Day 3 #adventOfCode2019
;; 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 December 3, 2019 16:45
Advent of Code Day 2 + Ex 2 #adventOfCode2019
;; 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 December 3, 2019 16:49
Advent Of Code - 2019 - DAY 2 - EX 1 #adventOfCode2019
;; 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 December 3, 2019 16:50
Advent Of Code - 2019 - DAY 1 - EX 2 #adventOfCode2019
;; 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 December 3, 2019 16:52
Advent Of Code - 2019 - DAY 1 - EX 1 #adventOfCode2019
;; 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 January 31, 2020 22:04
Digital Board Game Night - Games List