I'm programming a Yahtzee type game, but I have a problem checking for the different scoring types. So far I have everything but Full House, Small Straight and Large straight. It works like this: There are 5 variables (the dice) that are randomized to something between 1 and 6 every roll. I need to figure out a way to check if 1) Two of the variables are the same and three of the variables are also the same but a different number (Full House). Then I need to check if there are 4 variables in sequence (1,2,3,4 for example)(small Straight). Finally I need to check if all 5 are in sequence (large straight). How would I do this? Each of those have their own procedure, I just need to know what to put in there because after struggling a bit I can't seem to figure it out.
Thanks for any help.

5 Years
Discussion Span
Last Post by Fireprufe15

For the straight, I got this code, but it doesn't work. Can somebody tell me what's wrong?

counter, min, look, K : integer;
temp, iSequence : integer;

  for counter:=1 to Top do begin
    for look:=counter+1 to top do
      if aDiceScores[look]<aDiceScores[min] then min:=look;
    temp:= aDiceScores[min];

 iSequence := 0;
 for K := 1 to 5 do
    if aDiceScores[K] + 1 = aDiceScores[K + 1]
    then inc(iSequence);

  if iSequence = 5 then
  iScoreLarge := 40;

Edited by Fireprufe15: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.