Created
April 14, 2016 02:28
-
-
Save jmeirow/6a3be47b85a9a8bf91e1125d3605acd2 to your computer and use it in GitHub Desktop.
Improvement to Greatest Product
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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