9 solutions[#solutions+1]=qsave
14 if ((q[i]==j or math.abs(q[i]-j)==math.abs(r-i)) and r>1) then
34 -- on envoie tout à TeX
35 tex.print("Il y a "..#solutions.." solutions pour N="..N.."\\dots\\par")
36 tex.print("\\begin{tikzpicture}\\draw (0,0) grid ("..N..","..N..");")
39 if ((i%2 == 0) and (j%2==1)) or ((i%2 == 1) and (j%2==0)) then
40 tex.print("\\fill[black!20] ("..(i-1)..","..(j-1)..") rectangle ("..i..","..j..");")
43 tex.print("\\node[scale=2] at("..(i-0.5)..","..(j-0.5)..") {\\wD};")
48 tex.print("\\end{tikzpicture}")