Fork me on GitHub

Reversi

Reversi-friendly piecepack design

In the game of Reversi one player is represented by the suited side of piecepack components while the other player is represented by the unsuited side of piecepack components. A reversi-friendly piecepack design makes it easier to distinguish between the suited and unsuited sides of piecepack components. One simple option would be to design a piecepack where the background of the suited sides are black and those of the unsuited sides are white.

library("piecepackr")
reversi1 <- as.list(game_systems("dejavu")$piecepack)
reversi1$background_color.suited <- "grey20"
reversi1$suit_color <- "#D55E00,white,gold,#56b4e9"
reversi1$edge_color.coin <- reversi1$edge_color.tile <- "#E69F00"

dejavu_credit <- c("\u25cf This piecepack uses characters from the font Dejavu Sans.",
                    "\thttps://dejavu-fonts.github.io/",
                    "\thttps://dejavu-fonts.github.io/License.html")
reversi1$credit <- dejavu_credit
reversi1$title <- "Reversi-friendly piecepack"

reversi1 <- pp_cfg(reversi1)
grid.piece("preview_layout", cfg=reversi1)
A preview of a reversi-friendly piecepack

A preview of a reversi-friendly piecepack

Playing reversi with a piecepack stackpack

A single piecepack (24 coins) lacks enough pieces to play the full 8x8 version of Reversi but a piecepack stackpack has enough pieces (24 supercoins plus 24 subtiles plus 24 subcoins).

library("dplyr", warn.conflicts=FALSE)
library("ppgames", warn.conflicts=FALSE)
library("tibble")

envir <- list(piecepack=reversi1, subpack=to_subpack(reversi1))

df_pt <- df_rect_board_tiles(nrow=8, ncol=8)
df_pt$cfg <- "piecepack"
df_btf <- tibble(piece_side="tile_face", cfg="subpack",
                x=c(1,4,5,7,8,3,8,2,4,7,8,6,8),
                y=c(8,8,8,8,8,7,7,5,5,4,3,2,2),
                suit=c(1,3,3,4,4,2,2,2,3,4,1,1,4),
                rank=c(4,3,2,5,6,2,3,4,5,2,5,3,1))
df_btb <- tibble(piece_side="tile_back", cfg="subpack",
                 x=c(5,6,2,7,1,3,6,2,4,3,5),
                 y=c(7,7,6,6,5,4,4,3,2,1,1))
df_pcb <- tibble(piece_side="coin_back", cfg="piecepack",
                x=c(2,3,6,2,4,8,2,5,8,7,5,7),
                y=c(8,8,8,7,6,6,4,4,4,3,2,2),
                suit=rep(1:4, 3))
df_pcf <- tibble(piece_side="coin_face", cfg="piecepack",
                 x=c(1,4,5,6,3,7, 1,1,4,5,2,6),
                 y=c(7,7,6,6,5,5, 4,3,3,3,2,1),
                 rank=c(6:1,1:6))
df_bcb <- tibble(piece_side="coin_back", cfg="subpack",
                x=c(3,5,8,6), y=c(6,5,5,3), suit=4:1)
df_bcf <- tibble(piece_side="coin_face", cfg="subpack",
                 x=c(7,1,6,4,3,1,3,1,2,4,7,8),
                 y=c(7,6,5,4,3,2,2,rep(1,5)), rank=c(6:1, 1:6))
df <- bind_rows(df_pt, df_btf, df_btb, df_pcb, df_bcb, df_pcf, df_bcf)
pmap_piece(df, envir=envir, default.units="in", trans=op_transform, op_scale=0.5)
End diagram for a game of Reversi

End diagram for a game of Reversi

Comments


There are no comments yet.

Add a Comment

You can use Markdown or restructuredText to format your comment.

links

social