Implementing a pallet pattern with just robot programming is usually done with nested while loops and counters. Define a reference coordinate (base) and then move that base with each iteration.