Skip to content

Instantly share code, notes, and snippets.

@tomeaton17
Created March 6, 2019 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomeaton17/62c748f3d9e73288985fad400a1ae634 to your computer and use it in GitHub Desktop.
Save tomeaton17/62c748f3d9e73288985fad400a1ae634 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main (void) {
srand(time(NULL));
int currentPosition[2] = {0,0};
int startRow = rand() / (RAND_MAX / (9 + 1) + 1);
int startColumn = rand() / (RAND_MAX / (9 + 1) + 1);
currentPosition[0] = startRow;
currentPosition[1] = startColumn;
printf("[%d,%d]", currentPosition[0], currentPosition[1]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment