I am doing scheduling system and it will produce a random timetable, due to random method it will cause some of the exam can't add to the timetable and it will result stack over flow error..... but sometime it will able to produce a complete timetable.
So I want to ask here how can i do like this:
if result == stack over flow error {
redo the function
}