/*************************/
/*TriTacTix © t.heyn 2002*/
/*************************/

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;

public class TriTacTix extends Applet implements ActionListener, ItemListener, Konstanten
	{
   int modus=ALLEIN;
   int level=PROFI;
   String spiel=VOLLESBRETT;
   int spieler;
   int xText;
   String kommentar;
   Vector alleZuege = new Vector();
 	Choice modusWahl = new Choice();
   Choice levelWahl = new Choice();
   Choice spielWahl = new Choice();
  	TextArea text = new TextArea("",15,12,TextArea.SCROLLBARS_NONE);
  	Spielbrett spielbrett = new Spielbrett(VOLLESBRETT);
  	Spielbrett testbrett = new Spielbrett(LEERESBRETT);
  	int anzahlKugeln=spielbrett.count('1');
  	Kugel kugeln[] = new Kugel[anzahlKugeln];
  	Muster muster[][] = new Muster[MUSTER.length][];
  	Muster zuege[] = new Muster[ZUEGE.length];
 	AudioClip ton[] = new AudioClip[4];
 	Image bild[] = new Image[4];
	Image HintergrundBild = null;
	Graphics HintergrundGrafik = null;

/*************initialisierung**************/
   public void init()
   	{
		showStatus("Lade Bilder...");
		laden();
		showStatus("TriTacTix © t.heyn 2002");
		addMouseListener(new MyMouse());
		addKeyListener(new MyKey());
		setCursor(new Cursor(Cursor.HAND_CURSOR));
		setLayout(new BorderLayout());
    	Panel anzeige = new Panel();
    		anzeige.setLayout(new BorderLayout());
    		anzeige.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    		add("East",anzeige);
    	Label titel = new Label("TriTacTix",Label.CENTER);
			titel.setBackground(Color.yellow);
			titel.setFont(new Font("SansSerif",Font.BOLD,18));
			anzeige.add("North",titel);
    		anzeige.add("Center",text);
    		text.setEnabled(false);
    	Panel controls = new Panel();
    		controls.setLayout(new BorderLayout());
    		anzeige.add("South",controls);
        	spielWahl.add("The Full Monty");	
      	spielWahl.add("Burki's Triangle");
      	spielWahl.add("Sierpinski");
      	spielWahl.add("Mitsubishi");
      	spielWahl.add("Isle of Man");
      	spielWahl.add("Wings");
      	spielWahl.addItemListener(this);
      	controls.add("North",spielWahl);
        	modusWahl.add("1 Spieler");
      	modusWahl.add("2 Spieler");
      	modusWahl.addItemListener(this);
      	controls.add("West",modusWahl);
       	levelWahl.add("Profi");
      	levelWahl.add("Normalo");
     		levelWahl.add("Anfänger");
      	levelWahl.addItemListener(this);
      	controls.add("East",levelWahl);
  		Button neu= new Button("Neues Spiel");
    		neu.addActionListener(this);
    		controls.add("South",neu);    		
		for (int z=0;z<8;z++)
			{
			for (int s=0;s<=z;s++)
				{
				kugeln[(z*(z+1)/2 + s)] = new Kugel(X_START+57*s-z*29,Y_START+49*z,z+1,s+1,bild[1],bild[2]);
				}
			}
		for (int i=0;i<MUSTER.length;i++)
			{
			muster[i]=new Muster[MUSTER[i].length];
			for (int j=0;j<MUSTER[i].length;j++)
				{
				muster[i][j]= new Muster(MUSTER[i][j]);
				}
  			}
  		for (int i=0;i<ZUEGE.length;i++)
			{
  			zuege[i]= new Muster(ZUEGE[i]);
  			}
		schreiben();				
    	neuesSpiel();
		}

/*************zeichnen**************/
	public void paint(Graphics g)
		{
		g.drawImage(bild[0],0,0,this);
		for (int i=0;i<anzahlKugeln;i++)
			{
			kugeln[i].paint(g);
			}
      g.setFont(new Font("SansSerif",Font.BOLD,14));
		xText = (bild[0].getWidth(this)-g.getFontMetrics().stringWidth(kommentar))/2;//zentriert schreiben
		g.setColor(Color.red);
    	g.drawString(kommentar,xText,getSize().height-5);
		}
		
	public final void update(Graphics g) //double buffering
		{
		if(HintergrundBild==null) HintergrundBild = createImage(getSize().width,getSize().height);
		HintergrundGrafik = HintergrundBild.getGraphics();
		HintergrundGrafik.clearRect(0,0,getSize().width,getSize().height);
		paint(HintergrundGrafik);
		g.drawImage(HintergrundBild,0,0,null);
		}

/*************listener**************/
	public void itemStateChanged(ItemEvent e)
		{
		String modusItem=(String) modusWahl.getSelectedItem();
			if (modusItem=="1 Spieler") 
				{
				modus=ALLEIN;
				levelWahl.setEnabled(true);
				}
			if (modusItem=="2 Spieler")
				{
				modus=ZU_ZWEIT;
				levelWahl.setEnabled(false);
				}
		String levelItem=(String) levelWahl.getSelectedItem();
			if (levelItem=="Anfänger") level=ANFAENGER;
			if (levelItem=="Normalo")  level=NORMALO;
			if (levelItem=="Profi")    level=PROFI;
		String SpielItem=(String) spielWahl.getSelectedItem();
			if (SpielItem=="The Full Monty") spiel=VOLLESBRETT;
			if (SpielItem=="Burki's Triangle") spiel=BURKI;
			if (SpielItem=="Sierpinski") spiel=SIERPINSKI;
			if (SpielItem=="Mitsubishi") spiel=MITSUBISHI;
			if (SpielItem=="Isle of Man") spiel=ISLEOFMAN;
			if (SpielItem=="Wings") spiel=WINGS;
		neuesSpiel();
		}

	public void actionPerformed(ActionEvent e)
		{
		if (e.getActionCommand() =="Neues Spiel") neuesSpiel();
		}
		
	private class MyMouse extends MouseAdapter
		{
		int x, y;
		public void mousePressed(MouseEvent e)
			{
			x = e.getX()-R;
			y = e.getY()-R;
			for (int i=0;i<anzahlKugeln;i++)
				{
				if ((kugeln[i].x-x)*(kugeln[i].x-x)+(kugeln[i].y-y)*(kugeln[i].y-y)<R*R && kugeln[i].status>0)
					{
					if (kugeln[i].status==DA) testbrett.setzen(kugeln[i].z,kugeln[i].s);
					if (kugeln[i].status==AKTIV) testbrett.wegnehmen(kugeln[i].z,kugeln[i].s);
					kugeln[i].wechseln();
					update(getGraphics());
					break;
					}
				}
			}
		}

	private class MyKey extends KeyAdapter
		{
		public void keyPressed(KeyEvent e)
			{
			if (e.getKeyChar() == 10 || e.getKeyChar() == 3) neuesSpiel();//return, enter
			if (e.getKeyChar() == 32) spielen();//kugeln wegnehmen mit leertaste
			if (e.getKeyChar() == 8) zugZurueck();//zug rückgängig machen mit 'del'
			}
		}

/*************spiel methoden**************/		
	private void zugZurueck()
		{
		//nimmt bei 1spieler modus zwei züge zurück, bei 2spieler modus nur einen
		String letzterZug;
		if (spielbrett.count('1')==0 || alleZuege.size()<=3-modus) return;
		letzterZug=(String)alleZuege.elementAt(3-modus);
		for (int i=0;i<3-modus;i++)
			{
			alleZuege.removeElementAt(0);
			}
		spielbrett.setString(letzterZug);
		for (int i=0;i<anzahlKugeln;i++)
			{
			if (spielbrett.muster[kugeln[i].z].charAt(kugeln[i].s)=='1') kugeln[i].hinlegen();
			}
		kommentar="Entscheide dich!";
		ton[0].play();
		spieler=3-spieler;

		update(getGraphics());
		}

	private void wegnehmen()
		{
		//nimmt die ausgewählten kugeln weg
		for (int i=0;i<anzahlKugeln;i++)
			{
			if (kugeln[i].status==AKTIV) spielbrett.wegnehmen(kugeln[i].z,kugeln[i].s);
			if (spielbrett.muster[kugeln[i].z].charAt(kugeln[i].s)=='0') kugeln[i].wegnehmen();
			}
		//zug wird in vector zwischengespeichert
		alleZuege.insertElementAt(spielbrett.getString(),0);
		}

	private boolean gueltigerZug()
		{
		//prüft, ob der zug des menschen gültig ist
		boolean ja=false;
		for (int i=0;i<anzahlKugeln;i++)
			{
			if (testbrett.muster[kugeln[i].z].charAt(kugeln[i].s) != '1') continue;
			for (int nr=0;nr<zuege.length;nr++)
				{
				if (testbrett.zugErlaubt(kugeln[i].z,kugeln[i].s,zuege[nr]) 
					 && testbrett.count('1')==zuege[nr].count('1')) ja=true;
				}
			}
		testbrett.setString(LEERESBRETT);
		//wenn ja, dann zug ausführen, sonst rückgängig machen
		if (ja) wegnehmen();
		else
			{
			for (int i=0;i<anzahlKugeln;i++)
				{
				if (kugeln[i].status==AKTIV) kugeln[i].hinlegen();
				}
			update(getGraphics());
			}
		return ja;
		}
		
	private void spielen()
		{
		//nur wegnehmen, wenn gültiger zug
		if (! gueltigerZug()) return;
		//für 1 spieler modus
		if (modus==ALLEIN)
			{
			kommentar="Ich denke";
			update(getGraphics());
			if  (spielbrett.count('1')==0) kommentar="Du hast verloren!";
			else  
				{
				setCursor(new Cursor(Cursor.WAIT_CURSOR));
				ton[2].play();
				zugBerechnen();
				wegnehmen();
				setCursor(new Cursor(Cursor.HAND_CURSOR));
				if (spielbrett.count('1')==0) kommentar="Du hast gewonnen!";
				}
			}
		//für 2 spieler modus
		if (modus==ZU_ZWEIT)
			{
			if (spielbrett.count('1')==0) kommentar="Spieler "+(3-spieler)+" gewinnt!";
			else 
				{
				kommentar="Spieler "+(3-spieler)+" ist dran";
				spieler=3-spieler;
				}
			}
		//töne
		if (spielbrett.count('1')>0) ton[2].play();
		else if (spielbrett.count('1')==0 && kommentar=="Du hast verloren!") ton[1].play();
		else ton[3].play();
   	update(getGraphics());
		}

	private void zugBerechnen()
		{
		kommentar="Du bist dran!";
		if (! gewinnsituation() && level > ANFAENGER)
			//normalo level nächsten zug berechnen 
			{
			if (naechsterZug()) 
				{
				kommentar="Du hast keine Chance!";
				return;
				}
			//profi level 2 zuege voraus berechnen
			if (level==PROFI && uebernaechsterZug()) return; 
			}
		//sonst zufallszug
		zufallszug();
		}

	private boolean naechsterZug()
		{
		//berechnet den nächsten zug des computers
		for (int i=0;i<anzahlKugeln;i++)
			{
			for (int nr=0;nr<zuege.length;nr++)
				{
				if (spielbrett.muster[kugeln[i].z].charAt(kugeln[i].s)=='1' 
					 && spielbrett.zugErlaubt(kugeln[i].z,kugeln[i].s,zuege[nr]))
					{
					spielbrett.ziehen(kugeln[i].z,kugeln[i].s,zuege[nr]);
					if (gewinnsituation()) 
						{
						return true;
						}
					spielbrett.zugZurueck();				
					}
				}
			}
		return false;
		}

	private boolean uebernaechsterZug()
		{
		//berechnet den nächsten zug des menschen
		mischen();
		String temp=spielbrett.getString();
		for (int i=0;i<anzahlKugeln;i++)
			{
			for (int nr=0;nr<zuege.length;nr++)
				{
				if (spielbrett.zugErlaubt(kugeln[i].z,kugeln[i].s,zuege[nr]))
					{
					spielbrett.ziehen(kugeln[i].z,kugeln[i].s,zuege[nr]);
					//wenn mensch nicht gewinnen kann, dann ziehen
					if (! naechsterZug()) 
						{
						spielbrett.setString(temp);
						spielbrett.ziehen(kugeln[i].z,kugeln[i].s,zuege[nr]);
						return true;
						}
					spielbrett.setString(temp);
					}
				}
			}
		return false;
		}

	private boolean gewinnsituation()
		{
		int typA=0;
		int typC=0;
		int typB2=0;
		int typB3=0;
		int typB4=0;
		int typB5=0;
		int typB6=0;
		int typD=0;
		int typE=0;
		int x[]= new int[MUSTER.length];
		int total=spielbrett.count('1');
		//absuchen nach allen bekannten mustern
		for (int i=0;i<MUSTER.length;i++)
			{
			for (int j=0;j<MUSTER[i].length;j++)
				{
				x[i]+=spielbrett.vergleichen(muster[i][j]);
				}
			total-=x[i]*muster[i][0].count('1');
			}
		//wenn total nicht 0, dann nicht alle muster erkannt
		if (total>0) return false;
		//typ 0 ignorieren, alle anderen zählen
		typA+=x[4]%2;
		typA+=x[5]+x[6]+x[7]+x[8]+x[9];
		typB2+=x[10];
		typB3+=x[11]+x[12];
		typB4+=x[13]+x[14]+x[15];
		typB5+=x[16]+x[17]+x[18]+x[19]+x[20]+x[21]+x[22]+x[23]+x[24]+x[25];
		typB6+=x[26]+x[27];
		typC+=x[28]+x[29]+x[30]+x[31]+x[32]+x[33];
		typD+=x[34]+x[35]+x[36]+x[37]+x[38];
		typE+=x[39]+x[40]+x[41]+x[42];
		//auswertung
		if (typA%2==1 && typB2==0 && typB3==0 && typB4+typB5+typB6==0 && typC==0  && typD==0 && typE==0) return true;
		if (typA%2==1 && typB2==0 && typB3==0 && typB4+typB5+typB6==0 && typC%2==1&& typD==0 && typE==0) return true;
		if (typA%2==1 && typB2==1 && typB3==1 && typB4+typB5+typB6==0 && typC==0  && typD==0 && typE==0) return true;
		if (typA%2==0 && typB2==0 && typB3==0 && typB4+typB5+typB6==0 && typC==0  && typD==2 && typE==0) return true;
		if (typA%2==1 && typB2==0 && typB3==1 && typB4+typB5+typB6==0 && typC==0  && typD==1 && typE==0) return true;
		if (typA%2==0 && typB2==1 && typB3==0 && typB4+typB5+typB6==0 && typC==0  && typD==1 && typE==0) return true;
		if (typA%2==0 && typB2==0 && typB3==0 && typB4+typB5+typB6==0 && typC==0  && typD==0 && typE==1) return true;
		if (typA%2==0 && typB2%2==0 && typB3%2==0 && typB4%2==0 && typB5%2==0 && typB6%2==0 && typC+typD+typE==0 
			 && typB2+typB3+typB4+typB5+typB6>0) return true;
		return false;
		}

	private void zufallszug()
		{
		int z=0;
		int s=0;
		int nr=0;
		boolean gefunden=false;
		//zufällig probieren bis ein erlaubter zug gefunden
		while (! gefunden)
			{
			z=(int)(Math.random()*8+1);
			s=(int)(Math.random()*z+1);
			nr=(int)(Math.random()*ZUEGE.length);
			if (spielbrett.muster[z].charAt(s)=='1' && spielbrett.zugErlaubt(z,s,zuege[nr]))
				{
				spielbrett.ziehen(z,s,zuege[nr]);
				gefunden=true;
				}
			}
		}

	private void mischen()
		{
		//mischt den array zuege, damit der computer nicht immer gleich spielt
		Muster temp;
		for (int i=0;i<20;i++)
			{
			int a=(int)(Math.random()*zuege.length);
			int b=(int)(Math.random()*zuege.length);
			temp=zuege[a];
			zuege[a]=zuege[b];
			zuege[b]=temp;
			}
		}

	private void neuesSpiel()
		{
		//setzt alle variablen zurück
		spieler=1;
		spielbrett.setString(spiel);
		testbrett.setString(LEERESBRETT);
		for (int i=0;i<anzahlKugeln;i++)
			{
			kugeln[i].wegnehmen();
			}
		alleZuege.removeAllElements();
		alleZuege.addElement(spiel);
		if (modus==ALLEIN) kommentar="Los gehts!";
		else kommentar="Spieler 1 beginnt";
		for (int i=0;i<anzahlKugeln;i++)
			{
			if (spielbrett.muster[kugeln[i].z].charAt(kugeln[i].s)=='1') kugeln[i].hinlegen();
			}
		update(getGraphics());
		}

	private void schreiben()
		{
		text.setText("Ihr nehmt abwechslungsweise Kugeln weg, aber nur in einer Linie und aneinander liegende."
						+" Wer die Letzte Kugel nehmen muss, verliert.\n\nDie Kugeln einzeln"
						+" auswählen mit der Maus, dann alle entfernen mit der Leertaste.\n"
						+"Zug widerrufen mit der Löschtaste.\n\nDu kannst zwischen verschiedenen Spielanfängen wählen.");
		}

	private void laden()
		{
		//töne laden
		for (int i=0;i<4;i++)
			{
			ton[i]=getAudioClip(getCodeBase(),SOUNDS[i]+".au");
			}
     	//bilder laden mit tracker
   	MediaTracker tracker=new MediaTracker(this);
		for (int i=0;i<3;i++)
			{
	    	bild[i]=getImage(getCodeBase(),GIFS[i]+".gif");
    		tracker.addImage(bild[i],1);
			}
    	try {tracker.waitForAll();} catch(InterruptedException e) {}
		}
	}

