function [ snake, ladder ] = snake_ladder_setup ( )

%*****************************************************************************80
%
%% snake_ladder_setup() initializes the snakes and ladders data.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 January 2021
%
%  Author:
%
%    John Burkardt
%
%  Output:
%
%    integer snake(101), if snake(i) is nonzero, square I leads to snake(i).
%
%    integer ladder(101), if ladder(i) is nonzero, square I leads to 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
