function tictactoeanim
  mainFig = figure('Visible','on');
  yLocation = 100;
  set(mainFig,'KeyPressFcn',@keypress_Callback);
    function keypress_Callback(source, event)
        if (event.Character == 'u')
            yLocation = yLocation + 10;
        elseif (event.Character == 'd')
            yLocation = yLocation - 10;
        end
    end

  tictactoeboard(zeros(3));
  i = 0;
  x = zeros(1,4);
  y = zeros(1,4);
  z = zeros(1,4);
  while (i < 400)
      x(1) = i;
      y(1) = yLocation;
      x(2) = x(1);
      y(2) = y(1) + 50;
      x(3) = x(1) + 50;
      y(3) = y(1) + 50;
      x(4) = x(1) + 50;
      y(4) = y(1);
      gamepiece = patch(x,y,z,'FaceColor', 'blue');
      pause(1);
      delete(gamepiece);
      i = i + 10;
  end;
end