# Looney Pyramids

Contents

## Intro

Looney Pyramids aka Icehouse pieces is a game system invented by Andrew Looney. The following are good sites of information about Looney Pyramids:

The package piecenikr provides a looney_pyramids() function that provides an icehouse_piceces configuration to make Looney Pyramids graphics with piecepackr.

```library("piecepackr")
library("piecenikr")
library("tibble")
cfg <- looney_pyramids()\$icehouse_pieces

dft <- tibble(piece_side="tile_back", x=1.5, y=1.5, suit=NA, rank=NA, angle=NA)
dfp <- tibble(piece_side=c("pyramid_face", "pyramid_left", "pyramid_right", "pyramid_back"),
x=c(1,2,2,1), y=c(2,2,1,1), suit=1:4, rank=c(1:3,3), angle=seq(90, 360, 90))
df1 <- rbind(dft, dfp)

dft <- tibble(piece_side="tile_back", x=3.5, y=3.5, suit=NA, rank=NA, angle=NA)
dfp <- tibble(piece_side="pyramid_top", x=2+c(1,2,2,1,1,2,2,2), y=2+c(2,2,1,1,1,1,1,1),
suit=c(1:6,2,3), rank=c(1:3,3,1,2,1,1), angle=seq(0, 630, 90))
df2 <- rbind(dft, dfp)
df <- rbind(df1, df2)

pmap_piece(df, grid.piece, cfg = cfg, default.units = "in")
``` Looney Pyramids (2D)

## Martian Chess

Here are some example 4-player setup diagrams for Andy Looney's game Martian Chess drawn in various projections using piecenikr and piecepackr.

```library("piecepackr")
library("piecenikr")

df <- piecenikr::df_martian_chess(n_players = 4, seed = 42)
envir <- c(game_systems(), looney_pyramids())
```
```pmap_piece(df, envir=envir, default.units="in", trans=op_transform)
``` Setup for Andy Looney's Martian Chess (2D)

```pmap_piece(df, envir=envir, default.units="in", trans=op_transform,
op_angle = 90, op_scale=0.5)
``` Setup for Andy Looney's Martian Chess (3D oblique)

```envir <- c(game_systems("sans3d"), looney_pyramids())
library("rgl")
rgl.open()
bg3d("white")
if (Sys.which("wmctrl") != "") system("wmctrl -r RGL -e 0,-1,-1,1080,1080")
view3d(phi=-30, zoom = 0.8)
pmap_piece(df, piece3d, envir=envir, trans=op_transform)
```
```## Loading required namespace: readobj
``` Setup for Andy Looney's Martian Chess (3D rgl)