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

Generating 'dungeon' patterns #22

Open
trevorld opened this issue May 4, 2022 · 0 comments
Open

Generating 'dungeon' patterns #22

trevorld opened this issue May 4, 2022 · 0 comments
Labels
upgrade 🆙 New feature or request

Comments

@trevorld
Copy link
Contributor

trevorld commented May 4, 2022

  • One possible unusual future use-case for {r.oguelike}---if/when it reaches CRAN---could be generating "dungeon" patterns for use with {gridpattern} / {ggpattern}: 'dungeon' pattern? trevorld/gridpattern#55
  • Easiest on the {gridpattern} end if we had a function that generates a matrix of integers.
  • Currently not that hard to wrap the current generate_dungeon() for this:
n_row <- 20
n_col <- 30
invisible(capture.output({
    m <- r.oguelike::generate_dungeon(n_row=n_row+2, n_col=n_col+2, seed = 42)
}))
m <- m[2:(n_row+1), ]
m <- m[, 2:(n_col+1)]
m <- matrix(as.integer(factor(m, levels = c("#", "."))),
            nrow = n_row, ncol = n_col)
@matt-dray matt-dray added the upgrade 🆙 New feature or request label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade 🆙 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants