java yahtzee game check for full house -


I am making Java game and I was just wondering if the following code would generate false positives in any case < Death is an array in which there are pseudo-random (Math. random ()) numbers for each die and I sorted them using a bubble sort: if it is randomly dead where {1, 2,1,2,1} before they were examined by the following code {1,1,1,2,2} The Rules will be made inside a method that returns the boolean value.

  int count = 0; If [die [0] == die [1] and dies [1] == die [2] = die [0] == die [1] and die [2]! = Die [1]) {count ++; } If (die [3] == die [4]) {count ++; } If (calculation> 1) {back true; } return false;    

If you want to see the correctness of your code, then I recommend the unit test I am (with Junich). Try to investigate as many cases as possible, using parameterized tests can help:

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -