From c7b2c982004e350f5e3032321baadfc9021b6bad Mon Sep 17 00:00:00 2001 From: dozens Date: Thu, 20 Jun 2024 09:17:06 -0600 Subject: 🗄️ big tidy up - isolate core game logic and move it to src/game.fnl - main.fnl should be just the ui now - move all table funcs into lib/table - move all (1) string funcs into lib/string - move all game funcs into lib/game/ --- lib/all-mills.test.fnl | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 lib/all-mills.test.fnl (limited to 'lib/all-mills.test.fnl') diff --git a/lib/all-mills.test.fnl b/lib/all-mills.test.fnl deleted file mode 100644 index 7f33ab1..0000000 --- a/lib/all-mills.test.fnl +++ /dev/null @@ -1,41 +0,0 @@ -(let [{: describe - :end test-end} (require :lib.test) - {: all-mills? - : toggle-player - : only-player-moves - : all-moves-are-mills? - } (require :lib.all-mills)] - - (describe "all-mills" (fn [] - (describe "#toggle-player()" (fn [t] - (t {:given "a player" - :should "return the next" - :expected 2 - :actual (toggle-player 1) - }))) - (describe "#only-player-moves()" (fn [t] - (let [moves [ 0 2 0 2 2 2 0 0 0 0 0 0 0 2 0 0 0 2 0 2 0 1 1 1 ] - expected [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 ] - ] - (t {:given "a bunch of moves and a player" - :should "filter out all the moves not belonging to the player" - : expected - :actual (only-player-moves moves 1) - })))) - (describe "#all-moves-are-mills?()" (fn [t] - (let [moves [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 ] - ] - (t {:given "a bunch of moves and a player" - :should "return true if all the player moves are mills" - :expected true - :actual (all-moves-are-mills? moves 1) - })) - (let [moves [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 ] - ] - (t {:given "a bunch of moves and no mill and a player" - :should "return false" - :expected false - :actual (all-moves-are-mills? moves 1) - })))) - (test-end)))) - -- cgit 1.4.1-2-gfad0