Skip to content

Instantly share code, notes, and snippets.

View Arnauld's full-sized avatar
🐻‍❄️

Arnauld Loyer Arnauld

🐻‍❄️
View GitHub Profile
@Arnauld
Arnauld / breaz.clj
Last active April 5, 2016 14:38
(prime-numbers.core/breaz (* 25 1000000))
(ns prime-numbers.core)
; http://clj-me.cgrand.net/2009/07/30/everybody-loves-the-sieve-of-eratosthenes/
(defn primes3 [max]
(let [enqueue (fn [sieve n factor]
(let [m (+ n (+ factor factor))]
(if (sieve m)
(recur sieve m factor)
(assoc sieve m factor))))
next-sieve (fn [sieve candidate]
@Arnauld
Arnauld / Player.clj
Created March 4, 2016 07:33
Coders strike back
(ns Player
(:gen-class)
(:import (java.io StringReader)
(clojure.lang LineNumberingPushbackReader)))
;---------------------------------------------------------------
; _ _ _ _ _ _
; _ _| |_(_) (_) |_(_) ___ ___
; _____| | | | __| | | | __| |/ _ \/ __|
; |_____| |_| | |_| | | | |_| | __/\__ \

1er paragraph

ie => i.e.

Simple comme TDD.

Pas de point à la fin

Et en plus ces tests étaient détectés automatiquement par la chaîne de build Jenkins, exécutés tout le temps lors de mon développement…

/*
* The MIT License
*
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
* Erik Ramfelt, Koichi Fujikawa, Red Hat, Inc., Seiji Sogabe,
* Stephen Connolly, Tom Huybrechts, Yahoo! Inc., Alan Harder, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
// Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project
// for more guidance on F# programming.
#light
open Microsoft.FSharp.Reflection
let Fail message = failwith message
let IsTrue(success) = if not success then failwith "Expected true"
let AreEqual(expected, actual) =
if not (expected = actual) then
F# Interactive for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
For help type #help;;
>
>
[BuildingCard {color = Blue;
number = 1;}; BuildingCard {color = Red;
number = 1;};
BuildingCard {color = Yellow;
@Arnauld
Arnauld / kata-roadmap-01.md
Last active August 29, 2015 14:23
Kata - roadmap

Roman Numerals Kata

The Romans wrote their numbers using letters; specifically the letters 'I' meaning '1', 'V' meaning '5', 'X' meaning '10', 'L' meaning '50', 'C' meaning '100', 'D' meaning '500', and 'M' meaning '1000'.

There were certain rules that the numerals followed which should be observed:

  • The symbols 'I', 'X', 'C', and 'M' can be repeated at most 3 times in a row.
  • The symbols 'V', 'L', and 'D' can never be repeated.
  • The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and 'IX', 'XL' and 'XC', 'CD' and 'CM').
  • Only one subtraction can be made per numeral ('XC' is allowed, 'XXC' is not).
@Arnauld
Arnauld / Player.clj
Created December 19, 2014 10:25
Platinum-rift [CLOJURE]
(ns Player
(:gen-class)
(:import (java.io StringReader)
(clojure.lang LineNumberingPushbackReader PersistentQueue))
(:use clojure.set))
;---------------------------------------------------------------
; _ _ _ _ _ _
; _ _| |_(_) (_) |_(_) ___ ___
@Arnauld
Arnauld / Player.java
Created December 19, 2014 10:23
Platinum-rift [JAVA]
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
/**
*
*/