SHARE
TWEET

Neunerschiebepuzzle Latex [FIX?]

a guest Jun 18th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \usepackage{tikz}
  2.  
  3. \newcommand{\puzzle}[9]{
  4.    \begin{tikzpicture}[scale=0.8]
  5.    \draw (0,0) rectangle (3,3);
  6.    \ifnum#7>0
  7.    \filldraw[black!30!white,draw=black] (0+.1,0+.1) rectangle (0+1-.1,0+1-.1);
  8.    \draw (0.5,0.5) node{#7};
  9.    \fi
  10.    \ifnum#8>0
  11.    \filldraw[black!30!white,draw=black] (1+.1,0+.1) rectangle (1+1-.1,0+1-.1);
  12.    \draw (1.5,0.5) node{#8};
  13.    \fi
  14.    \ifnum#9>0
  15.    \filldraw[black!30!white,draw=black] (2+.1,0+.1) rectangle (2+1-.1,0+1-.1);
  16.    \draw (2.5,0.5) node{#9};
  17.    \fi
  18.    \ifnum#4>0
  19.    \filldraw[black!30!white,draw=black] (0+.1,1+.1) rectangle (0+1-.1,1+1-.1);
  20.    \draw (0.5,1.5) node{#4};
  21.    \fi
  22.    \ifnum#5>0
  23.    \filldraw[black!30!white,draw=black] (1+.1,1+.1) rectangle (1+1-.1,1+1-.1);
  24.    \draw (1.5,1.5) node{#5};
  25.    \fi
  26.    \ifnum#6>0
  27.    \filldraw[black!30!white,draw=black] (2+.1,1+.1) rectangle (2+1-.1,1+1-.1);
  28.    \draw (2.5,1.5) node{#6};
  29.    \fi
  30.    \ifnum#1>0
  31.    \filldraw[black!30!white,draw=black] (0+.1,2+.1) rectangle (0+1-.1,2+1-.1);
  32.    \draw (0.5,2.5) node{#1};
  33.    \fi
  34.    \ifnum#2>0
  35.    \filldraw[black!30!white,draw=black] (1+.1,2+.1) rectangle (1+1-.1,2+1-.1);
  36.    \draw (1.5,2.5) node{#2};
  37.    \fi
  38.    \ifnum#3>0
  39.    \filldraw[black!30!white,draw=black] (2+.1,2+.1) rectangle (2+1-.1,2+1-.1);
  40.    \draw (2.5,2.5) node{#3};
  41.    \fi
  42.    
  43.   \end{tikzpicture}
  44. }
  45.  
  46. % 1 2 3
  47. % 4 5 6
  48. % 7 8 9
  49. % In das leere Feld 0 eintragen
  50. \puzzle{1}{2}{3}{0}{4}{5}{7}{8}{6}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top