what are “?” and “:” for in front of Math.?
I didn’t write that part so I am not used with the notatiob. It must be Linq notation that replaced if then. So one line instead if 7 lines.
1 Like
The ternary operator ‘a ? b : c’ is a convenient way of writing a conditional in one line
(it’s standard in C#, doesn’t need LINQ)
2 Likes
Someone code a 3d version.
Could you help me explain what is condition in the code? is for get a float number?
if(Math.Abs(end.X - start.X) > Math.Abs(end.Y - start.Y))
{
count = Math.Abs(i1 - i0);
}
else
{
count = Math.Abs(j1 - j0);
}
1 Like