SHOW:
|
|
- or go back to the newest paste.
| 1 | - | /* ManRNG - a cross-platform command-line RNG generator for Pokémon games |
| 1 | + | /* ManRNG - a cross-platform command-line RNG generator for Pokémon games |
| 2 | - | (c) M.andrew 2012 |
| 2 | + | (c) M.andrew 2012 |
| 3 | - | |
| 3 | + | |
| 4 | - | This utility provides the user with access to the full range of RNG |
| 4 | + | This utility provides the user with access to the full range of RNG |
| 5 | - | operations available in the popular Pokémon series of games, allowing |
| 5 | + | operations available in the popular Pokémon series of games, allowing |
| 6 | - | him to find shiny and/or flawless Pokémon no matter what type of computer |
| 6 | + | him to find shiny and/or flawless Pokémon no matter what type of computer |
| 7 | - | he is using. By default, positive results are send to stdout in CSV format, |
| 7 | + | he is using. By default, positive results are send to stdout in CSV format, |
| 8 | - | allowing them to be easily piped into bash text manipulation utilities |
| 8 | + | allowing them to be easily piped into bash text manipulation utilities |
| 9 | - | or simply saved directly into text files. |
| 9 | + | or simply saved directly into text files. |
| 10 | - | |
| 10 | + | |
| 11 | - | The ultimate goal of this program is to match the seed-generation capabilities |
| 11 | + | The ultimate goal of this program is to match the seed-generation capabilities |
| 12 | - | of the widely-known RNG Reporter utility for Windows while supporting all |
| 12 | + | of the widely-known RNG Reporter utility for Windows while supporting all |
| 13 | - | of its major file formats, including the XML profiles of the alpha-stage |
| 13 | + | of its major file formats, including the XML profiles of the alpha-stage |
| 14 | - | RNGR 9.96. Once this goal is realized and a standarized format for args |
| 14 | + | RNGR 9.96. Once this goal is realized and a standarized format for args |
| 15 | - | is set in place, I foresee writing frontends for the program to improve |
| 15 | + | is set in place, I foresee writing frontends for the program to improve |
| 16 | - | its ease of use for the public. |
| 16 | + | its ease of use for the public. |
| 17 | - | */ |
| 17 | + | */ |
| 18 | - | #include <stdio.h> |
| 18 | + | #include <stdio.h> |
| 19 | - | |
| 19 | + | #include <cstdlib> |
| 20 | - | char RNGMethodHandler(int Generation, char* Method) |
| 20 | + | char RNGMethodHandler(int Generation, char Method) |
| 21 | - | { |
| 21 | + | {
|
| 22 | - | switch (Generation) |
| 22 | + | switch (Generation) |
| 23 | - | { |
| 23 | + | {
|
| 24 | - | case 3: |
| 24 | + | case 3: |
| 25 | - | // options supported: |
| 25 | + | // options supported: |
| 26 | - | // -t [--timefinder] |
| 26 | + | // -t [--timefinder] |
| 27 | - | // -p [--pandora] |
| 27 | + | // -p [--pandora] |
| 28 | - | if (Method[1] == "-") |
| 28 | + | if (Method[1] == "-") |
| 29 | - | { |
| 29 | + | {
|
| 30 | - | // long options |
| 30 | + | // long options |
| 31 | - | } |
| 31 | + | } |
| 32 | - | else |
| 32 | + | else |
| 33 | - | { |
| 33 | + | {
|
| 34 | - | // short options |
| 34 | + | // short options |
| 35 | - | } |
| 35 | + | } |
| 36 | - | break; |
| 36 | + | break; |
| 37 | - | case 4: |
| 37 | + | case 4: |
| 38 | - | // options supported: |
| 38 | + | // options supported: |
| 39 | - | // -t [--timefinder] |
| 39 | + | // -t [--timefinder] |
| 40 | - | // -v [--pidfromivs] |
| 40 | + | // -v [--pidfromivs] |
| 41 | - | // -c [--chainsidfinder] |
| 41 | + | // -c [--chainsidfinder] |
| 42 | - | // -m [--seed2time] |
| 42 | + | // -m [--seed2time] |
| 43 | - | // -p [--pandora] |
| 43 | + | // -p [--pandora] |
| 44 | - | if (Method[1] == "-") |
| 44 | + | if (Method[1] == "-") |
| 45 | - | { |
| 45 | + | {
|
| 46 | - | // long options |
| 46 | + | // long options |
| 47 | - | } |
| 47 | + | } |
| 48 | - | else |
| 48 | + | else |
| 49 | - | { |
| 49 | + | {
|
| 50 | - | // short options |
| 50 | + | // short options |
| 51 | - | } |
| 51 | + | } |
| 52 | - | break; |
| 52 | + | break; |
| 53 | - | case 5: |
| 53 | + | case 5: |
| 54 | - | // options supported: |
| 54 | + | // options supported: |
| 55 | - | // -t [--timefinder] |
| 55 | + | // -t [--timefinder] |
| 56 | - | // -r [--parameters] |
| 56 | + | // -r [--parameters] |
| 57 | - | // -m [--seed2time] (c-gear) |
| 57 | + | // -m [--seed2time] (c-gear) |
| 58 | - | // -p [--pandora] |
| 58 | + | // -p [--pandora] |
| 59 | - | if (Method[1] == "-") |
| 59 | + | if (Method[1] == "-") |
| 60 | - | { |
| 60 | + | {
|
| 61 | - | // long options |
| 61 | + | // long options |
| 62 | - | } |
| 62 | + | } |
| 63 | - | else |
| 63 | + | else |
| 64 | - | { |
| 64 | + | {
|
| 65 | - | // short options |
| 65 | + | // short options |
| 66 | - | } |
| 66 | + | } |
| 67 | - | break; |
| 67 | + | break; |
| 68 | - | } |
| 68 | + | } |
| 69 | return 0; | |
| 70 | - | |
| 70 | + | } |
| 71 | - | int main(int argc, char* argv[]) |
| 71 | + | |
| 72 | - | { |
| 72 | + | int main(int argc, char* argv[]) |
| 73 | - | char GenFlag = argv[1][1]; //this should be a 3, 4, or 5 |
| 73 | + | {
|
| 74 | - | char MethodSearch; |
| 74 | + | char GenFlag = argv[1][1]; //this should be a 3, 4, or 5 |
| 75 | - | if (GenFlag == "3" || GenFlag == "4" || GenFlag == "5") |
| 75 | + | char MethodSearch; |
| 76 | - | { |
| 76 | + | if (GenFlag == '3' || GenFlag == '4' || GenFlag == '5') |
| 77 | - | MethodSearch = argv[2]; |
| 77 | + | {
|
| 78 | - | if (MethodSearch == "") |
| 78 | + | MethodSearch = *argv[2]; |
| 79 | - | { |
| 79 | + | if (MethodSearch == "") |
| 80 | - | fprintf("stderr","ManRNG requires a method as its second argument."); |
| 80 | + | {
|
| 81 | - | } |
| 81 | + | fprintf(stderr,"ManRNG requires a method as its second argument."); |
| 82 | - | RNGMethodHandler(atoi(GenFlag),MethodSearch); |
| 82 | + | } |
| 83 | - | } |
| 83 | + | RNGMethodHandler(atoi(GenFlag),MethodSearch); |
| 84 | - | else if (GenFlag = "r") |
| 84 | + | } |
| 85 | - | { |
| 85 | + | else if (GenFlag = "r") |
| 86 | - | Researcher(); |
| 86 | + | {
|
| 87 | - | } |
| 87 | + | Researcher(); |
| 88 | - | else |
| 88 | + | } |
| 89 | - | { |
| 89 | + | else |
| 90 | - | fprintf("stderr","ManRNG requires -3, -4, -5, or -r as its first argument."); |
| 90 | + | {
|
| 91 | - | exit(1); |
| 91 | + | fprintf(stderr,"ManRNG requires -3, -4, -5, or -r as its first argument."); |
| 92 | - | } |
| 92 | + | exit(1); |
| 93 | } | |
| 94 | } |