This week was mainly focused on A2 and the working of regexs. This week was mainly focused on A2b as A2a was done immediately upon return from reading week. A2b focused more on the actual running of code whereas A2a served as a template for the rules of the various trees such as bartree and startree.
My group and I encountered problems straight away when starting the assignment. We wondered just how exactly we were going to go about writing these functions. The first one was is_regex that determined whether we were working with a regex or an invalid one. We initially hard-coded the entire function which took around 200 lines. This was very inefficient and had some problems while running. We later discovered that this can we written recursively and can be done in less than 50 lines of code without errors occurring. We then began thinking and approaching the problems in a more recursive manner and tried to incorporate recursion in all of the functions. Permutations of the regex was quite hard to do but we were eventually able to do it with recursion.
No comments:
Post a Comment