Jelly cube simulation_C++