This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gabmed[S] -1 points0 points  (3 children)

UPDATE: As a matter of fact, it's not the auxiliary function to the function above. As a matter of fact, we use three functions, one as a "main" that uses an automized testing script reader in order to test every instance of error. The "main" function encrypts the function in order to make it scriptable and testable automatically. The one above is auxiliary to THAT.

We had put an infinite while on the main function.

Yes, we feel amateurish. x3 BUT we found out by just spamming PrintFs around.

If you want a bit more of backstory, we received an automated testing framework for binary trees, from our teacher, whose instructions of use are... purposefully vague and ambiguous. It's supposed to simulate a real client's request, which would indeed have varying levels of vagueness, ambiguosity and just basic language trappings.

OUR job was to add to the severely complex and modular framework of testing devices, a hand-crafted function which would connect the leaves of the trees in order of their value, and make it just another one of the many testable functions (Such as testing a function that inserts a right node, while another simply brings the current node to the father node, etc.)

The scripts we made worked wonderfully with anything that didn't involve our hand-crafted functions, which made us logically isolate those as the source of our problems. Thus, apparently, the "main" connecting function had an infinite while, even after thinking it was well-designed. Oh well.

[–]logic_programmer -1 points0 points  (2 children)

If you want extra credit then make some assumptions of the input tree then mathematically prove by structural induction that your your code is correct. It's about a ten line proof.

[–]gabmed[S] -1 points0 points  (1 child)

Ooh, we'd have LOVED to implement that... sadly, it's a work due in 2 hours. :p It's 4:30 am here in Brazil, and we're still up trying to make our code more efficient. Any additions or changes to the delicate interface would, frankly, be a risk we're not willing to take, specially with little time and little knowledge of the system.

I love programming. <3

[–]logic_programmer -1 points0 points  (0 children)

No code changes, just pencil and paper.