An assignment is due tomorrow for my theoretical computer science class.
I have stayed up all night to work on it.
Rather than doing productive work I am spending my time writing a program in pic to format pretty trees.
Name:
Anonymous2012-11-02 9:47
Now I have something sort of tree-shaped, but I realised I have a problem -- I need to label my nodes, and I have no idea how to do that with the current design.
The language doesn't seem to support anything like lists or arrays, so I'm not sure how to do it with my top-down recursive method.
Earlier I tried the subtree(subtree(a,b), subtree(c,d)) approach, but since the language uses string substitution that became escaping hell once it got more than a level deep.
It would be far easier to just write a program in some other language that takes a tree as input and spits out the pic code to draw it.
LISP seems like it would be ideal, but I've never written a LISP program more complex than calculating the Fibonacci sequence. AWK would be good too, but I'd have to implement array-based trees. It's sort of looking like I'll do it in C!