% (C)opyright Dorothee Müller
% letzte Aenderungen: Do, 12. April 2013, 17:15 (André Hilbig)
% 
% diese Datei: zauberwuerfel-automat.tex
%
% Dieses Dokument steht unter der Creative Commons by-nc-sa-Lizenz.
% Folglich darf es beliebig kopiert und bearbeitet werden,
% sofern das Folgeprodukt wiederum unter dieser Lizenz vertrieben wird.
% Eine kommerzielle Nutzung ist nicht erlaubt.
%
% Die detaillierten Lizenzbedingungen finden sich auf der Seite
% http://creativecommons.org/licenses/by-nc-sa/3.0/deed.de
%
% Automat zur Erklärung des Tricks "Zauberwürfel":
% http://ddi.uni-wuppertal.de/material/informatiktricks.html#wuerfel

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\usepackage{ccicons}

\begin{document}
	\pagestyle{empty}
	\begin{tikzpicture}[->,>=stealth,shorten >=1pt,auto,node distance=2.cm,semithick]
		\tikzstyle{kr}=[circle split,fill=red,text=white]
		\tikzstyle{kb}s=[circle split,fill=blue,text=white]
		\tikzstyle{kg}=[circle split,fill=green,text=black]

		\node[circle,fill=red,text=white] (S){START};
		\node[kr]      (1) [above right of=S] {5 \nodepart{lower} 1};
		\node[kr]      (2) [below of=1] {5 \nodepart{lower} 2};
		\node[kr]      (3) [below of=2] {1 \nodepart{lower} 3};
		\node[kr]      (4) [below of=3] {1 \nodepart{lower} 4};
		\node[kr]      (5) [below of=4] {2 \nodepart{lower} 5};
		\node[kr]      (6) [below of=5] {3 \nodepart{lower} 6};
		\node[kr]      (7) [right of=1] {3 \nodepart{lower} 7};
		\node[kr]      (8) [below of=7] {2 \nodepart{lower} 8};
		\node[kr]      (9) [below of=8] {2 \nodepart{lower} 9};
		\node[kr]      (10)[below of=9] {5 \nodepart{lower} {10}};
		\node[kr]      (11)[below of=10]{6 \nodepart{lower} {11}};
		\node[kr]      (12)[below of=11]{1 \nodepart{lower} {12}};
		\node[kr]      (13)[right of=7] {2 \nodepart{lower} {13}};
		\node[kr]      (14)[below of=13]{6 \nodepart{lower} {14}};
		\node[kr]      (15)[below of=14]{1 \nodepart{lower} {15}};
		\node[kr]      (16)[below of=15]{2 \nodepart{lower} {16}};
		\node[kr]      (17)[below of=16]{1 \nodepart{lower} {17}};
		\node[kr]      (18)[below of=17]{2 \nodepart{lower} {18}};
		\node[kr]      (19)[right of=13]{4 \nodepart{lower} {19}};
		\node[kr]      (20)[below of=19]{3 \nodepart{lower} {20}};
		\node[kr]      (21)[below of=20]{2 \nodepart{lower} {21}};
		\node[kr]      (22)[below of=21]{1 \nodepart{lower} {22}};
		\node[kr]      (23)[below of=22]{2 \nodepart{lower} {23}};
		\node[kr]      (24)[below of=23]{1 \nodepart{lower} {24}};
		
		\path (S) edge              node {1} (1)
		          edge              node {2} (2)
		          edge              node {3} (3)
		          edge              node {4} (4)
		          edge [bend right] node {5} (5)
		          edge [bend right] node {6} (6);

		\node[circle, fill=blue,text=white] (S)   {START};
		\node[kg]         (1g) [above right of=S] {5 \nodepart{lower} 1};
		\node[kg]         (2g) [below of=1] {5 \nodepart{lower} 2};
		\node[kg]         (3g) [below of=2] {1 \nodepart{lower} 3};
		\node[kg]         (4g) [below of=3] {1 \nodepart{lower} 4};
		\node[kg]         (5g) [below of=4] {2 \nodepart{lower} 5};
		\node[kg]         (6g) [below of=5] {3 \nodepart{lower} 6};
		
		\path (1) edge   [bend left]           node {5} (6);
		\node[kb]         (1g) [above right of=S] {5 \nodepart{lower} 1};
		
		\path (2) edge              node {5} (7);
		\node[kb]         (2g) [below of=1] {5 \nodepart{lower} 2};
		\node[kg]         (7g) [ right of=1] {3 \nodepart{lower} 7};
		
		\path (3) edge              node {1} (4);
		\node[kb]         (3g) [below of=2] {1 \nodepart{lower} 3};
		
		\path (4) edge              node {1} (5);  
		\node[kb]         (4g) [below of=3] {1 \nodepart{lower} 4};
		
		\path (5) edge              node {1} (7);  
		\node[kb]         (5g) [below of=4] {2 \nodepart{lower} 5};
		
		\path (6) edge              node {3} (9);  
		\node[kb]         (6g) [below of=5] {3 \nodepart{lower} 6};
		\node[kg]       (9g) [below of=8] {2 \nodepart{lower} {9}};
		
		\path (7) edge   [bend left]           node {3} (10); 
		\node[kb]         (7g) [ right of=1] {3 \nodepart{lower} 7};
		\node[kg]       (10g) [below of=9] {5 \nodepart{lower} {10}};
		
		\path (9) edge   [bend left]             node {2} (11);
		\node[kb]       (9g) [below of=8] {2 \nodepart{lower} {9}};
		\node[kg]       (11g) [below of=10] {6 \nodepart{lower} {11}}; 
		
		\path (10) edge              node {5} (15); 
		\node[kb]       (10g) [below of=9] {5 \nodepart{lower} {10}};;
		\node[kg]       (15g) [below of=14] {1 \nodepart{lower} {15}};
		
		\path (11) edge              node {6} (17);
		\node[kb]       (11g) [below of=10] {6 \nodepart{lower} {11}}; 
		\node[kg]       (17g) [below of=16] {1 \nodepart{lower} {17	}};
		
		\path (15) edge   [bend left]           node {1} (16);  
		\node[kb]       (15g) [below of=14] {1 \nodepart{lower} {15}};
		\node[kg]       (16g) [below of=15] {2 \nodepart{lower} {16}};
		
		\path (16) edge       [bend left]        node {2} (18); 
		\node[kb]       (16g) [below of=15] {2 \nodepart{lower} {16}};
		\node[kg]       (18g) [below of=17] {2 \nodepart{lower} {18}};
		
		\path (17) edge              node {1} (18);  
		\node[kb]       (17g) [below of=16] {1 \nodepart{lower} {17}};
		\node[circle split, fill=yellow,text=black,draw=black ]       (18y) [below of=17] {2 \nodepart{lower} {18}};
		
		\path (18y) edge              node {2} (20);
		\node[circle split, fill=yellow,text=black,draw=black ]       (20y) [below of=19] {3 \nodepart{lower} {20}};
		
		\path (20y) edge  [bend left] node {2} (23);
		\node[circle split, fill=yellow,text=black,draw=black]       (23y) [below of=22] {2 \nodepart{lower} {23}};
	\end{tikzpicture}
		\ccbyncsaeu{}
\end{document}
