Skip to content

Instantly share code, notes, and snippets.

@Slattz
Created May 31, 2018 23:43
Show Gist options
  • Save Slattz/0a78de1237dfa7dda2dc3f94bae9db0d to your computer and use it in GitHub Desktop.
Save Slattz/0a78de1237dfa7dda2dc3f94bae9db0d to your computer and use it in GitHub Desktop.
Code to generate an ACNL Player ID
//#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