Created
November 19, 2016 05:00
-
-
Save dattp/27be10f0977a32ae0066c328d6cf358d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package project1; | |
/** | |
* | |
* @author Desktop | |
*/ | |
public class NewClass { | |
public static class State0{ | |
public State0(){ | |
System.out.print("B"); | |
} | |
public void show(){ | |
System.out.print("B"); | |
} | |
} | |
public static class State1 extends State0{ | |
public State1(){ | |
System.out.print("E"); | |
} | |
@Override | |
public void show(){ | |
System.out.print("C"); | |
} | |
} | |
public static class State2 extends State1{ | |
public State2(){ | |
System.out.print("C"); | |
} | |
@Override | |
public void show(){ | |
System.out.print("E"); | |
} | |
} | |
public static class State3 extends State2{ | |
public State3(){ | |
System.out.print("A"); | |
} | |
@Override | |
public void show(){ | |
System.out.print("D"); | |
} | |
} | |
public static class State4 extends State3{ | |
public State4(){ | |
System.out.print("D"); | |
} | |
@Override | |
public void show(){ | |
System.out.print("E"); | |
} | |
} | |
public static class A{ | |
public void inRa(State0 s){ | |
System.out.print("D"); | |
System.out.print("C"); | |
s.show(); | |
} | |
} | |
public static class B extends A{ | |
@Override | |
public void inRa(State0 s){ | |
System.out.print("B"); | |
System.out.print("A"); | |
} | |
} | |
public static class F1{ | |
public static A getA(int t){ | |
if(t%2==0) return new A(); | |
return new B(); | |
} | |
} | |
public static class F2{ | |
public static State0 getS(int t){ | |
if((t <= ((Y*Y+2*Y+15)%27)+Y) && (t > ((X+4)%27)+Y)) return new State1(); | |
if((t >= ((17+Y*Y)%27)+Y) && (t < ((5*X + 8)%27) + Y)) return new State2(); | |
if(t%3==2) return new State3(); | |
if(t%3==1) return new State4(); | |
return new State0(); | |
} | |
} | |
public static int X = 57; | |
public static int Y = X + 2; | |
public static void main(String[] args) { | |
State0 s; | |
A objA; | |
for(int j=Y; j<Y+12; j++){ | |
s = F2.getS(j); s.show(); | |
objA = F1.getA(j); objA.inRa(s); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment