-
Currently this package only provides the following solvers:
remotes::install_github("piecepackr/ppgamer")library("ppgamer")
library("ppn") # `remotes::install_github("piecepackr/ppn")`
pips <- matrix(c(2, 5, 1, 6, 6, 4, 3, 5,
0, 1, 3, 3, 0, 2, 6, 6,
0, 3, 4, 5, 0, 4, 3, 0,
0, 2, 6, 1, 3, 5, 4, 0,
3, 6, 5, 5, 4, 5, 4, 1,
1, 2, 4, 6, 0, 6, 2, 2,
4, 3, 2, 2, 1, 1, 1, 5
), nrow = 7, byrow = TRUE)
s <- solve_dominosa(pips = pips)
game <- read_ppn(textConnection(s$ppn))[[1]]
envir <- piecepackr::game_systems(round = TRUE)
plot_move(game, open_device = FALSE, annotate = FALSE, envir = envir, scale = 0.95)library("igraph")
library("piecepackr")
library("ppgamer")
library("ppn") # `remotes::install_github("piecepackr/ppn")`
puzzle2 <- matrix(c(4,4,4,5,2,0,2,4,0,3,1,1,
1,2,5,3,3,5,3,2,5,1,0,0), nrow=2, byrow=TRUE)
s2 <- solve_fujisan(coins=puzzle2)
game <- read_ppn(textConnection(s2$ppn))[[1]]
dark_colorscheme <- list(suit_color="darkred,black,darkgreen,darkblue,black",
invert_colors.suited=TRUE, border_color="black", border_lex=2)
piecepack_suits <- list(suit_text="\U0001f31e,\U0001f31c,\U0001f451,\u269c,\uaa5c", # 🌞,🌜,👑,⚜,꩜
suit_fontfamily="Noto Emoji,Noto Sans Symbols2,Noto Emoji,Noto Sans Symbols,Noto Sans Cham",
suit_cex="0.6,0.7,0.75,0.9,0.9")
traditional_ranks <- list(use_suit_as_ace=TRUE, rank_text=",a,2,3,4,5")
cfg3d <- list(width.pawn=0.75, height.pawn=0.75, depth.pawn=0.375,
dm_text.pawn="", shape.pawn="convex6", invert_colors.pawn=TRUE,
edge_color.coin="tan", edge_color.tile="tan")
cfg <- pp_cfg(c(piecepack_suits, dark_colorscheme, traditional_ranks, cfg3d))
animate_game(game, op_scale=1, op_angle=90, trans=op_transform, cfg=cfg, file="fujisan.gif")
