The array part wouldn't be too hard, but you kinda need to know all the rules first.
Like piece movement, do they slide, or do you pick them up, etc. Then there's the rules for deciding if something is adjacent to another.
BTW the card game object might work for this as well.