<mosaic.cnfolio.com>
PROGRAM
  1. /*  Pseudo Code Main Calculations.
  2. START
  3.    Read number of Pidgey inputted
  4.    Read number of candies inputted
  5.    
  6.    IF number of pidgeys is =< 0 THEN
  7.       PRINT Not enough Pidgey
  8.    ENDIF
  9.    
  10.    WHILE number of Pidgey is > 0 THEN
  11.       IF number of candy > 11 THEN
  12.          Take away 12 candey AND take away 1 pidgey THEN
  13.          Exp = Exp + 1000
  14.          Give 1 candy back
  15.       ENDIF
  16.       ELSEIF
  17.          PRINT Not enough candies
  18.    ENDWHILE
  19.    PRINT Current Amount of Exp
  20.  
  21. END */
  22.  
  23. /* Pseudo Code 2 /w Extra Features
  24. START
  25.    Choice = 0
  26.    noPokemon = 0
  27.    noCandy = 0
  28.    EXP = 0
  29.    
  30.    PRINT Choose what Pokemon you wish to calculate 1 = Pidgy, 2 = Magnemite, 3 = Charmander
  31.    INPUT Choice
  32.    INPUT noPokemon
  33.    INPUT noCandy
  34.    
  35.    IF Choice == 0
  36.       PRINT Invalid Choice
  37.    ENDIF
  38.    
  39.    IF Choice == 1 THEN
  40.       PRINT Calculating for Pidgy
  41.    
  42.       IF noPokemon <= 0
  43.          PRINT Not enough Pidgy Pokemon
  44.       ENDIF
  45.      
  46.       IF noCandy <= 11 THEN
  47.          PRINT Not enough candies
  48.       ENDIF
  49.      
  50.       WHILE noPokemon > 0 THEN
  51.          IF noCandy >= 12
  52.             Take away 12 candy AND Take away 1 Pokemon
  53.             EXP = EXP + 1000
  54.             Give 1 candy back
  55.             Candy = Candy + 1
  56.          ENDIF
  57.       ENDWHILE
  58.    
  59.    
  60.       PRINT EXP gained with Lucky Egg bonus
  61.       PRINT noPokemon left
  62.       PRINT noCandy left
  63.    ENDIF
  64.    
  65.    IF Choice == 2
  66.       PRINT Calculating for Magnemite
  67.    
  68.       IF noPokemon <= 0
  69.          PRINT Not enough Magnemite Pokemon
  70.       ENDIF
  71.      
  72.       IF noCandy <= 50 THEN
  73.          PRINT Not enough candies
  74.       ENDIF
  75.      
  76.       WHILE noPokemon > 0 THEN
  77.          IF noCandy >= 50
  78.             Take away 50 candy AND Take away 1 Pokemon
  79.             EXP = EXP + 1000
  80.             Give 1 candy back
  81.             Candy = Candy + 1
  82.          ENDIF
  83.       ENDWHILE
  84.      
  85.       PRINT EXP gained with Lucky Egg bonus
  86.       PRINT noPokemon left
  87.       PRINT noCandy left
  88.    ENDIF
  89.    
  90.    IF Choice == 3
  91.       PRINT Calculating for Charmander
  92.    
  93.       IF noPokemon <= 0
  94.          PRINT Not enough Charmander Pokemon
  95.       ENDIF
  96.      
  97.       IF noCandy <= 25 THEN
  98.          PRINT Not enough candies
  99.       ENDIF
  100.      
  101.       WHILE noPokemon > 0 THEN
  102.          IF noCandy >= 25
  103.             Take away 25 candy AND Take away 1 Pokemon
  104.             EXP = EXP + 1000
  105.             Give 1 candy back
  106.             Candy = Candy + 1
  107.          ENDIF
  108.       ENDWHILE
  109.      
  110.       PRINT EXP gained with Lucky Egg bonus
  111.       PRINT noPokemon left
  112.       PRINT noCandy left
  113.    ENDIF
  114.  
  115. END
  116.  
  117. */
  118.  
  119. #include <stdio.h>
  120.  
  121. int main(void)
  122. {
  123.  
  124.    int nopidg, nocandi;
  125.    int exp, choice;
  126.    exp = 0;
  127.    choice = 0;
  128.    nopidg = 0;
  129.    nocandi = 0;
  130.    
  131.    printf("Enter number for pokemon you want to calculate. 1 = Pidgy, 2 = Magnemite, 3 = Charmander.\n");
  132.    scanf("%d %d %d", &choice ,&nopidg, &nocandi);
  133.    
  134.    if (choice == 0)
  135.       {
  136.       printf("No choice taken.");
  137.       }
  138.    
  139.    if (choice == 1)
  140.     {
  141.     printf("Calculation for Pidgy\n");
  142.     if (nopidg <= 0)
  143.         printf("No Pokemon inputted.\n");
  144.        
  145.        
  146.     if (nocandi < 11)
  147.         printf("Not enough candy.\n");
  148.        
  149.      while (nocandi >= 12){
  150.         nocandi = nocandi - 11;
  151.         if (nopidg >= 1){
  152.            nopidg--;
  153.            exp += 1000; }
  154.          }
  155.       printf("You have gained this amount of exp with a lucky egg: %d\n", exp);
  156.       printf("Amount of Pokemon remaining: %d\n", nopidg);
  157.       printf("Amount of candies left: %d\n", nocandi);
  158.  
  159.       }
  160.    if(choice == 2) 
  161.     {
  162.     printf("Calculation for Magnemite.\n");
  163.       if (nopidg <= 0)
  164.           printf("No Pokemon inputted.\n");
  165.          
  166.          
  167.       if (nocandi < 50)
  168.           printf("Not enough candy.\n");
  169.          
  170.        while (nocandi >= 50){
  171.           nocandi = nocandi - 49;
  172.           if (nopidg >= 1){
  173.              nopidg--;
  174.              exp += 1000; }
  175.            }
  176.          printf("You have gained this amount of exp with a lucky egg: %d\n", exp);
  177.          printf("Amount of Pokemon remaining: %d\n", nopidg);
  178.      printf("Amount of candies left: %d\n", nocandi);
  179.  
  180.           }
  181.          
  182.    if(choice == 3)
  183.      {
  184.      printf("Calculation for Charmander.\n");
  185.      if (nopidg <= 0)
  186.           printf("No Pokemon inputted.\n");
  187.          
  188.          
  189.      if (nocandi < 25)
  190.           printf("Not enough candy.\n");
  191.          
  192.        while (nocandi >= 25){
  193.           nocandi = nocandi - 24;
  194.           if (nopidg >= 1){
  195.              nopidg--;
  196.              exp += 1000; }
  197.            }
  198.          printf("You have gained this amount of exp with a lucky egg: %d\n", exp);
  199.          printf("Amount of Pokemon remaining: %d\n", nopidg);
  200.          printf("Amount of candies left: %d\n", nocandi);
  201.  
  202.           }
  203.  
  204.    
  205. }