java - Yahztee Full House -


I am trying to create a simple strategy program and checking whether there is a complete home or not.

The counting array shown is an array of values ​​of dice [1] = 3 means that 1 value has a 3pair. Counting [3] = 2 means that there is a 2-pie of 3 originals to die.

  / ** * If the category is not yet taken, then the scorer space ensures * that there are two types and three * of others If this happens, then it puts the score of 25 * in the HOUSE category, taken as a category, * and adds 25 to the total score. * * @ Absolute count is the counting range of all dice values ​​* / private zeros scoring number (integer [] count) {if (! (!! (Category! HOUSE.ordinal (taken!) // checks that the home class is taken {Ii = 1; i & lt; 7; ++ i} {if (count [i] = 2] count [i] = 3) {if (count [i + 1] = 3) {Scores [Category.HOUSE.ordinal ()] = HOUSE_VALUE; // HOUSE_VALUE (25) Created score [Category.HOUSE.ordinal ()] = true; // Total = Total + HOUSE_VALUE sets the range to take; // adds total break;}}}}   

I know this is not correct, l What I am trying to do for this is its original spine, what I can not understand is how to see how a 2pair and 3pair are present at the same time, how to see the array. if (count [i] = 2] is counted [i] = 3) a full house is a dice of 2

{if ([i + 1] = 3 & Amp; amp; count [i]! = 3; Count [i + 1] = 2 & amp; [i]! = 2) { <;

  

< Div class = "post-text" itemprop = "text">

There are several ways to do this.

  int six = 6; Int value [] = new int [six + 1]; // Waste a byte so that it can be indexed for the correct (int i = 0; i & lt; dice.length; i ++) {value [dice [i]] ++; // keep it counts // are now ... boolean hatathi = false; Boolean hatavo = wrong; For (int i = 1; i & lt; = six; i ++) {if (value [i] == 3) {hashathree = true; } If (value [i] == 2) {hashatwo = true; }} If (Hatithi & Hatvo) {// Full Home}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -