Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Align-columns/PicoLisp/align-columns.l
Normal file
21
Task/Align-columns/PicoLisp/align-columns.l
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(let Sizes NIL # Build a list of sizes
|
||||
(let Lines # and of lines
|
||||
(make
|
||||
(in "input.txt" # Reading input file
|
||||
(while (split (line) "$") # delimited by '$'
|
||||
(let (L (link (mapcar pack @)) S Sizes)
|
||||
(setq Sizes # Maintain sizes
|
||||
(make
|
||||
(while (or L S)
|
||||
(link
|
||||
(max
|
||||
(inc (length (pop 'L)))
|
||||
(pop 'S) ) ) ) ) ) ) ) ) )
|
||||
(for L Lines # Print lines
|
||||
(prinl (apply align L (mapcar - Sizes))) ) # left aligned
|
||||
(prinl)
|
||||
(for L Lines
|
||||
(prinl (apply align L Sizes)) ) # right aligned
|
||||
(prinl)
|
||||
(for L Lines
|
||||
(prinl (apply center L Sizes)) ) ) ) # and centered
|
||||
Loading…
Add table
Add a link
Reference in a new issue