Go

Version 1.5.2 of piecepackr comes with built-in configurations for Go boards and stones in a variety of colors and sizes via the game_systems() function. Here is an example diagram for a game of Multi-player go:

library("ppdf")
library("piecepackr")

stopifnot(packageVersion("ppdf") >= "0.2.0-13",
          packageVersion("piecepackr") >= "1.15.0-9")

dfb <- go_board()
dfB <- go_bits(suit = "blue",
               x = c(2,2,2, 3,3, 4,4, 5,5, 6,6,6, 7,7, 8),
               y = c(11,13,14, 12,15, 13,16, 12,16, 12,13,16, 15,17, 16))
dfR <- go_bits(suit = "red",
               x = c(3,3, 4, 5, 6, 7, 8,8, 9),
               y = c(2:3, 4, 3, 4, 4, 2:3, 2))
dfY <- go_bits(suit = "yellow",
               x = 20 - c(3, 4, 5,5, 7, 8, 9,9,9),
               y = 20 - c(3, 2, 2:3, 2, 5, 2:4))
dfG <- go_bits(suit = "green",
               x = 20 - rep.int(3:6, times = c(5L, 4L, 3L, 2L)),
               y = c(4,5,7,12,13, 6,7, 10,11, 7,9,10, 8,9))
dfK <- go_bits(
    suit = "black",
    x = rep.int(2:17,
                times = c(5L, 5L, 4L, 5L, 2L, 4L, 7L, 5L, 5L, 4L, 5L, 6L, 2L, 6L, 6L, 2L)),
    y = c(2:3,8:9,12, 4:5,10,13:14, 5,10,14:15, 6,8,10:11,14, 5,11,
          5,7,12,14, 4,7,9,11:13,15, 3:4,11,14,16, 8:9,14:16,
          3,6,8,15, 9:11,16,18, 6,8:9,11:12,16, 6:7,
          5:6,8,11:12,16, 3,5,12,14,16:17, 3,16)
)
dfW <- go_bits(
    suit = "white",
    x = rep.int(3:14,
                times = c(1L, 1L, 1L, 3L, 3L, 2L, 5L, 3L, 4L, 4L, 2L, 1L)),
    y = c(9,9,9, 7:8,10, 8,10:11, 8,10, 8:10,12:13, 10:11,13,
          9,11,13:14, 7:8,12:13, 7,10, 11)
)
df <- rbind(dfb, dfB, dfR, dfY, dfG, dfK, dfW)

envir <- game_systems(shading = TRUE, background_color = "burlywood")
pmap_piece(df, envir = envir, default.units = "in")
2D Multi-player Go diagram

2D Multi-player Go diagram

Comments


There are no comments yet.

Add a Comment

You can use Markdown or restructuredText to format your comment.

links

social