function [ w, p ] = boundary_hexiamond ( index )

%*****************************************************************************80
%
%% boundary_hexiamond(): the boundary word for a hexiamond.
%
%  Discussion:
%
%    The boundary word describes how to trace the boundary by starting
%    at a base point (i,j), and taking a sequence of steps of unit length 
%    in one of 6 directions, as suggested by this diagram:
%
%          5-----0-----*
%      ^  / \   / \   /
%     /  /   \ /   \ /
%    J  4-----P-----1
%      / \   / \   /
%     /   \ /   \ /
%    *-----3-----2
%
%          I-->
%
%    If the current position P has parallelogram coordinates (I,J), then
%    the step of given index moves to
%
%      0  (I,  J+1)
%      1  (I+1,J  )
%      2  (I+1,J-1)
%      3  (I,  J-1)
%      4  (I-1,J  )
%      5  (I-1,J+1)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 November 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer INDEX: a value between 1 and 12.
%
%  Output:
%
%    string W: the boundary word.
%
%    integer P(1,2): the boundary word starting point.
%

%
%  bat/chevron
% 
 if ( index == 1 )
    w = '11004343';
    p = [ 0, 0 ];
%
%  butterfly
%
  elseif ( index == 2 )
    w = '11504423';
    p = [ 1, 0 ];
%
%  club/crook
%
  elseif ( index == 3 )
    w = '11044532';
    p = [ 1, 0 ];
%
%  crown
%
  elseif ( index == 4 )
    w = '11045342'; 
    p = [ 1, 0 ];
%
%  hexagon
%
  elseif ( index == 5 )
    w = '105432'; 
    p = [ 1, 0 ];
%
%  lobster
%
  elseif ( index == 6 )
    w = '02055332'; 
    p = [ 1, 0 ];
%
%  pistol/signpost
%
  elseif ( index == 7 )
    w = '01045332';
    p = [ 1, 0 ];
%
%  rhomboid/bar
%
  elseif ( index == 8 )
    w = '11104443';
    p = [ 0, 0 ];
%
%  shoe/hook
%
  elseif ( index == 9 )
    w = '10205433';
    p = [ 0, 0 ];
%
%  snake
%
  elseif ( index == 10 )
    w = '01053432';
    p = [ 1, 0 ];
%
%  sphinx
%
  elseif ( index == 11 )
    w = '11154533';
    p = [ 0, 0 ];
%
%  yacht
%
  elseif ( index == 12 )
    w = '11053533';
    p = [ 0, 0 ];
%
%  Not a valid index.
%
  else
    w = [];
    p = [];
  end

  return
end

