Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A friendly snake & ladder game #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vagishyagnik
Copy link

Hi 👋, I'm Vagish Yagnik

This PR adds a simple Snake & Ladder game
Using this, students can learn about a few design patterns commonly used in Java Development.

This Game consists of

  • Player class : Stores player id, name, current position.
  • Ladder class : Stores start & end position of the ladder & verifies that no 2 ladders starts at same position & other basic checks.
  • Snake class : Stores face & tail position of the snake & verifies that no 2 snakes have same face position.
  • Game class: Is a Monitor class which stores state of the game at any point in time. See the builder pattern here.
  • PlaySnakeNLadder - Main class that populates Game class with players, ladders & snakes.

Kindly merge it under hacktoberfest-accepted label.

Sample Output -

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant