Grasshopper

algorithmic modeling for Rhino

Dear David/fellow bit smithers!

I'm trying to implement recursion in a CS component but can't make it work. The errors on the output window make reference to lines I don't have access to.

Something else that happens is that if I move a slider the errors get cleared and even if I open and close the editor again, the errors disappear until I unload GH, load it again and open my file is this normal behaviour or is it something broken?

I really appreciate any help on the attached!

Cheers

Evert

PS forget the maths, they are still wrong!

 

 

Views: 269

Attachments:

Replies to This Discussion

Hi Evert,

I think the closed brace in line 162 should not be there.

Deleting it, GH finds a couple of regular syntax errors,

that I believe you can quickly fix.

HTH, cheers

Emilio

 

Hi Emilio,

Thanks for replying, silly me!! 

I'm now going for a different approach and would like some advise about the way to go, as I'm looking for a recursive method that outputs 2 to the power of n (iterations), is it better to implement a class, struc or an array to return all those values?

 

I'm just making my way through learning and I'd appreciate any suggestions for people with more experience on this!

Many thanks in advance

 

Evert

 

Hmmm ... not sure I understand.

( also ... my experience is very limited, sorry )

Are you going to build a list of powers of 2 ?

For that a for loop should be enough.

You might put those values into a List that can

be returned by the script. GH is very good at using List's.

Emilio

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service