function sudoku
global board

% basic idea
% set up game
% get custom board

another = true;
while another
  setUpGame();
  playGame();
  another = anotherGame();
end
return

function setUpGame()
global board
disp('Setting Up Game');
board(1:9,1:9) = ' ';
ans = input('Custom or Default Board? (0 custom, 1 default) ');
if ans == 0
  getCustomBoard();
else
  board = ['1   9   8'
           ' 897    3'
           ' 4     7 '
           '     294 '
           '   5 1   '
           ' 243     '
           ' 1     5 '
           '8    763 '
           '7   5   4']
end
return

function getCustomBoard()
global board
disp('Getting Custom Board');
disp('Enter each line with periods and numerals eg ..26...1.');
disp('        123456789');
for ii=1:9
  fprintf('line %1d', ii);
  board(ii,1:9) = input(': ','s');
end
mask = board == '.'
board(mask) = ' '
return

function playGame()
global board
disp('Playing Game');
return

function another = anotherGame();
another = input('Play again?  (0 no, 1 yes) ');
return

