Timeline for Utopian tree life cycles
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2014 at 15:01 | comment | added | Malachi |
we removed an unnecessary if statement and removed a mod check by replacing it with a boolean taking it from a high level math function to a simple bit switch. Also we removed an extra Convert.ToInt . we probably also made it possible with the 3 methods to run most of the arrays almost simultaneously, it's well planned.
|
|
Sep 25, 2014 at 14:49 | comment | added | Ben Aaronson | @Malachi How strange, I don't know where such a big performance boost would come from. | |
Sep 25, 2014 at 14:24 | comment | added | Malachi | I don't know if it is appropriate to submit code that has been reviewed, but I understand the code and learned from this answer. the time dropped to 0.01s on all but one of the tests. | |
Sep 25, 2014 at 13:57 | vote | accept | Malachi | ||
Sep 24, 2014 at 22:04 | comment | added | Malachi |
might be better as a bit or something like that... it's easier to make it a boolean than another type though. I agree with you though.
|
|
Sep 24, 2014 at 21:59 | comment | added | Ben Aaronson |
@Malachi Yeah, I'm not entirely happy with season , and your suggestion may be a good alternative. The reason I picked season is that it implied to me that what you're storing is the season, and the fact that it's bool represents that it can only have two values. For isMonsoon , you have to go to how it's used to get the idea that monsoon is one of only two possible values for the season, which are on an equal footing. But I appreciate that it's also perhaps a more straightforward wording of what the variable actually represents
|
|
Sep 24, 2014 at 21:51 | comment | added | Malachi |
I was also thinking about changing the boolean season to isMonsoon or isSummer
|
|
Sep 24, 2014 at 21:37 | comment | added | Magus |
Very good answer. The only thing I'd change is to make the select Select(CalculateGrowth) , since CalculateGrowth already matches the delegate. Some people don't seem to like doing that, though.
|
|
Sep 24, 2014 at 20:58 | history | edited | Ben Aaronson | CC BY-SA 3.0 |
added 724 characters in body
|
Sep 24, 2014 at 20:57 | comment | added | Malachi | Good Answer. thank you for taking the time to answer. | |
Sep 24, 2014 at 20:50 | history | answered | Ben Aaronson | CC BY-SA 3.0 |