How to write program that find winner who choose the smallest number. UNIX process?

In the game of �Unique�, multiple players privately choose an integer. They then reveal
their choice. The winner is the player who chose the smallest unique number. The
game is considered a draw if no unique integer was chosen.
You would write a program that simulate such a game according to the followings

  1. The parent process fork player (child) processes (up to maximum of 10
    players). It then waits for each of the child processes to return an integer.
  2. The players (child processes) will randomly pick an integer between 1 to 5, and
    return the choices to the parent.
  3. Parent process determines the winner based on the choice returned by the
    players (child processes). Parent process then print out the winner�s PID and
    inform all child processes to terminate, before it terminates. If it is a draw, parent
    process shall inform all the child processes (players) to choose another integer.
  4. Repeat steps 2 and 3 as many times as required until a winner can be
    determined.

Example of output:

$ ./game 5
Game starts with 5 players
Player 3312 choose 4
Player 3314 choose 3
Player 3313 choose 2
Player 3315 choose 1
Player 3316 choose 5
Player 3315 win!

Please help me, to write a code because I am totally new in shell programming

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.