-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discord gen 2 now generates as https://discordapp.com/gifts/CODE_HERE
- Loading branch information
1 parent
2c99e23
commit 3b85ba2
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <iostream> | ||
#include <cstdlib> | ||
#include <ctime> | ||
#include <conio.h> | ||
#include <fstream> | ||
using namespace std; | ||
ofstream fout ("codes.txt"); | ||
string author="github.com/ChillSheep"; | ||
//Checks if a file exists | ||
int main() { | ||
srand(time(NULL)); | ||
//do not use ios_base::sync_with_stdio(false), fout.tie(NULL); | ||
char all[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; //62 | ||
long long int nr_of_codes; | ||
unsigned int codes_length; | ||
codes_length=16; | ||
char actualformat[codes_length]; | ||
for (int i=0; i<codes_length; i++) | ||
actualformat[i]='A'; | ||
nrofcodes: | ||
cout<<"How many codes to generate?\n"; | ||
cin>>nr_of_codes; | ||
if(nr_of_codes<=0) { | ||
cout<<"The number of codes should be greater than 0.\n"; | ||
goto nrofcodes; } | ||
|
||
unsigned short random_all = rand() % 62; | ||
for (int j=0; j<nr_of_codes; j++) { | ||
// printf("\rIn progress %d", j/divider); | ||
// fflush(stdout); | ||
fout<<"https://discordapp.com/gifts/"; | ||
for (int character=0; character<codes_length; character++) { | ||
fout<<all[random_all]; | ||
random_all = rand() % 62; | ||
} | ||
fout<<'\n'; | ||
} | ||
cout<<"\nDone!\n"; | ||
|
||
cout<<"Press any key to exit the program."<<endl; | ||
getch(); | ||
} |