Because of the current trend of massification of higher education, motivation of students is a serious issue, especially in courses closely related to mathematics. The ones that undoubtedly belong to this group are courses dealing with formal methods for software development, such as Z notation, B-Method or VDM. The chapter shows how a customized simulation game can be used to bring a domain typical for utilization of formal methods, the railway domain, to students and thus motivate them to learn these sophisticated ways of software development. By means of two examples it demonstrates that such tool, despite of its limited scope, can be used to teach variety of concepts related to formal methods. It also discusses related approaches to teaching formal methods, describes the customized game and its application in teaching and evaluates experiences with the application.