how to make a rollbutton work with a rollcounter in a yahtzee game c# -


so have been working on yahtzee game , have gotten dice numbers , roll button working, want add rollcount label tells how many rolls player has left , after amount of rolls none disables roll button, code far roll button

    private void btnroll_click(object sender, eventargs e)     {         random random = new random();         int[] dice = new int[5];         globals.rollcounter += 1;          if (chk1.checked == false)         {             dice[0] = random.next(1, 7);             lbldie1.text = convert.tostring(dice[0]);         }         if (chk2.checked == false)         {             dice[1] = random.next(1, 7);             lbldie2.text = convert.tostring(dice[1]);         }         if (chk3.checked == false)         {             dice[2] = random.next(1, 7);             lbldie3.text = convert.tostring(dice[2]);         }         if (chk4.checked == false)         {             dice[3] = random.next(1, 7);             lbldie4.text = convert.tostring(dice[3]);         }         if (chk5.checked == false)         {             dice[4] = random.next(1, 7);             lbldie5.text = convert.tostring(dice[4]);         }     }      private void btnexit_click(object sender, eventargs e)     {         this.close();     }      private void lblrollcount_click(object sender, eventargs e)     {      } } 

} lblrollcount label supposed put code none of codes workenter image description here

this picture how it's supposed after 1 click on roll button, goes in order , when no rolls left roll button should disable , can tell me how arrange numbers in numerical order


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -