Created
January 2, 2015 12:39
Revisions
-
semanticer created this gist
Jan 2, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ -- creates tree in list structure tree bc gf fbs = [block rows (treeMaxSp bc gf fbs) | rows <- take bc [fbs,(fbs+gf)..]] -- counts maximal number of spaces for given tree treeMaxSp bc gf fbs = ((bc-1)*gf)+(fbs-1) -- creates one block with specified number of rows and maximal space block rowCount maxSp = [row st sp | (st,sp) <- take rowCount (zip [1,3..] [maxSp,maxSp-1..0])] -- creates one row with specified number of stars and spaces row st sp = take sp (repeat ' ') ++ take st (repeat '*')