http://qs321.pair.com?node_id=1148888


in reply to Re: Tree Structure Challenge
in thread Tree Structure Challenge

If you can just write the diff method, you don't need to write anything else.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: Tree Structure Challenge (test)
by tye (Sage) on Nov 30, 2015 at 18:28 UTC

    Unless you want to test your code rather than just post code that you've never actually run.

    - tye        

Re^3: Tree Structure Challenge
by GotToBTru (Prior) on Nov 30, 2015 at 17:32 UTC

    If diff needs to be based on Parent and get_leaves, I don't see how we can get around not writing those. So, we need to write the whole module.

    What is the assumed output of the constructor?

    Dum Spiro Spero
      There's no output. It just returns an object of the Zoo class that you can run get_leaves on, or use it as a parameter to diff.
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        What does it do with the parameter? In other words, what would the returned object look like with differing values of input to the constructor?

        Dum Spiro Spero