static uint8_t Has_Straight(uint8_t *roll_results, uint8_t dice) static uint8_t Has_Three_Pair(uint8_t *num_counts, uint8_t dice) void Roll_Dice(void) void AI_Make_Selection() void AI_Do_Roll() uint32_t AI_Do_Turn(uint32_t p_num) void Gen_Num_Counts(void) uint32_t Gen_Num_Scores(void) uint8_t Gen_Kept_Dice(void) uint32_t Score_Of_Selected(void) uint32_t AI_Dice_Selections(void) uint32_t Score_Of_Selection(void) uint8_t Valid_Dice_Selection(uint8_t index) uint8_t Player_Can_Roll(void) void Player_End_Turn(void) void Next_Player(void); LOCAL_PLAYER roll dice signal Player_Can_Roll() TRUE //score+=score_of_selected() Roll_Dice() // TURN_OVER //set gs/pd values //Next_Player() FALSE Player_End_Turn() //do nothing //bust, have nothing //set gs/pd values Next_Player() INVALID_DICE_SELECTION //print invalid message Reset_Dice_Selection() redraw dice and update display end turn signal Player_End_Turn() COMPUTER_PLAYER while(Player_Can_Roll() == TRUE){ Roll_Dice() Gen_Num_Counts() Gen_Num_Scores() Gen_Kept_Dice() AI_Dice_Selections() //Score_Of_Selection() if(!simulation) sleep update display } //update display? set gs/pd values Player_End_Turn() Next_Player() //Valid_Dice_Selection() // is valid if first roll Roll_Dice() do zilch check set gs/pd values redisplay force turn over ? Next_Player() end turn signal //can't end turn on first roll //can't end turn if not onboard and not enough points Player_End_Turn() Valid_Dice_Selection() add to score set gs/pd values redisplay launch computer player's turn if needed Next_Player() COMPUTER_PLAYER while(Player_Can_Roll()){ Roll_Dice() Gen_Num_Counts() Gen_Num_Scores() Gen_Kept_Dice() AI_Dice_Selections() Score_Of_Selection() } launch another computer player's turn if needed Next_Player()