I’m learning how to program using Xojo code that I inherited. Given a checkerboard of two colors, I want to flip one color, say the colors on the squares where the columns and rows are all even-valued or all odd-valued, if that makes sense. How do I do that? What am I doing wrong? I wrote the following but it doesn’t work. In fact, the program freezes when I use it.
In case it would be helpful to see the whole code: https://www.dropbox.com/s/2rneozqhtijoc7v/MyApp.xojo_binary_project
Dim k, n as Integer
for i = 0 to size-1
for j = 0 to size-1
if i/2 = k and j/2 = n then
if thisS = 1 then
GraphicsWindow.Graphics.ForeColor = DownColor
else
GraphicsWindow.Graphics.ForeColor = UpColor
end if
elseif i/2 <> k and j/2 <> n then
if thisS = 1 then
GraphicsWindow.Graphics.ForeColor = DownColor
else
GraphicsWindow.Graphics.ForeColor = UpColor
end if
end if
next
next