Skip to content

Instantly share code, notes, and snippets.

@jmeirow
Created April 14, 2016 02:28
Show Gist options
  • Save jmeirow/6a3be47b85a9a8bf91e1125d3605acd2 to your computer and use it in GitHub Desktop.
Save jmeirow/6a3be47b85a9a8bf91e1125d3605acd2 to your computer and use it in GitHub Desktop.
Improvement to Greatest Product
// original "seed" code.
public void ComputePoints()
{
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 20; y++)
{
points.Add(new Point { x = x, y = y });
}
}
}
// modified "seed" code. Skip every other point.
public void ComputePoints()
{
for (int x = 0; x < 20; x+=2 )
{
for (int y = 0; y < 20; y+=2 )
{
points.Add(new Point { x = x, y = y });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment