Code for Snooker Game