Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Advanced Programming
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Job Cuppen
Advanced Programming
Commits
55a9e96c
Commit
55a9e96c
authored
Oct 25, 2019
by
Reg Huijben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tile drawing in ascii
parent
66b52003
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
5 deletions
+100
-5
lcsm/lcsm.icl
lcsm/lcsm.icl
+100
-5
No files found.
lcsm/lcsm.icl
View file @
55a9e96c
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment