phetsims / mean-share-and-balance

"Mean: Share and Balance" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 1 forks source link

Hard coded cups in distributeWaterRipple #301

Closed jessegreenberg closed 2 weeks ago

jessegreenberg commented 2 weeks ago

This function may break if the number of cups ever changes, is there a way to not hard code 7?

For #270.

jessegreenberg commented 2 weeks ago

Also, I made a small change to remove the disable lint rule directive, its slightly more complicated. Feel free to revert if you disagree with that choice.

marlitas commented 2 weeks ago

Oh great catch! We definitely shouldn't hard code that. I went ahead and updated to look at the length of the array that was passed in. I'm fine with moving the callback definition outside of the loop. Looks good. This was really straightforward so I'm going to go ahead and just close :-)