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
tote - sdlc loop running tests on file modification | |
interesting kata to use a perl6 idiom: prime factors (because of the 1,1 {@_ ...}, where the @_ collects all previous arguments - could create the sieve of Eratosthenes) | |
gather for @values { | |
... | |
yield $value; | |
... | |
} |
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
import java.util.ArrayList; | |
import java.util.List; | |
public class Combinations { | |
public List<List<Boolean>> generateCombinations(List<List<Boolean>> values) { | |
List <List<Boolean>> accumulator = new ArrayList<List<Boolean>>(); | |
List<Boolean> firstTuple = values.get(0); | |
List<List<Boolean>> remainingTuples = values.subList(1, values.size()); |
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
(defn print-tree | |
([tree] | |
(print-tree tree "")) | |
([tree prefix] | |
(apply str prefix (first tree) "\n" | |
(map #(print-tree %1 (str prefix "\t")) (rest tree))))) | |
(deftest print-tree-test | |
(is (= (print-tree | |
'(parent |