# Setting initial conditions of a domain grid?

So I'm writing some code to try and produce a cellular automaton which will model an oscillatory chemical reaction, but I'm trying to set up the initial conditions of the grid so that I can vary them to see how they change the behavior.

Basically my method has been to use Table to generate a series of nested lists which give the x and y coordinates of the bottom left corner of a grid square, and also attached to those coordinates is a value which can run from 0 to some integer - it is this number that I will be updating to make the automaton evolve. So I essentially have a list that looks like;

{{0,0,0},{1,0,0},{2,0,0}...{0,3,0},{1,3,0}...{n,n,0}}


But what I want to do is to specify a list of initial conditions, so that the initial domain might look something more like;

{{0,0,7},{1,0,3}...{2,3,9},{3,3,0},{4,3,2}...{n,n,3}}


Just for argument's sake.

I've tried a few different ways of doing this - using replacement rules and whatnot, but none of it has worked. Does anybody have any suggestions?

Here are two more ways.

lst = {{0, 0}, {1, 0}, {2, 0}};
init = {7, 3, 9};
MapThread[{#1[[1]], #1[[2]], #2} &, {lst, init}]


and

helper[{a_, b_}, c_] := {a, b, c}


Both produce

{{0, 0, 7}, {1, 0, 3}, {2, 0, 9}}

P.S. Just for fun and as my entry into this month's obfuscated Mathematica contest:

Inner[Append, Hold @@ lst, Hold @@ init, List]

• I like "...obfuscated Mathematica contest..." : Append @@@ Transpose[{st, init}] is my entry (late comer handicap though)...apolpgies if it is already somewhere Commented Feb 24, 2016 at 6:24

There are many ways to do this. For instance,

lst = {{0, 0}, {1, 0}, {2, 0}};
init = {7, 3, 9};

lst1 = {{0, 0, 0}, {1, 0, 0}, {2, 0, 0}};