Code:
D 2 G 8 C
2
F 8
H
4
E
10
A B
Actually quite "easy" to draw the paths; above is a 10 by 22 table ABCD; cue ball shot from A:
1: hits BC at E (10 above B)
2: hits AD at F (2 below D)
3: hits CD at G (2 from D)
4: hits BC at H (8 from C)
And you're basically finished: you have 4 lines (AE, EF, FG, GH):
ALL other paths will form lines parallel to these lines; continuing:
from H simply draw a line to side AD parallel to line FG.
And carry on similarly until a path line hits one of corners.
In this example, corner C will be hit after 14 bounces off the sides.
If you really want to have fun, get a sheet of graph paper and draw
a table 27 by 34 (easy enough using the little squares as units).
Go as I explained above: this time you'll hit corner D, after 59 bounces!
Haven't tried for a general case formula (probably won't either!), but
obviously has something to do with LCM(long side, short side).