- /* Rather than just picking states randomly, pick an ordering randomly,
- do it, and then re-randomize. That way one can be assured of seeing
- all states in a short time period, though not always in the same
- order (it's frustrating to see it pick the same state 5x in a row.)
- */
- static lament_type states[] = {
- LAMENT_STAR_OUT, LAMENT_STAR_OUT,
- LAMENT_TETRA_UNE, LAMENT_TETRA_USW,
- LAMENT_TETRA_DWN, LAMENT_TETRA_DSE,
- LAMENT_LID_OPEN, LAMENT_LID_OPEN, LAMENT_LID_OPEN,
- LAMENT_TASER_OUT, LAMENT_TASER_OUT,
- LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX,
- LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX, LAMENT_BOX,
- };
- static int state = countof(states);
-
- if (state < countof(states))
- {
- lc->type = states[state++];
- }
- else
- {
- int i;
- state = 0;
- for (i = 0; i < countof(states); i++)
- {
- int a = random() % countof(states);
- lament_type swap = states[a];
- states[a] = states[i];
- states[i] = swap;
- }
- }