Parametric brick wall with grasshopper

Hi there,
i was wondering how could i make a grasshopper script similar to this python code.

This is the link of the site were i found this idea:

I will also attach an image of the wall,