Commit 55a9e96c authored by Reg Huijben's avatar Reg Huijben

Tile drawing in ascii

parent 66b52003
module lcsm
//import StdEnv
import iTasks
import Text
/*import iTasks.Engine
import iTasks.UI.Definition
import iTasks.UI.Editor
import iTasks.UI.Tune
import iTasks.WF.Tasks.Interaction
/*import iTasks.Engine
import StdFunctions, StdList
import Text
*/
import iTasks.Extensions.SVG.SVGEditor
*/
:: Connection = NS| EW| NE| SE| SW| NW
derive class iTask Connection
//Track =
//Start = mergedieshit WN WE
//Start w = doTasks (myTask [(merge2D WN WE), WE]) w
Start w = doTasks (myTask (toLines [(merge2D WN WE), WE]) ) w
//toLines :: [[String]] -> String
//toLines [t:ts]
//gh l =
mergeTileLine :: [[[String]]] -> [[String]]
mergeTileLine [] = [[],[],[]]
toLines :: [[[String]]] -> [[String]]
toLines [tile:tiles] = [tileToLines tile : toLines tiles]
toLines [] = []
tileToLines :: [[String]] -> [String]
tileToLines [row:tile] = [concat row : tileToLines tile]
tileToLines [] = []
myTask :: [[String]] -> Task [[String]]
myTask a = viewInformation [] a
//hetDing = [
// ["/","|","\\"],
// ["―",".","―"],
// ["\\","|","/"]
// ]
merge2D :: [[String]] [[String]] -> [[String]]
merge2D [x:xs] [y:ys] = [merge x y : merge2D xs ys]
merge2D [] [] = []
merge :: [String] [String] -> [String]
merge [x:xs] [y:ys]
| (x == " ") = [y : merge xs ys]
| otherwise = [x : merge xs ys]
merge [] [] = []
hetDing = [
[" "," "," "],
[" "," "," "],
[" "," "," "]
]
WN = [
["/"," "," "],
[" "," "," "],
[" "," "," "]
]
WE = [
[" "," "," "],
["―","―","―"],
[" "," "," "]
]
//ff :: [
//Start w = doTasks (myTask) w
//myTask :: Task [[[Connection]]]
//myTask = updateInformation [] []
//myTask :: m -> Task (Image m)
//myTask = viewInformation [] [["a","b"],["c","d"]]
//myTask = henk [] NoHost
s = ["Henk","Honk"]
Start w = doTasks (myTask s) w
//henk = grid (Columns 4) (RowMajor, LeftToRight, TopToBottom) [] [] [] []
myTask :: [String] -> Task [String]
myTask s = viewInformation [] s
\ No newline at end of file
//c = circle (px 15.0 + px 8.0 *. 1) <@< {fill = toSVGColor {r=255,g=0,b=0}}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment