I'm making a Yahtzee game and I need a way to calculate a small straight (a sequence of 4 numbers in order). So valid ones would be: 1,2,3,4 | 2,3,4,5 | 3,4,5,6.
I have an array of 5 numbers and I need to figure out if one of those 3 combinations is in that array.
For those not familiar with Yahtzee, there are 5 dice (the five numbers in the array) that can be from 1-6.