We want to make a slide show for an exhibition on the theme of the sea and sailboats. For this, there are more than a thousand pictures, these pictures are mostly in "landscape" but some are also in "portrait".

The pictures are jpg files which are located in a directory on the Internet at the following address:


These files have a name composed as follows:

img[number of the picture].jpg

For example: img6.jpg or img1047.jpg

The total number of pictures is not known precisely but the sequence numbering have no "hole".

They all have a height of at least 600 pixels.

  1. Make a web page displaying a picture centered with: "Pictures of sea and sailing" as title. The background will be black.

  2. Make a slide show displaying a succession of pictures: each picture is displayed 6 seconds and then reload a page with another picture.

  3. Make the same show with a randomized choice of one of the pictures among all pictures of the directory. All pictures must be choosen with the same probability (each reload gives exactly the same chance to any picture and we accept that a picture can be choosen twice).

    The difficulty is that you do not know exactly the total number of pictures. If you call a picture that does not exist, for instance img999999.jpg, your slideshow will show nothing. So we must avoid this but we want that all existing pictures can be exposed.

  4. The exhibition is a success and your slideshow works very well. During the days of the exhibition other pictures will be added to the directory with the same rule (giving filenames with successive numbers).

    The total number of pictures will grow - in a number witch wil not exceed one hundred pictures per hour.

    You must therefore ensure that your show can "recover" these new photos.

Attention ! - The use of these pictures for any other purpose, and particularly their marketing is strictly prohibited!