Skip to content

Instantly share code, notes, and snippets.

@christmoore
Last active August 29, 2015 14:24
Show Gist options
  • Save christmoore/9eb6c31a43fa18030602 to your computer and use it in GitHub Desktop.
Save christmoore/9eb6c31a43fa18030602 to your computer and use it in GitHub Desktop.
int hero_pos = 0;
int one = rand()% 9 + 1;
int two = rand() % 9 + 1;
int three = rand() % 9 + 1;
while (one == two || one == three || two == three)
{
one = rand()% 9 + 1;
two = rand() % 9 + 1;
three = rand() % 9 + 1;
}
int numbers[3] = {one, two, three};
int temp;
for (int i = 0; i < 2; i++)
{
for (int j = 1; j < 3; j++)
{
if (numbers[j] <= numbers[i])
{
temp = numbers[i];
numbers[i] = numbers[j];
numbers[j] = temp;
}
}
}
road[hero_pos] = 10
for(int i = 1; i < 9; i++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment