Vague Pseudocode examples

These are examples of pseudocde which are written too vaguely.


#1

Assumptions:  Deck is an abstraction of queue that can be shuffled, and player's hand is an abstraction of List.

Create the scenario by picking 3 random cards from the deck.

Remove those three cards from the deck.

Randomly distribute the remaining cards from the deck to each player.


#2

State your assumpions about data structures.

IF evidence is relevant to the hypothesis presented THEN

    RETURN TRUE

END IF


#3

IF the player is disconnected THEN

The computer determines the refutation

ELSE

Send suggestion to player

END IF


#4

Increment turn order number.

Determine which player in the players array the incremented turn order number corresponds to.




On the other hand, here is an example that is too specific.

FOR i = 1 to 24 LOOP
Add Rainfall[i] to Total
END LOOP

It would be better to express the loop as "FOR each hour of the day LOOP"