International Competition in the Programming

ICP '2001

Problem of correspondence stage:
TV Game Box Simulator

Historical background: TV Game Box was an ancestor of PlayStation. It was a box connected to common TV and equipped with one or two joysticks. Most commonly played game was tennis for two players -- see Figure 1.

Figure 1: TV Game Box Example

Write a program which will simulate TV Game Box on a personal computer. The playing-field is composed from two adjacent squares -- one for each player. One player is simulated by the computer. Human player can control his bat by mouse or using the keyboard depending on his selection. Both ways can be used simultaneously. The bat can be moved in both vertical and horizontal direction. The program will not allow to place the bat outside of the playing-field.

Before the game starts it is possible to set width of the bat as a percentage of the playing-field side length. Points are counted according to the normal tennis rules. The score is continuously displayed. The program will evaluate wins and losses.

The program takes into account dynamics of strike, rotated balloons, air resistance and whatever else you think is appropriate.

In addition to a single player mode following game modes are supported: