Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • \$\begingroup\$ So, there were some bugs. :) First, unfortunately, the Integer[] cast doesn't work, it has to be an Object[] cast (which I don't like). So I wrapped it all into an ArrayList instead of an array. Secondly, this line: emptyPosition[emptyPosition.length]=j; will always give you array out of bounds. Finally, not sure why, but you will vote off players that aren't in the round. \$\endgroup\$ Commented Dec 2, 2015 at 13:59
  • \$\begingroup\$ Oh, also, your ternary block was returning a double instead of int, and was super convoluted, I turned it into a standard if/else. You can find all of my changes on Github: github.com/nathanmerrill/WeakestLink/blob/master/src/… \$\endgroup\$ Commented Dec 2, 2015 at 14:05
  • \$\begingroup\$ @NathanMerrill Wow, thanks a lot. For the emptyPosition[emptyPosition.length], it is a dumb mistake as length is always one over the last index ^^. Thanks for the changes, I will use this new version to correct it. About the ternary block... yeah, felt like using it, and maybe way too used to writing for myself, wasn't handy to read I guess. Doing the corrections and updating it. \$\endgroup\$ Commented Dec 2, 2015 at 14:11