Looney Pyramids aka Icehouse pieces is a game system invented by Andrew Looney. The following are good sites of information about Looney Pyramids:
- https://www.looneylabs.com/looney-pyramids (official site)
- https://www.icehousegames.org/wiki/index.php?title=Main_Page (unofficial wiki)
This R package provides a looney_pyramid_game_system()
configuration that make it
easier to make Looney Pyramids graphics with piecepackr.
- The code of this R package is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. This license is compatible with version 3 of the GNU Public License (GPL-3).
- Under American law I likely cannot claim any copyright on any Looney Pyramid graphical output (e.g. game diagrams and animations) a user creates with this package. Furthermore, I relinquish any copyright claims to such graphical output in any jurisdiction (if any exist) that does grants me any such rights.
- Looney Pyramids are trademarked and patented by Looney
Labs. They do not permit commercial
use of Looney Pyramids without permission. They seem cool with
- Creating new Looney Pyramids games. But don’t try to independly publish such a game while including Looney Pyramids in your product nor creating commercial electronic versions of Looney Pyramids games.
- Making Icehouse pieces for personal use (note they definitely would mind if someone commercially manufactured icehouse pieces without permission)
- (Non-commercial) fan art and game playing aids
Within R do:
install.packages("remotes")
remotes::install_github("piecepackr/piecepackr")
remotes::install_github("piecepackr/ppgames") # suggested
remotes::install_github("piecepackr/piecenikr")
This package contains a looney_pyramid_game_system()
configuration for use with {piecepackr}. By default it includes a black border for use with {grid}
graphics.
library("piecepackr")
library("piecenikr")
library("ppdf")
library("tibble")
envir <- c(looney_pyramid_game_system(), game_systems())
dfb <- checker_board(side="back", nrows=3L, ncols=3L, suit = 2L, cell_width = 2)
df1 <- icehouse_pyramids(side = "face",
x=2*c(1,2,2,1),
y=2*c(2,2,1,1),
suit=1:4,
rank=c(1:3,3),
angle=seq(90, 360, 90))
df2 <- icehouse_pyramids(side = "top",
x=2*c(1,2,3,3,3,3,3,3,3),
y=2*c(3,3,3,2,1,1,2,2,2),
suit=c(1:6,1:3),
rank=c(1:3,3,3,1,2,1,1))
df <- rbind(dfb, df1, df2)
pmap_piece(df, grid.piece, envir = envir, default.units = "in")
grid::grid.newpage()
pmap_piece(df, grid.piece, envir = envir, default.units = "in",
op_scale = 0.25, op_angle = 90, trans=op_transform)
But you may want to use looney_pyramid_game_system(border = FALSE)
when making graphics with the {rgl}
, {rayrender}
, or {rayvertex}
packages:
library("piecepackr")
library("piecenikr")
library("ppdf")
library("rgl")
library("tibble")
envir <- c(looney_pyramid_game_system(border = FALSE),
game_systems(border = FALSE))
dfb <- checker_board(nrows = 3L, ncols = 3L, suit = 6L, cell_width = 2) |> transform(x = 0, y = 0)
dfp1 <- icehouse_pyramids(side = "top", x = 0, y = 0, rank = 3L, suit = 5L)
dfp2 <- icehouse_pyramids(side = "face",
x = rep(c(-2, 0, 2), 3),
y = rep(c(2, 0, -2), each = 3),
angle = c(45, 0, -45, 90, 0, -90, 135, 180, -135),
suit = rep(1:6, length.out = 9L),
rank = rep(1:3, length.out = 9L))[-5L, ]
df <- dplyr::bind_rows(dfb, dfp1, dfp2)
invisible(open3d())
view3d(phi = -30, zoom = 0.8)
if (nzchar(Sys.which("wmctrl"))) system("wmctrl -r RGL -e 0,-1,-1,600,600")
pmap_piece(df, piece3d, envir = envir, trans = op_transform, scale = 0.99, lit = TRUE)
Sys.sleep(2)
rgl.snapshot("man/figures/rgl_looney_pyramids.png")
There are also functions which perform board set ups for games that use Looney Pyramids:
icehouse_martian_chess()
sets up Martian Chess, an abstract by Andrew Looney.ppdf::piecepack_alien_city()
sets up Alien City, an abstract by Michael Schoessow.
Here is an example of using icehouse_martian_chess()
and the PPN parser ppn::read_ppn()
in order to animate a game of Martian Chess.
library("piecenikr")
library("ppn")
ppn_file <- system.file("ppn/martian-chess.ppn", package = "piecenikr")
game <- read_ppn(ppn_file)[[1L]]
envir <- c(looney_pyramid_game_system(), game_systems())
animate_game(game, file = "man/figures/martian-chess.gif",
annotate = FALSE, envir = envir,
ppi = 50,
n_transitions = 6L, n_pauses = 4L, fps = 8,
trans = op_transform, op_scale = 0.25, op_angle = 90,
pt_thickness = 0.3)