cpp-tutorial grid model with Potts