Skip to content

Instantly share code, notes, and snippets.

@Heliosmaster
Heliosmaster / oh-n0.clj
Last active February 13, 2019 20:12 — forked from skuro/readme.org
Meetup #111 solutions
(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))))
@Heliosmaster
Heliosmaster / core.clj
Last active December 12, 2018 19:34 — forked from skuro/forkme.md
Advent of Clojure solutions
(ns adventclj.core)
;; By Samuel McHugh and Davide Taviani
(defn compute-next [prev]
(-> prev
(* 252533)
(rem 33554393)))
(defn index [r c]
@Heliosmaster
Heliosmaster / haversine.clj
Created November 24, 2017 09:25 — forked from shayanjm/haversine.clj
Haversine Formula implementation in Clojure
; 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
@Heliosmaster
Heliosmaster / reclaimWindows10.ps1
Created January 7, 2017 19:45 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# 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
(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)))
(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] []]})