The Pieces and how to see them

The code to configure Piece #1 is as follows:
  // define Piece#1
  thePiece = new Piece();
  thePiece->SetId(1);
  sp = new Space(black,0,0);  // first Square should always be at 0,0 then others are relative to it
  sp->SetOccupied();  sp->SetBorder(0);  sp->SetBorder(1);  sp->SetBorder(2);
  thePiece->AddSquare(sp);
  sp = new Space(red,-1,0);
  sp->SetOccupied();  sp->SetBorder(0);  sp->SetBorder(3);
  thePiece->AddSquare(sp);
  sp = new Space(black,-1,-1);
  sp->SetOccupied();  sp->SetBorder(1);  sp->SetBorder(3);
  thePiece->AddSquare(sp);
  sp = new Space(red,-1,-2);
  sp->SetOccupied();  sp->SetBorder(1);  sp->SetBorder(2);  sp->SetBorder(3);
  thePiece->AddSquare(sp);

You can put it on the Board with this command:

TheBoard.InsertPiece(thePiece,3,3);

Then you can look at it in text format (my favorite) by doing this

TheBoard->Draw();
which makes this output
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       ..       ..       ..       ..       ..       ..       .
    r        b        r        b        r        b        r        b    
.       ..       ..       ..       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       ..       ..       ..       ..       ..       ..       .
    b        r        b        r        b        r        b        r    
.       ..       ..       ..       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       ..       ..       ..       ..       ..       ..       .
    r        b        r        b        r        b        r        b    
.       ..       ..       ..       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       ..       ..       ..       ..       ..       ..       .
    b        r        b        r        b        r        b        r    
.       ..       ..       ..       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . . .=======..=======. . . . .  . . . .  . . . .  . . . . 
.       ..       .|       ..       |.       ..       ..       ..       .
    r        b    |   R        B   |    r        b        r        b    
.       ..       .|       ..       |.       ..       ..       ..       .
 . . . .  . . . .  . . . . .=======. . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       .|       |.       ..       ..       ..       ..       .
    b        r    |   B   |    r        b        r        b        r    
.       ..       .|       |.       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       .|       |.       ..       ..       ..       ..       .
    r        b    |   R   |    b        r        b        r        b    
.       ..       .|       |.       ..       ..       ..       ..       .
 . . . .  . . . . .=======. . . . .  . . . .  . . . .  . . . .  . . . . 
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
.       ..       ..       ..       ..       ..       ..       ..       .
    b        r        b        r        b        r        b        r    
.       ..       ..       ..       ..       ..       ..       ..       .
 . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . .  . . . . 
(If you like, you can see all the Pieces in this format on this page.)


To make pictures using paw, use this command

TheBoard->DrawForPaw();
which makes this output
title 'Piece 1'
exec StartMovie
vec/cre c(8,8) r  _
    -0.4 0.4 -0.4 0.4 -0.4 0.4 -0.4 0.4 _
    0.4 -0.4 1 -0.4 0.4 -0.4 0.4 -0.4 _
    -0.4 0.4 -1 0.4 -0.4 0.4 -0.4 0.4 _
    0.4 -0.4 1 -1 0.4 -0.4 0.4 -0.4 _
    -0.4 0.4 -0.4 0.4 -0.4 0.4 -0.4 0.4 _
    0.4 -0.4 0.4 -0.4 0.4 -0.4 0.4 -0.4 _
    -0.4 0.4 -0.4 0.4 -0.4 0.4 -0.4 0.4 _
    0.4 -0.4 0.4 -0.4 0.4 -0.4 0.4 -0.4
hi/put/con 100 c 
lego 100 90 0 2 
line 2.96 1.96 2.96 1.04
line 2.04 1.04 2.96 1.04
line 2.04 1.96 2.04 1.04
line 2.96 2.96 2.96 2.04
line 2.04 2.96 2.04 2.04
line 2.04 3.96 2.96 3.96
line 2.04 3.96 2.04 3.04
line 3.04 3.96 3.96 3.96
line 3.96 3.96 3.96 3.04
line 3.04 3.04 3.96 3.04
pic/print Piece1.gif
which you can cut and paste into paw to get this picture

(You will need to have StartMovie.kumac if you really want to do this.)



Here are all 12 Pieces:

1

2

3

4

5

6

7

8

9

10

11

12

The code used to generate these pictures, and from which the snippets above were taken is JustDraw.c
lisa@mps.ohio-state.edu