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

Create random map #17

Open
Jonatan-Chaverri opened this issue Jun 16, 2024 · 0 comments
Open

Create random map #17

Jonatan-Chaverri opened this issue Jun 16, 2024 · 0 comments

Comments

@Jonatan-Chaverri
Copy link
Contributor

  • Create a function that generates a random map as a matrix.

  • The function should take the matrix dimensions as arguments and output an matrix (Array of Arrays).

  • Every cell in the matrix should be random generated. But the following rules apply

    • empty spaces should have at least one other empty space adjacent
    • There should only be one player
    • There should be one of each character and for each character one planet
    • Every empty/character/planet space should have at least one wall adjacent
    • You should decide randomly the cell content between possible values: empty, alien, alien2, ghost, dino, wall, alien_p, alien2_p, ghost_p, dino_p (if ends with _p means planet).

Add tests

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

No branches or pull requests

1 participant