Created
May 31, 2018 23:43
-
-
Save Slattz/0a78de1237dfa7dda2dc3f94bae9db0d to your computer and use it in GitHub Desktop.
Code to generate an ACNL Player ID
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
//#include <stdio.h> | |
#include <time.h> //time | |
#include <stdlib.h> //rand & srand | |
#include <stdint.h> | |
int GeneratePlayerID(void) | |
{ | |
time_t t; | |
srand(time(&t)); | |
uint16_t PID = ((rand() % 0x8000 + 1) | 0x8000); | |
// printf("PID: 0x%04X\n", PID); | |
return PID; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment