Small test in SmallTalk 
Author Message
 Small test in SmallTalk

Hi !

   This is the final exam of the intro course in Smalltalk (CS course) at
university in canada.  You have one hour to read it and code it.

Billard game

    A player trains himself at billard.  There are only 2 balls: his , red
and the black one that he must send in one of the six pockets of the
table.  A pocket is twice the diameter of a ball.   The lenght of the
table is n * m. eg. in pixels or other..
The player can do rebounds by the sides.  For a shot, he chooses the
red ball's hitting force and its direction towards the center of the black

simplify it, we suppose that he doesn't put any effect in his shot meaning
that he hits the red ball in dead center.  Also, we suppose the red ball
keeps its speed before impact on the black ball.  After impact, the balls
slow down according to friction .  For example, a possible formula would
be V = V0 - F * t where F is the friction force and t is time but this is
not important in the solution's structure.  We will consider that the
balls will come  to a stop when their speed is little.  We could restrain
or not the problem by supposing that, after impact, there will not be
another impact with themselves.  This description doesn't specify all the
details, it's for you to judge and choose the other factors that aren't
specify.  For the display, do a simulation of a table.  For the
controller, either we could read the speed and the direction from a file
either read in a interactive window or use two click from the mouse to
give the direction and the strength of the shot.

Good luck, and remember one hour including the time you spent reading and
understanding ;-) .  


Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Anyone Interested in Beta testing a small app?

2. Like to test small REXX programs ?

3. Just a small test

4. Help, please, running a _small_ test to narrow down a bug

5. Small talk for OS/2 testing tool

6. How to Test Small Talk Code

7. test test test test

8. Is 3kb The Smallest Smalltalk EXE Application?

9. ST - A small Database Application in Smalltalk

10. Can Smalltalk get smaller?

11. free smalltalk with small executables??

12. WANTED: Small Smalltalk for teaching purposes


Powered by phpBB® Forum Software