Solution for designing the game in Java using OOP