2 ms·
Yes. Another issue is that his grid is a square. It's hard to know whether this was sensible - author hasn't described the domain. You could address both issue
by cturner 10y ago
Yes. Another issue is that his grid is a square. It's hard to know whether this was sensible - author hasn't described the domain.
You could address both issues by having two for loops, one following the other. The first loop changes the top and bottom rows. The second loop changes the sides but not for the top and bottom cells. A comment could highlight that you're not updating the corners.