Skip to main content
1 of 2

Rebol

With a dialect to display the symbols.

tree: [ 3 space 1 asterisk 3 space lf 
       2 space 3 asterisk 2 space lf
       1 space 2 asterisk 1 star 1 asterisk lf
       1 star 1 asterisk 1 star 3 asterisk lf
       2 space 3 asterisk 2 space lf
       1 space 2 asterisk 1 star 1 asterisk 1 space lf
       7 asterisk lf
       3 space 1 bar 3 space lf ]
result: copy []
rule: [ some [ set i integer! 'space ( append/dup result space i ) |
           set i integer! 'asterisk ( append/dup result "*" i ) |
           set i integer! 'star ( append/dup result "☆" i ) |
           set i integer! 'bar ( append/dup result "||" i) |
           'lf ( append result lf ) | skip
   ]
]
parse tree rule
print result

enter image description here