set-cover 0.0.2 → 0.0.3
raw patch · 2 files changed
+70/−4 lines, 2 files
Files
- example/Baumeister.hs +68/−2
- set-cover.cabal +2/−2
example/Baumeister.hs view
@@ -1,5 +1,7 @@ {- | Logika's Baumeister puzzle++<http://www.mathe-kaenguru.de/wettbewerb/baumeister/> -} module Main where @@ -73,11 +75,50 @@ propNumberOfAtoms = Cuboid.numberOf2LayerAtoms shapes == 30 -targetBase, targetE, targetPyramid :: [[String]]+targetBase, target5Pips, targetPlus, targetA, targetE, targetS, targetO,+ targetNarrowStair, targetWideStair, targetPyramid :: [[String]] targetBase = let line = replicate 5 '.' in [replicate 5 line, ["", "", line, "", ""]] +-- impossible+target5Pips =+ let line = replicate 5 '.'+ in [replicate 5 line,+ ". ." :+ " " :+ " . " :+ " " :+ ". ." :+ []]++targetPlus =+ let line = replicate 5 '.'+ in [replicate 5 line,+ " " :+ " . " :+ " ... " :+ " . " :+ " " :+ []]++targetA =+ (+ "....." :+ ". ." :+ "....." :+ ". ." :+ ". ." :+ []) :+ (+ " ... " :+ ". ." :+ "....." :+ ". ." :+ ". ." :+ []) :+ []+ targetE = replicate 3 $ "..." :@@ -87,6 +128,28 @@ "..." : [] +targetS =+ replicate 3 $+ " ..." :+ " . ." :+ ". . " :+ "... " :+ []++targetO =+ replicate 3 $+ "..." :+ ". ." :+ ". ." :+ "..." :+ []++targetNarrowStair =+ map (\n -> replicate 2 $ replicate n '.') [5,4,3,2,1]++targetWideStair =+ map (\n -> replicate 3 $ replicate n '.') [4,3,2,1]+ targetPyramid = map (\n -> replicate n $ replicate n '.') [4,3,2,1] @@ -142,7 +205,10 @@ main, mainBase :: IO () mainBase =- forM_ [targetBase, targetE, targetPyramid] $ \targetString -> do+ forM_+ [targetBase, targetPlus, targetA, targetE, targetS, targetO,+ targetNarrowStair, targetPyramid, targetWideStair] $+ \targetString -> do let target = Cuboid.coordsFromString targetString size = Cuboid.size target lsg = ESC.search $ initState size target
set-cover.cabal view
@@ -1,5 +1,5 @@ Name: set-cover-Version: 0.0.2+Version: 0.0.3 License: BSD3 License-File: LICENSE Author: Henning Thielemann, Helmut Podhaisky@@ -28,7 +28,7 @@ default: False Source-Repository this- Tag: 0.0.2+ Tag: 0.0.3 Type: darcs Location: http://code.haskell.org/~thielema/set-cover/