function [ snake, ladder ] = snakes_ladder_setup ( )

%*****************************************************************************80
%
%% snakes_ladder_setup() defines the snakes and ladders for the game.
%
%  Discussion:
%
%    The two vectors could be merged into one.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Output:
%
%    integer SNAKE(101,1), LADDER(101,1), define the snakes and
%    ladders.  If a player lands on square I, then if SNAKE(I) is not I,
%    the player is immediately moved to a previous square whose index
%    is SNAKE(I).  Similarly, if LADDER(I) is not I, then player is
%    immediately taken to a later square whose index is LADDER(I).
%
  O = 1;

  ladder = zeros ( 101, 1 );

  ladder(0+O:100+O) = 0+O:100+O;

  ladder(1+O) = 38+O;
  ladder(4+O) = 14+O;
  ladder(9+O) = 31+O;
  ladder(21+O) = 42+O;
  ladder(28+O) = 84+O;
  ladder(36+O) = 44+O;
  ladder(51+O) = 67+O;
  ladder(71+O) = 91+O;
  ladder(80+O) = 100+O;

  snake = zeros ( 101, 1 );

  snake(0+O:100+O) = 0+O:100+O;

  snake(16+O) = 6+O;
  snake(48+O) = 26+O;
  snake(49+O) = 11+O;
  snake(56+O) = 53+O;
  snake(62+O) = 19+O;
  snake(64+O) = 60+O;
  snake(87+O) = 24+O;
  snake(93+O) = 73+O;
  snake(95+O) = 75+O;
  snake(98+O) = 78+O;

  return
end
