Assignment #10


This assignment will have you play with L-systems a little bit. What you have to do is write a function that will advance a deterministic 0L-system one generation. That is, you must write a function that takes a string and the production rules and replaces every character by the character that it should become (or leaves it the same if there was no specific production given). The set of productions should probably be passed in as a hash that has the character that you are changing as the key and what it will become as the data. Simply run through the string and for each character look it up in the hash and replace it with what it should become.

If you want to explore further with this assignment you could allow for 1L and 2L-systems (those are context sensitive where it checks for characters on one side or both sides). You could also do non-deterministic systems where there are multiple possible productions for a given character and you specify what the probability of each is.