import java.util.Vector;

public class Muster
	{
	Vector musterVektor= new Vector();
	int groesse;
	String a;
	String muster[];
	
	public Muster(String a)
		{
		this.a=a;
		toArray();
		}

	private void toArray()
		{
		musterVektor.removeAllElements();
		String temp="";
		int laenge=a.length();
		//string unterteilen und in vektor einlesen
		for (int i=0;i<a.length();i++)
			{
			if (a.charAt(i)!=' ') temp += a.charAt(i);
				else 
				{
				musterVektor.addElement(temp);
				temp="";
				}
			}
		//vektor in array einlesen
		groesse=musterVektor.size();
		muster = new String[groesse];
		for (int i=0;i<groesse;i++)
			{
			muster[i] = (String)musterVektor.elementAt(i);
			}
		}
		
	public String getString()
		{
		String theString="";
		for (int i=0;i<groesse;i++)
			{
			theString += muster[i] + " ";
			}
		return theString;
		}

	public void setString(String a)
		{
		this.a=a;
		toArray();
		}
		
	public int count(char c)
		{
		int anzahl=0;
		for (int i=0;i<a.length();i++)
			{
			if (a.charAt(i)==c) anzahl ++;
			}
		return anzahl;
		}
	} 

public class Spielbrett extends Muster
	{
	int total;
	String letzterZustand;
	
	public Spielbrett(String a)
		{
		super(a);
		}
		
	public int vergleichen(Muster tester)
		{
		int anzahl=0;
		for (int z=0;z<groesse-tester.groesse+1;z++)//bei jeder position vergleichen
			{
			for (int s=0;s<(muster[z].length()-tester.muster[0].length()+1);s++)
				{
				if (passt(z,s, tester)) anzahl++;
				}
			}
		return anzahl;
		}

	public void ziehen(int z, int s, Muster tester)
		{
		letzterZustand=getString();
		for (int i=0;i<tester.groesse;i++) //für alle zeilen des testers
			{
			for (int j=0;j<tester.muster[i].length();j++)
				{
				if (tester.muster[i].charAt(j) == '1') wegnehmen(z+i,s+j);
				}
			}
		setString(getString());
		}

	public boolean zugErlaubt(int z, int s,Muster tester)
		{
		if (passt(z,s, tester)) return true;
		return false;
		}
		
	private boolean passt(int z, int s, Muster tester)
		{
		for (int i=0;i<tester.groesse;i++) //für alle zeilen des testers
			{
			for (int j=0;j<tester.muster[i].length();j++)//string vergleichen
				{
				if (j+s >= muster[z+i].length()) break;
				if (tester.muster[i].charAt(j) == 'x') continue;
				if (muster[z+i].charAt(s+j) != tester.muster[i].charAt(j)) return false;
				}
			}
		return true;
		}
		
	public void wegnehmen(int z,int s)
		{
		muster[z] = muster[z].substring(0,s) + "0" + muster[z].substring(s+1);
		setString(getString());
		}

	public void setzen(int z,int s)
		{
		muster[z] = muster[z].substring(0,s) + "1" + muster[z].substring(s+1);
		setString(getString());
		}
		
	public void zugZurueck()
		{
		setString(letzterZustand);
		}
	}

