Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{tikz}\usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}\definecolor{fillcolor}{rgb}{0.008, 0.753, 0.353} %rgb(2, 192, 90)\definecolor{drawcolor}{rgb}{0, 0.376, 0.173} %rgb(0, 96, 44)\begin{document}\pagestyle{empty}\begin{tikzpicture}\tikzstyle{greenfill} = [fill=fillcolor!20, draw=drawcolor]\tikzstyle{whitefill} = [fill=white, draw=drawcolor]\filldraw[greenfill] (0,0) -- (1,0) -- (1,1) -- (0, 1) -- cycle;\def\flag{0}\foreach \x in {0, 1, 2, 3} {\foreach \y in {0, 1, 2, 3} {\ifnum \flag =0 {\filldraw[greenfill] (\x, \y) -- (\x +1, \y) -- (\x +1, \y +1) -- (\x, \y +1) -- cycle;\def\flag{1};}\else {\filldraw[whitefill] (\x, \y) -- (\x +1, \y) -- (\x +1, \y +1) -- (\x, \y +1) -- cycle;\def\flag{0};}\fi}}\end{tikzpicture}\end{document}
how to modify?