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
(ns oh-n0.core) | |
(defn transpose [board] | |
(apply mapv vector board)) | |
(defn right-elems [board [i j]] | |
(drop (inc j) (get board i))) | |
(defn left-elems [board [i j]] | |
(reverse (take j (get board i)))) |
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
(ns adventclj.core) | |
;; By Samuel McHugh and Davide Taviani | |
(defn compute-next [prev] | |
(-> prev | |
(* 252533) | |
(rem 33554393))) | |
(defn index [r c] |
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
; Haversine formula | |
; a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2) | |
; c = 2 ⋅ atan2( √a, √(1−a) ) | |
; d = R ⋅ c | |
; where φ is latitude, λ is longitude, R is earth’s radius (mean radius = 6,371km); | |
(defn haversine | |
"Implementation of Haversine formula. Takes two sets of latitude/longitude pairs and returns the shortest great circle distance between them (in km)" | |
[{lon1 :lng lat1 :lat} {lon2 :lng lat2 :lat}] | |
(let [R 6378.137 ; Radius of Earth in km |
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <[email protected]> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.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
(ns minesweeper-dojo.core) | |
;; written by Davide Taviani and Mohammad Noureldin | |
(def input1 [3 1 1]) | |
(defn is-full-of-mines? [rows cols mine-count] | |
(= (+ mine-count 1) | |
(* rows cols))) |
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
(ns nonograms-dojo.core) | |
;; Nonograms by Davide Taviani and Boris Arkenaar | |
(defn transpose [m] | |
(apply mapv vector m)) | |
(def input-data | |
{:size [10 10] | |
:rows [[] [1 1] [1] [2 1 1] [1 1 1] [1 2 1 1] [1] [1] [] []] | |
:cols [[] [1] [] [3] [1 1] [] [5] [1] [1 4] []]}) |