Even though pseudo-code seems closer to code than an algorithm, in practice, pseudo code is less formal and it is a more high level description. For instance you can describe a chess playing computer as a pseudo code like this:
- place initial pieces in their locations
- show board
- while game is not over
- make move and display board
- prompt user for move
- make users move
Yes, this is pseudocode, it is helpful as a good starting point but glosses over lots of details. It does not account for implementation difficulties and variations, but the biggest benefit is that it allows you to conceptualize the whole situation without having to solve all the details.
You can revise it, adding one more level like so:
- place initial pieces in their locations
- show board
- while board is not checkmate or draw
- make a list of white's legal moves
- choose the best according to some criteria
- make that move and compute resulting board
- see if checkmate or draw has occurred
- display board
- make a list of black's legal moves
- prompt user for legal move for input
- make that move and compute resulting board
- see if checkmate or draw has occurred
- display board
Now you can write pseudocode for each of the major steps like "make a list of black's legal moves", like so:
- for each black piece
- for piece type in a given location
- make a list of next possible locations
Now you can see the power of pseudocode is really in its ability to show the whole situation in one go and then allowing you to address details piece by piece.
The weakness is that any step is not a definite simple step.
An algorithm typically picks up one of these steps and details out various data structures in a symbolic language so that you can efficiently meet the goal of the step.
For example, get_legal_moves(board, color)
is worthy of an algorithm design:
get_legal_moves(board, color):
for i,j in board_dimensions
if piece_at i,j is of color
if piece type is KNIGHT
add the following to the next moves list:
location i+1 j+2, i-1 j+2... etc
if piece type is rook
add locations:....
You can see that the algorithm has to be very precise to be useful.
It ensures several things: that the goals will be met without errors, first and foremost. The steps are very detailed and executable in a mechanized way and that
the steps are small enough that you can reorder them to increase the efficiency
(speed) with which you finish the task.