Cognizant interview question

Write a code that plays a snake and ladders game