Research Article

Mining Experiential Patterns from Game-Logs of Board Game

Algorithm 3

BranchShifting.
Procedure  BranchShifting
Input:
root, the root node of the sequence-tree.
node, the pointer that points to the current node.
Output:
 Updated node.
isShifted, the result of shifting.
Method:
(01) if  node.value == root.value then
(02) node = root;
(03) return true;
(04) else
(05) if  root.branches == null then
(06)  return false;
(07) else
(08)  for    to  root.branches.length − 1  do
(09)   if BranchShifting(root.branches[].next, node) == true then
(10)    return true;
(11)   endif
(12)  endfor
(13)  return false;
(14) endif
(15) endif