import java.applet.Applet; import java.awt.event.*; import java.awt.*; public class Spine { /**This class contains methods which extract the defining functions from the combinatorial information calculated when we perform the combinatorial version of the unfolding.*/ public Spine() {} /**Here is a palindrome test. 1 means palindrome*/ public static int palindromeTest(CombinatorialTriangle[] T) { int N=T[0].c[0]+1; for(int i=1;i=n) qq=q-n; S=W.substring(qq,qq+1); if(S.compareTo("1")==0) m=0; if(S.compareTo("2")==0) m=1; if(S.compareTo("3")==0) m=2; return(m); } public static int lastDigit(String W) { return(getDigit(W,W.length()-1)); } public static int[] getTriple(String W,int q) { int[] m=new int[3]; int n=W.length(); for(int i=-1;i<=1;++i) { m[i+1]=getDigit(W,q+i); } return(m); } }