//Kugel//

import java.awt.*;

public class Kugel extends Panel
	{
	int x,y,z,s;
	int status;
	Image bild, bild1, bild2;
		
	public Kugel (int x, int y, int z, int s, Image bild1, Image bild2)
		{
		this.x=x;
		this.y=y;
		this.z=z;
		this.s=s;
		this.bild1=bild1;
		this.bild2=bild2;
		}

	public void paint(Graphics g)
		{
		g.drawImage(bild,x,y,this);
		}

	public void wechseln()
		{
		if (bild==bild1) bild=bild2;
			else bild=bild1;
		status=3-status;
		}
		
	public void wegnehmen()
		{
		bild=null;
		status=0;
		}
		
	public void hinlegen()
		{
		bild=bild1;
		status=1;
		}		
	}

//damit die applet klasse nicht zu gross wird

public interface Konstanten 
	{
	public static final int ANFAENGER=2, NORMALO=10, PROFI=50;	//level
	public static final int ALLEIN=1,ZU_ZWEIT=2;						//modi
	public static final int WEG=0, DA=1, AKTIV=2;					//kugelstatus
	public static final int R=20, ABSTAND=60;							//kugelradius, abstand zweier kugeln
	public static final int X_START=250, Y_START=56;				//kooordinaten erste kugel
	public static final String GIFS[]=									//dateinamen gif-bilder
		{"spielbrett","kugel","kugel1"};
	public static final String SOUNDS[]=								//dateinamen sounds
		{"oops","muh","pling","fanfare"};
	
	//für alle muster gilt: 1=kugel da, 0=keine kugel, x=egal
	
	public static final String VOLLESBRETT=
	"00 010 0110 01110 011110 0111110 01111110 011111110 0111111110 x000000000x ";
	public static final String BURKI=
	"00 000 0000 00100 001100 0011100 00111100 001111100 0000000000 x000000000x ";
	public static final String SIERPINSKI=
	"00 010 0110 01110 011110 0100010 01100110 011101110 0111111110 x000000000x ";
	public static final String MITSUBISHI=
	"00 010 0110 01110 001100 0001000 01111110 011101110 0111001110 x000000000x ";
	public static final String ISLEOFMAN=
	"00 010 0110 01010 011000 0011110 01011110 010110010 0111101110 x000000000x ";
	public static final String WINGS=
	"00 010 0100 01100 011010 0111110 00011110 001110110 0111110010 x000000000x ";
	public static final String LEERESBRETT=
	"00 000 0000 00000 000000 0000000 00000000 000000000 0000000000 x000000000x ";

	public static final String ZUEGE[] = 	//alle möglichen züge
		{
		"1 ", 
		"11 ","1 1 ","1 x1 ", 
		"111 ","1 1 1 ","1 x1 xx1 ",
		"1111 ","1 1 1 1 ","1 x1 xx1 xxx1 ",
		"11111 ","1 1 1 1 1 ","1 x1 xx1 xxx1 xxxx1 ",
		"111111 ","1 1 1 1 1 1 ","1 x1 xx1 xxx1 xxxx1 xxxxx1 ",
		"1111111 ","1 1 1 1 1 1 1 ","1 x1 xx1 xxx1 xxxx1 xxxxx1 xxxxxx1 ",
		"11111111 ","1 1 1 1 1 1 1 1 ","1 x1 xx1 xxx1 xxxx1 xxxxx1 xxxxxx1 xxxxxxx1 ",
		};

	public static final String MUSTER[][] =//diverse prüfmuster mit ihren gedrehten & gespiegelten
		{
		//typ 0
		//0-3er
		{"00 010 0110 x000 ","000 0110 x010 xx00 "},
		//1-5er c
		{"00 010 0110 01010 x0000 ","0000 01110 x0010 xx010 xxx00 ","00 010 0010 01110 x0000 ",
		"0000 01010 x0110 xx010 xxx00 ","00 010 0100 01110 x0000 ","0000 01110 x0100 xx010 xxx00 "},
		//2-5er f
		{"x00 0010 01100 x00110 xxx000 ","00 0100 x0110 x0100 xx010 xxx00 ","x00 0010 0110 01010 x0000 ",
		"000 01100 x00110 xx0100 xxx00 ","00 010 0010 0110 x0010 xxx00 ","0000 01010 x0110 x0100 xx00 ",
		"0000 01010 x0110 xx0010 xxxx00 ","00 010 0100 x0110 x0100 xx00 ","0000 00110 01100 x0010 xxx00 ",
		"00 0100 x0110 x01010 xx0000 ","x00 0010 0110 x0010 xx010 xxx00 ","00 0100 00110 01100 x000 "},
		//3-8er a
		{"0000 01110 01010 01110 x0000 ","0000 01110 x01010 xx01110 xxx0000 ","00 010 0110 01010 x0110 xx010 xxx00 "},
		
		//typ A
		//4-1er
		{"00 010 x00 "},
		//5-4er b
		{"00 010 0110 x010 xx00 ","0000 0110 0110 x000 ","000 0110 x0110 xx000 "},
		//6-4er c
		{"000 0110 01010 x0000 ","0000 01010 x0110 xx000 ","000 0110 0100 x010 xx00 ",
		"000 0110 x0010 xx010 xxx00 ","00 010 0100 x0110 xx000 ","00 010 0010 0110 x000 "},
		//7-4er d
		{"x00 0010 0110 0100 x00 ","00 0100 x0110 xx0010 xxxx00 ","00 010 010 x010 x010 xx00 ",
		"00 010 x010 x010 xx010 xxx00 ","x000 00110 01100 x000 ","000 01100 x00110 xxx000 "},
		//8-6er a
		{"00 010 0110 01110 x0000 ","0000 01110 x0110 xx010 xxx00 "},
		//9-6er
		{"0000 01010 x0110 x01010 xx0000 ","x00 0010 01100 x00110 xx0100 xxx00 ","00 0100 00110 01100 x0010 xxx00 "},

		//typ B
		//10-2er
		{"000 0110 x000 ","00 010 x010 xx00 ","00 010 010 x00 "},
		//11-3er a
		{"0000 01110 x0000 ","00 010 x010 xx010 xxx00 ","00 010 010 010 x00 "}, 
		//12-3er b
		{"00 010 x010 x010 xx00 ","000 0110 0100 x00 ","000 0110 00010 xxx00 "},
		//13-4er a
		{"00000 011110 x00000 ","00 010 010 010 010 x00 ","00 010 x010 xx010 xxx010 xxxx00 "},
		//14-4er e
		{"x00 0010 01110 x0000 ","00 0100 01110 x0000 ","0000 01110 x0010 xxx00 ",
		"0000 01110 x0100 xx00 ","00 010 x010 x0110 xx000 ","00 010 010 0110 x000 ",
		"000 0110 x010 x010 xx00 ","000 0110 x010 xx010 xxx00 ","00 010 0110 0100 x00 ",
		"00 010 0110 x0010 xxx00 ","00 0100 x0110 xx010 xxx00 ","x00 0010 0110 x010 xx00 "},
		//15-4er f
		{"0000 01110 x00010 xxxx00 ","00 010 x010 xx010 xx010 xxx00 ","000 x010 0010 0110 x000 ",
		"00 01000 x01110 xx0000 ","00 010 010 x010 xx010 xxx00 ","000 0110 0100 010 x00 ",
		"0000 01110 01000 x00 ","000 0110 x0010 xxx010 xxxx00 ","00 010 x010 x010 x010 xx00 ",
		"xx00 00010 01110 x0000 ","00 010 x0100 xx0110 xxx000 ","00 010 010 010 x010 xx00 "},		
		//16-5er a
		{"000000 0111110 x000000 ","00 010 x010 xx010 xxx010 xxxx010 xxxxx00 ","00 010 010 010 010 010 x00 "},
		//17-5er b
		{"000 0110 01110 x0000 ","000 0110 x0110 xx010 xxx00 ","00 010 0110 0110 x000 ",
		"0000 01110 x0110 xx000 ","00 010 0110 x0110 xx000 ","000 0110 0010 x010 xx00 "},
		//18-5er g
		{"00000 011110 010000 x00 ","000 0110 x0010 xxx010 xxxx010 xxxxx00 ","00 010 x010 x010 x010 x010 xx00 ",
		"xxx00 000010 011110 x00000 ","00 010 x010 xx0100 xxx0110 xxxx000 ","00 010 010 010 010 x010 xx00 ",
		"00000 011110 x000010 xxxxx00 ","00 010 x010 xx010 xxx010 xxx010 xxxx00 ","x00 x010 x010 0010 0110 x000 ",
		"00 010000 x011110 xx00000 ","00 010 010 x010 xx010 xxx010 xxxx00 ","000 0110 0100 010 010 x00 "},
		//19-5er h
		{"00000 011110 x00010 xxxx00 ","00 010 x010 xx010 xx0110 xxx000 ","x00 x010 0010 0110 x010 xx00 ",
		"00 01000 011110 x00000 ","000 0110 x010 xx010 xxx010 xxxx00 ","00 010 0110 0100 010 x00 ",
		"00000 011110 01000 xx00 ","00 010 0110 x0010 xxx010 xxxx00 ","000 0110 x010 x010 x010 xx00 ",
		"xx00 00010 011110 x00000 ","00 010 x0100 xx0110 xxx010 xxxx00 ","00 010 010 010 0110 x000 "},
		//20-5er n
		{"0000 01110 010010 x00x00 ","000 0110 x0010 xxx010 xxx010 xxxx00 ","00 010 x010 0010 0110 x000 ",
		"00x00 010010 x01110 xx0000 ","00 010 010 x0100 xx0110 xxx000 ","000 0110 0100 010 x010 xx00 "},
		//21-5er o
		{"0000 01110 01100 x000 ","000 0110 x0110 xx0010 xxxx00 ","00 010 0110 x010 x010 xx00 ",
		"x000 00110 01110 x0000 ","00 0100 x0110 xx0110 xxx000 ","00 010 010 0110 x010 xx00 ",
		"0000 01110 x00110 xxx000 ","00 010 x010 x0110 xx010 xxx00 ","x00 0010 0110 0110 x000 ",
		"000 01100 x01110 xx0000 ","00 010 0110 x010 xx010 xxx00 ","000 0110 0110 0100 x00 "},
		//22-5er p
		{"00 0100 01110 x0100 xx00 ","000 0110 0110 x0010 xxx00 ","000 0110 x0110 x0100 xx00 ",
		"x00 0010 01110 x0010 xxx00 ","00 0100 x0110 x0110 xx000 ","x00 0010 0110 x0110 xx000 "},
		//23-5er q
		{"00 01000 x01110 x01000 xx00 ","x00 0010 0110 x0010 xxx010 xxxx00 ","00 0100 x0110 x0100 x010 xx00 ",
		"xx00 00010 01110 x00010 xxxx00 ","00 010 x0100 xx0110 xx0100 xxx00 ","x00 x010 0010 0110 x0010 xxx00 "},
		//24-5er r
		{"0000 01110 01000 010 x00 ","0000 01110 x00010 xxxx010 xxxxx00 ","00 010 x010 xx010 xx010 xx010 xxx00 ",
		"xx00 xx010 00010 01110 x0000 ","00 010 x01000 xx01110 xxx0000 ","00 010 010 010 x010 xx010 xxx00 "},
		//25-5er s
		{"00 01000 x01110 xx0100 xxx00 ","00 010 010 0110 x0010 xxx00 ","0000 01110 x0100 x010 xx00 ",
		"x00 0010 01110 x00010 xxxx00 ","00 0100 x0110 xx010 xx010 xxx00 ","x00 x010 0010 01110 x0000 ",
		"xx00 00010 01110 x0010 xxx00 ","00 010 x0100 x01110 xx0000 ","x00 0010 0110 x010 xx010 xxx00 ",
		"00 0100 01110 01000 x00 ","0000 01110 x0010 xxx010 xxxx00 ","00 010 x010 x0110 x0100 xx00 "},
		//26-6er g
		{"00 01000 011110 x01000 xx00 ","000 0110 0110 x0010 xxx010 xxxx00 ","000 0110 x0110 x0100 x010 xx00 ",
		"xx00 00010 011110 x00010 xxxx00 ","00 010 x0100 xx0110 xx0110 xxx000 ","x00 x010 0010 0110 x0110 xx000 "},
		//27-6er h
		{"0000 01010 011110 x00000 ","000 0110 x0100 xx0110 xxx010 xxxx00 ","00 010 0110 0100 0110 x000 ",
		"00000 011110 x01010 xx0000 ","00 010 0110 x0010 xx0110 xxx000 ","000 0110 0010 0110 x010 xx00 "},

		//typ C
		//28-5er d
		{"000 0110 01010 x0100 xx00 ","000 0110 01010 x0010 xxx00 ","000 0110 x0010 x0110 xx000 ",
		"x00 0010 01010 x0110 xx000 ","00 0100 01010 x0110 xx000 ","000 0110 0100 x0110 xx000 "},
		//29-5er e
		{"000 0110 01010 01000 x00 ","0000 01110 x00010 xxx010 xxxx00 ","00 010 x010 x0010 x0110 xx000 ",
		"xx00 00010 01010 x0110 xx000 ","00 010 01000 x01110 xx0000 ","000 0110 0100 x010 xx010 xxx00 ",
		"000 0110 01010 x00010 xxxx00 ","000 0110 x0010 xx010 xx010 xxx00 ","x00 x010 00010 01110 x0000 ",
		"00 01000 x01010 xx0110 xxx000 ","00 010 010 0100 x0110 xx000 ","0000 01110 01000 x010 xx00 "},
		//30 5er i
		{"x00 0010 0110 0100 010 x00 ","0000 011100 x000110 xxxx000 ","00 010 x010 xx010 xx010 xxx010 xxxx00 ",
		"x00 x010 0010 0110 0100 x00 ","000 011000 x001110 xxx0000 ","00 010 x010 x010 xx010 xxx010 xxxx00 ",
		"00 0100 x0110 xx0010 xxxx010 xxxxx00 ","00 010 010 x010 x010 x010 xx00 ","xx000 000110 011100 x0000 ",
		"00 010 x0100 xx0110 xxx0010 xxxxx00 ","00 010 010 010 x010 x010 xx00 ","x0000 001110 011000 x000 "},
		//31 5er j
		{"x000 00110 011010 x00000 ","00 0100 x0110 xx0010 xxx010 xxxx00 ","00 010 010 0010 0110 x000 ",
		"00000 010110 x01100 xx000 ","00 010 0100 x0110 xx0010 xxxx00 ","000 0110 0100 x010 x010 xx00 ",
		"000 01100 010110 x00000 ","000 0110 x0010 xx010 xxx010 xxxx00 ","00 010 0010 0110 0100 x00 ",
		"0000 011010 x00110 xxx000 ","00 010 x010 x0100 xx0110 xxx000 ","x00 0010 0110 0100 x010 xx00 "},		
		//32-6er d
		{"00000 01110 01110 x0000 ","000 0110 x0110 xx0110 xxx000 ","00 010 0110 0110 x010 xx00 ",
		"0000 01110 x01110 xx0000 ","00 010 0110 x0110 xx010 xxx00 ","0000 0110 0110 0110 x000 "},
		//33-6er e
		{"00 010 0110 x010 x0110 xx000 ","x000 00110 01110 x0100 xx00 ","00 0100 01110 x00110 xxx000 ",
		"000 0110 x010 x0110 xx010 xxx00 ","x00 0010 01110 01100 x000 ","000 01100 x01110 xx0010 xxxx00 "},
	
		//typ D
		//34-4er g
		{"00 0100 x0110 x0100 xx00 ","x00 0010 0110 x0010 xxx00 "},
		//35-5er k
		{"0000 01010 01110 x0000 ","000 0110 x0100 xx0110 xxx000 ","00 010 0110 0100 x010 xx00 ",
		"0000 01110 01010 x0000 ","000 0110 x0010 xx0110 xxx000 ","00 010 0010 0110 x010 xx00 ",
		"0000 01010 x01110 xx0000 ","00 010 0100 x0110 xx010 xxx00 ","000 0110 0100 0110 x000 ",
		"0000 01110 x01010 xx0000 ","00 010 0110 x0010 xx010 xxx00 ","000 0110 0010 0110 x000 "},		
		//36-5er l
		{"x00 0010 01110 x0100 xx00 ","00 0100 01110 x0010 xxx00 ","000 0110 x010 x0110 xx000 "},
		//37-5er m
		{"x00 0010 01110 01000 x00 ","000 01100 x00110 xxx010 xxxx00 ","00 010 x010 x010 x0110 xx000 ",
		"xx00 00010 01110 x0100 xx00 ","00 010 01100 x00110 xxx000 ","000 0110 x010 x010 xx010 xxx00 ",
		"00 0100 01110 x00010 xxxx00 ","000 0110 x010 xx010 xx010 xxx00 ","x00 x010 00110 01100 x000 ",
		"00 01000 x01110 xx0010 xxxx00 ","00 010 010 x010 x0110 xx000 ","x000 00110 01100 x010 xx00 "},
		//38-6er f
		{"000 0110 01010 x0110 xx000 "},
		

		//Typ E
		//39-6er b
		{"0xx 0010 0110 01010 x0100 xx00 ","000 01100 010110 x00100 xxx00 ","000 0110 x0010 x0110 xx0010 xxxx00 ",
		"x00 0010 01010 x0110 x0100 xx00 ","x00 00100 011010 x00110 xxx000 ","00 0100 x0110 x0100 xx0110 xxx000 ",
		"00 0100 x0110 x01010 xx0010 xxxx00 ","x00 0010 011 x0010 x0110 xx000 ","x00 00100 010110 x01100 xx000 ",
		"00 0100 01010 x0110 xx0010 xxxx00 ","000 0110 0100 x0110 x0100 xx00 ","x000 00110 011010 x00100 xxx00 "},
		//40-6er c
		{"x00 0010 01100 x00110 xxx0010 xxxxx00 ","00 0100 x0110 x0100 xx010 xx010 xxx00 ","xx00 x0010 00110 011010 x00000 ",
		"00 0100 x01100 xx00110 xxx0100 xxxx00 ","00 010 010 0010 0110 x0010 xxx00 ","00000 010110 x01100 x0100 xx00 ",
		"00 0100 00110 01100 0100 x00 ","00000 011010 x00110 xxx0010 xxxxx00 ","00 010 x010 x0100 xx0110 xx0100 xxx00 ",
		"xx00 x0010 00110 01100 x0010 xxx00 ","00 0100 x01100 x010110 xx00000 ","x00 0010 0110 x0010 xx010 xxx010 xxxx00 "},
		//41-7er a
		{"0000 01110 011110 x00000 ","000 0110 x0110 xx0110 xxx010 xxxx00 ","00 010 0110 0110 0110 x000 ",
		"00000 011110 x01110 xx0000 ","00 010 0110 x0110 xx0110 xxx000 ","000 0110 0110 0110 x010 xx00 "},	
		//42-7er b
		{"00 010 0110 01010 010010 x00x00 ","00000 011110 x00010 xxx010 xxx010 xxxx00 ","00 010 x010 00010 011110 x00000 ",
		"00x00 010010 x01010 xx0110 xxx010 xxxx00 ","00 010 010 01000 011110 x00000 ","00000 011110 x01000 xx010 xxx010 xxxx00 "},	
		};
	}