<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2.  
  3. PSUEDO CODE
  4.  
  5. START
  6.     SCAN for Inputs
  7.  
  8.     IF (Player 1 has too many cards)
  9.         DISPLAY (Player 1 has too many cards)
  10.     END IF
  11.  
  12.     IF (Player 1 has too few cards)
  13.         DISPLAY (Player 1 has too few cards)
  14.     END IF
  15.  
  16.     IF (Player 2 has too many cards)
  17.         DISPLAY (Player 1 has too many cards)
  18.     END IF
  19.  
  20.     IF (Player 2 has too few cards)
  21.         DISPLAY (Player 1 has too few cards)
  22.     END IF
  23.  
  24.     IF (Player 1 has cards too high)
  25.         DISPLAY (Player 1 has too many cards)
  26.     END IF
  27.  
  28.     IF (Player 1 has cards too low)
  29.         DISPLAY (Player 1 has too few cards)
  30.     END IF
  31.  
  32.     IF (Player 2 has cards too high)
  33.         DISPLAY (Player 1 has too many cards)
  34.     END IF
  35.  
  36.     IF (Player 2 cards too low)
  37.         DISPLAY (Player 1 has too few cards)
  38.     END IF
  39.  
  40.     BUBBLESORT Player 1 cards from Highest to Lowest
  41.  
  42.     BUBBLESORT Player 2 cards from Highest to Lowest
  43.  
  44.     IF (Player1 Card1 > Player2 Card1)
  45.         DISPLAY (Player1 Wins)
  46.         GOTO END
  47.     END IF
  48.  
  49.     IF (Player1 Card1 < Player2 Card1)
  50.         DISPLAY (Player2 Wins)
  51.         GOTO END
  52.     END IF
  53.  
  54.     IF (Player1 Card1 = Player2 Card1)
  55.         next = 1
  56.     END IF
  57.  
  58.     IF (next = 1)
  59.         next = 0
  60.     IF (Player1 Card2 > Player2 Card2)
  61.         DISPLAY (Player1 Wins)
  62.         GOTO END
  63.     END IF
  64.  
  65.     IF (Player1 Card2 < Player2 Card2)
  66.         DISPLAY (Player2 Wins)
  67.         GOTO END
  68.     END IF
  69.  
  70.     IF (Player1 Card2 = Player2 Card2)
  71.         next = 1
  72.     END IF
  73.  
  74.     (CARRY ON THROUGH CARD 10)
  75.  
  76.     IF (Player1 Card10 = Player2 Card10)
  77.         DISPLAY (Draw)
  78.  
  79. END
  80.  
  81. */
  82.  
  83.  
  84. #include <stdio.h>
  85.  
  86. /* Add integers  */
  87.  
  88. int p1num,p2num; /* Add integers for the number of cards held by each player */
  89. int p,q,digit1,digit2,unit1,unit2,swap,error,winner, next; /* Add integers for the use within the code */
  90. int p1c01,p1c02,p1c03,p1c04,p1c05,p1c06,p1c07,p1c08,p1c09,p1c10; /* Add integers for the player 1 cards */
  91. int p2c01,p2c02,p2c03,p2c04,p2c05,p2c06,p2c07,p2c08,p2c09,p2c10; /* Add integers for the player 2 cards */
  92.  
  93.  
  94.  
  95. void errors (void) /* Subroutine for the possible errors */
  96. {
  97.     if (p1num > 10) /* If more than 10 is entered, error message will be displayed */
  98.     {
  99.         printf("Error - Player 1 has too many cards \n");
  100.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  101.     }
  102.    
  103.     if (p1num < 2) /* If less than 10 is entered, error message will be displayed */
  104.     {
  105.         printf("Error - Player 1 has too few cards \n");
  106.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  107.     }
  108.    
  109.     if (p2num > 10) /* If more than 10 is entered, error message will be displayed */
  110.     {
  111.         printf("Error - Player 2 has too many cards \n");
  112.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  113.     }
  114.    
  115.     if (p2num < 2) /* If less than 10 is entered, error message will be displayed */
  116.     {
  117.         printf("Error - Player 2 has too few cards \n");
  118.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  119.     }
  120.    
  121.     if (p1c01 > 10) /*  */
  122.     {
  123.         printf("Error - Player 1 Card 1 (Too Large) \n");
  124.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  125.     }
  126.    
  127.     if (p1c01 < 0) /*  */
  128.     {
  129.         printf("Error - Player 1 Card 1 (Too Small) \n");
  130.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  131.     }
  132.    
  133.     if (p2c01 > 10) /*  */
  134.     {
  135.         printf("Error - Player 2 Card 1 (Too Large) \n");
  136.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  137.     }
  138.    
  139.     if (p2c01 < 0) /*  */
  140.     {
  141.         printf("Error - Player 2 Card 1 (Too Small) \n");
  142.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  143.     }
  144.    
  145.     if (p1c02 > 10) /*  */
  146.     {
  147.         printf("Error - Player 1 Card 2 (Too Large) \n");
  148.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  149.     }
  150.    
  151.     if (p1c02 < 0) /*  */
  152.     {
  153.         printf("Error - Player 1 Card 2 (Too Small) \n");
  154.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  155.     }
  156.    
  157.     if (p2c02 > 10) /*  */
  158.     {
  159.         printf("Error - Player 2 Card 2 (Too Large) \n");
  160.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  161.     }
  162.    
  163.     if (p2c02 < 0) /*  */
  164.     {
  165.         printf("Error - Player 2 Card 2 (Too Small) \n");
  166.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  167.     }
  168.    
  169.     if (p1c03 > 10) /*  */
  170.     {
  171.         printf("Error - Player 1 Card 3 (Too Large) \n");
  172.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  173.     }
  174.    
  175.     if (p1c03 < 0) /*  */
  176.     {
  177.         printf("Error - Player 1 Card 3 (Too Small) \n");
  178.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  179.     }
  180.    
  181.     if (p2c03 > 10) /*  */
  182.     {
  183.         printf("Error - Player 2 Card 3 (Too Large) \n");
  184.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  185.     }
  186.    
  187.     if (p2c03 < 0) /*  */
  188.     {
  189.         printf("Error - Player 2 Card 3 (Too Small) \n");
  190.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  191.     }
  192.    
  193.     if (p1c04 > 10) /*  */
  194.     {
  195.         printf("Error - Player 1 Card 4 (Too Large) \n");
  196.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  197.     }
  198.    
  199.     if (p1c04 < 0) /*  */
  200.     {
  201.         printf("Error - Player 1 Card 4 (Too Small) \n");
  202.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  203.     }
  204.    
  205.     if (p2c04 > 10) /*  */
  206.     {
  207.         printf("Error - Player 2 Card 4 (Too Large) \n");
  208.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  209.     }
  210.    
  211.     if (p2c04 < 0) /*  */
  212.     {
  213.         printf("Error - Player 2 Card 4 (Too Small) \n");
  214.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  215.     }
  216.    
  217.     if (p1c05 > 10) /*  */
  218.     {
  219.         printf("Error - Player 1 Card 5 (Too Large) \n");
  220.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  221.     }
  222.    
  223.     if (p1c05 < 0) /*  */
  224.     {
  225.         printf("Error - Player 1 Card 5 (Too Small) \n");
  226.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  227.     }
  228.    
  229.     if (p2c05 > 10) /*  */
  230.     {
  231.         printf("Error - Player 2 Card 5 (Too Large) \n");
  232.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  233.     }
  234.    
  235.     if (p2c05 < 0) /*  */
  236.     {
  237.         printf("Error - Player 2 Card 5 (Too Small) \n");
  238.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  239.     }
  240.    
  241.     if (p1c06 > 10) /*  */
  242.     {
  243.         printf("Error - Player 1 Card 6 (Too Large) \n");
  244.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  245.     }
  246.    
  247.     if (p1c06 < 0) /*  */
  248.     {
  249.         printf("Error - Player 1 Card 6 (Too Small) \n");
  250.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  251.     }
  252.    
  253.     if (p2c06 > 10) /*  */
  254.     {
  255.         printf("Error - Player 2 Card 6 (Too Large) \n");
  256.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  257.     }
  258.    
  259.     if (p2c06 < 0) /*  */
  260.     {
  261.         printf("Error - Player 2 Card 6 (Too Small) \n");
  262.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  263.     }
  264.    
  265.     if (p1c07 > 10) /*  */
  266.     {
  267.         printf("Error - Player 1 Card 7 (Too Large) \n");
  268.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  269.     }
  270.    
  271.     if (p1c07 < 0) /*  */
  272.     {
  273.         printf("Error - Player 1 Card 7 (Too Small) \n");
  274.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  275.     }
  276.    
  277.     if (p2c07 > 10) /*  */
  278.     {
  279.         printf("Error - Player 2 Card 7 (Too Large) \n");
  280.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  281.     }
  282.    
  283.     if (p2c07 < 0) /*  */
  284.     {
  285.         printf("Error - Player 2 Card 7 (Too Small) \n");
  286.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  287.     }
  288.    
  289.     if (p1c08 > 10) /*  */
  290.     {
  291.         printf("Error - Player 1 Card 8 (Too Large) \n");
  292.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  293.     }
  294.    
  295.     if (p1c08 < 0) /*  */
  296.     {
  297.         printf("Error - Player 1 Card 8 (Too Small) \n");
  298.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  299.     }
  300.    
  301.     if (p2c08 > 10) /*  */
  302.     {
  303.         printf("Error - Player 2 Card 8 (Too Large) \n");
  304.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  305.     }
  306.    
  307.     if (p2c08 < 0) /*  */
  308.     {
  309.         printf("Error - Player 2 Card 8 (Too Small) \n");
  310.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  311.     }
  312.    
  313.     if (p1c09 > 10) /*  */
  314.     {
  315.         printf("Error - Player 1 Card 9 (Too Large) \n");
  316.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  317.     }
  318.    
  319.     if (p1c09 < 0) /*  */
  320.     {
  321.         printf("Error - Player 1 Card 9 (Too Small) \n");
  322.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  323.     }
  324.    
  325.     if (p2c09 > 10) /*  */
  326.     {
  327.         printf("Error - Player 2 Card 9 (Too Large) \n");
  328.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  329.     }
  330.    
  331.     if (p2c09 < 0) /*  */
  332.     {
  333.         printf("Error - Player 2 Card 9 (Too Small) \n");
  334.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  335.     }
  336.    
  337.     if (p1c10 > 10) /*  */
  338.     {
  339.         printf("Error - Player 1 Card 10 (Too Large) \n");
  340.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  341.     }
  342.    
  343.     if (p1c10 < 0) /*  */
  344.     {
  345.         printf("Error - Player 1 Card 10 (Too Small) \n");
  346.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  347.     }
  348.    
  349.     if (p2c10 > 10) /*  */
  350.     {
  351.         printf("Error - Player 2 Card 10 (Too Large) \n");
  352.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  353.     }
  354.    
  355.     if (p2c10 < 0) /*  */
  356.     {
  357.         printf("Error - Player 2 Card 10 (Too Small) \n");
  358.         error = 1; /* integer error is made to be 1 so that the code won't go past this subroutine */
  359.     }
  360.    
  361. }
  362.  
  363.  
  364.  
  365. void bubblesortplayer1 (void) /* Sort player 1 input cards from high to low */
  366. {
  367.     q = 1;
  368.     while (q != 0)
  369.     {
  370.         p = 1; /*  */
  371.         while (p != 0) /*  */
  372.         {
  373.             if (digit1 == 1) {unit1 = p1c01;} /*  */
  374.             if (digit1 == 2) {unit1 = p1c02;} /*  */
  375.             if (digit1 == 3) {unit1 = p1c03;} /*  */
  376.             if (digit1 == 4) {unit1 = p1c04;} /*  */
  377.             if (digit1 == 5) {unit1 = p1c05;} /*  */
  378.             if (digit1 == 6) {unit1 = p1c06;} /*  */
  379.             if (digit1 == 7) {unit1 = p1c07;} /*  */
  380.             if (digit1 == 8) {unit1 = p1c08;} /*  */
  381.             if (digit1 == 9) {unit1 = p1c09;} /*  */
  382.             if (digit2 == 2) {unit2 = p1c02;} /*  */
  383.             if (digit2 == 3) {unit2 = p1c03;} /*  */
  384.             if (digit2 == 4) {unit2 = p1c04;} /*  */
  385.             if (digit2 == 5) {unit2 = p1c05;} /*  */
  386.             if (digit2 == 6) {unit2 = p1c06;} /*  */
  387.             if (digit2 == 7) {unit2 = p1c07;} /*  */
  388.             if (digit2 == 8) {unit2 = p1c08;} /*  */
  389.             if (digit2 == 9) {unit2 = p1c09;} /*  */
  390.             if (digit2 == 10) {unit2 = p1c10;} /*  */
  391.            
  392.             if (unit1<unit2) /*  */
  393.             {
  394.                 swap = unit1; /*  */
  395.                 unit1 = unit2; /*  */
  396.                 unit2 = swap; /*  */
  397.                 swap = 0;
  398.                 if (digit1 == 1){p1c01 = unit1; p1c02 = unit2;}
  399.                 if (digit1 == 2){p1c02 = unit1; p1c03 = unit2;}
  400.                 if (digit1 == 3){p1c03 = unit1; p1c04 = unit2;}
  401.                 if (digit1 == 4){p1c04 = unit1; p1c05 = unit2;}
  402.                 if (digit1 == 5){p1c05 = unit1; p1c06 = unit2;}
  403.                 if (digit1 == 6){p1c06 = unit1; p1c07 = unit2;}
  404.                 if (digit1 == 7){p1c07 = unit1; p1c08 = unit2;}
  405.                 if (digit1 == 8){p1c08 = unit1; p1c09 = unit2;}
  406.                 if (digit1 == 9){p1c09 = unit1; p1c10 = unit2;}
  407.             }
  408.             digit1++; /*  */
  409.             digit2++; /*  */
  410.             p++; /*  */
  411.             if (p == p1num + 1) /*  */
  412.             {
  413.                 digit1 = 1; /*  */
  414.                 digit2 = 2; /*  */
  415.                 p = 0; /*  */
  416.             }
  417.         }
  418.         q++;
  419.         if (q == 10)
  420.         {q = 0;}
  421.     }
  422.     if (q = 0) {return;} /*  */
  423. }
  424.  
  425.  
  426. void bubblesortplayer2 (void) /* Sort player 2 input cards from high to low */
  427. {
  428.     q = 1;
  429.     while (q != 0)
  430.     {
  431.         p = 1; /*  */
  432.         while (p != 0) /*  */
  433.         {
  434.             if (digit1 == 1) {unit1 = p2c01;} /*  */
  435.             if (digit1 == 2) {unit1 = p2c02;} /*  */
  436.             if (digit1 == 3) {unit1 = p2c03;} /*  */
  437.             if (digit1 == 4) {unit1 = p2c04;} /*  */
  438.             if (digit1 == 5) {unit1 = p2c05;} /*  */
  439.             if (digit1 == 6) {unit1 = p2c06;} /*  */
  440.             if (digit1 == 7) {unit1 = p2c07;} /*  */
  441.             if (digit1 == 8) {unit1 = p2c08;} /*  */
  442.             if (digit1 == 9) {unit1 = p2c09;} /*  */
  443.             if (digit2 == 2) {unit2 = p2c02;} /*  */
  444.             if (digit2 == 3) {unit2 = p2c03;} /*  */
  445.             if (digit2 == 4) {unit2 = p2c04;} /*  */
  446.             if (digit2 == 5) {unit2 = p2c05;} /*  */
  447.             if (digit2 == 6) {unit2 = p2c06;} /*  */
  448.             if (digit2 == 7) {unit2 = p2c07;} /*  */
  449.             if (digit2 == 8) {unit2 = p2c08;} /*  */
  450.             if (digit2 == 9) {unit2 = p2c09;} /*  */
  451.             if (digit2 == 10) {unit2 = p2c10;} /*  */
  452.            
  453.             if (unit1<unit2) /*  */
  454.             {
  455.                 swap = unit1; /*  */
  456.                 unit1 = unit2; /*  */
  457.                 unit2 = swap; /*  */
  458.                 swap = 0;
  459.                 if (digit1 == 1){p2c01 = unit1; p2c02 = unit2;}
  460.                 if (digit1 == 2){p2c02 = unit1; p2c03 = unit2;}
  461.                 if (digit1 == 3){p2c03 = unit1; p2c04 = unit2;}
  462.                 if (digit1 == 4){p2c04 = unit1; p2c05 = unit2;}
  463.                 if (digit1 == 5){p2c05 = unit1; p2c06 = unit2;}
  464.                 if (digit1 == 6){p2c06 = unit1; p2c07 = unit2;}
  465.                 if (digit1 == 7){p2c07 = unit1; p2c08 = unit2;}
  466.                 if (digit1 == 8){p2c08 = unit1; p2c09 = unit2;}
  467.                 if (digit1 == 9){p2c09 = unit1; p2c10 = unit2;}
  468.             }
  469.             digit1++; /*  */
  470.             digit2++; /*  */
  471.             p++; /*  */
  472.             if (p == p2num + 1) /*  */
  473.             {
  474.                 digit1 = 1; /*  */
  475.                 digit2 = 2; /*  */
  476.                 p = 0; /*  */
  477.             }
  478.         }
  479.         q++;
  480.         if (q == 10)
  481.         {q = 0;}
  482.     }
  483.     if (q = 0) {return;} /*  */
  484. }
  485.  
  486. void runthrough (void)
  487. {
  488.     if (unit1 > unit2)
  489.     {
  490.         winner = 1;
  491.     }
  492.    
  493.     else if (unit1 < unit2)
  494.     {
  495.         winner = 2;
  496.     }
  497.    
  498.     else if (unit1 == unit2)
  499.     {
  500.         next++;
  501.         if (next == 9)
  502.         {
  503.             winner = 3;
  504.         }
  505.     }
  506. }
  507.  
  508. void game (void) /* Compare player 1 cards with player 2 cards */
  509. {
  510.     unit1 = p1c01;
  511.     unit2 = p2c01;
  512.    
  513.     runthrough();
  514.    
  515.     if (next == 1)
  516.     {
  517.         unit1 = p1c02;
  518.         unit2 = p2c02;
  519.         runthrough();
  520.     }
  521.    
  522.     if (next == 2)
  523.     {
  524.         unit1 = p1c03;
  525.         unit2 = p2c03;
  526.         runthrough();
  527.     }
  528.    
  529.     if (next == 3)
  530.     {
  531.         unit1 = p1c04;
  532.         unit2 = p2c04;
  533.         runthrough();
  534.     }
  535.    
  536.     if (next == 4)
  537.     {
  538.         unit1 = p1c05;
  539.         unit2 = p2c05;
  540.         runthrough();
  541.     }
  542.    
  543.     if (next == 5)
  544.     {
  545.         unit1 = p1c06;
  546.         unit2 = p2c06;
  547.         runthrough();
  548.     }
  549.    
  550.     if (next == 6)
  551.     {
  552.         unit1 = p1c07;
  553.         unit2 = p2c07;
  554.         runthrough();
  555.     }
  556.    
  557.     if (next == 7)
  558.     {
  559.         unit1 = p1c08;
  560.         unit2 = p2c08;
  561.         runthrough();
  562.     }
  563.    
  564.     if (next == 8)
  565.     {
  566.         unit1 = p1c09;
  567.         unit2 = p2c09;
  568.         runthrough();
  569.     }
  570.    
  571.     if (next == 9)
  572.     {
  573.         unit1 = p1c10;
  574.         unit2 = p2c10;
  575.         runthrough();
  576.     }
  577.    
  578.    
  579.    
  580.    
  581. }
  582.  
  583. void results (void) /* Results subroutine displays the results of the card game */
  584. {
  585.     if (winner == 1) /* If player 1 wins, this will be displayed */
  586.     {
  587.         printf ("Player 1 is the Winner\n"); /* Display Player 1 is the Winner */
  588.     }
  589.    
  590.     if (winner == 2) /* If player 2 wins, this will be displayed */
  591.     {
  592.         printf ("Player 2 is the Winner\n"); /* Display Player 2 is the Winner */
  593.     }
  594.    
  595.     if (winner == 3) /* If no-one wins, draw will be displayed */
  596.     {
  597.         printf ("Draw\n"); /* Display Draw */
  598.     }
  599.    
  600. }
  601.  
  602.  
  603.  
  604. void main (void) /* This is where the code starts */
  605. {
  606.     error = 0; /* Set integer error to 0 be be changed and read within the error subroutine */
  607.     winner = 0;
  608.     next = 0;
  609.     /* Scan For Player 1 */
  610.     scanf( "%d", &p1num);
  611.     if (p1num >= 2)
  612.     {scanf( "%d %d", &p1c01, &p1c02);}
  613.     if (p1num >= 3)
  614.     {scanf( "%d", &p1c03);}
  615.     if (p1num >= 4)
  616.     {scanf( "%d", &p1c04);}
  617.     if (p1num >= 5)
  618.     {scanf( "%d", &p1c05);}
  619.     if (p1num >= 6)
  620.     {scanf( "%d", &p1c06);}
  621.     if (p1num >= 7)
  622.     {scanf( "%d", &p1c07);}
  623.     if (p1num >= 8)
  624.     {scanf( "%d", &p1c08);}
  625.     if (p1num >= 9)
  626.     {scanf( "%d", &p1c09);}
  627.     if (p1num >= 10)
  628.     {scanf( "%d", &p1c10);}
  629.     /* Scan For Player 2 */
  630.     scanf( "%d", &p2num);
  631.     if (p1num >= 2)
  632.     {scanf( "%d %d", &p2c01, &p2c02);}
  633.     if (p1num >= 3)
  634.     {scanf( "%d", &p2c03);}
  635.     if (p1num >= 4)
  636.     {scanf( "%d", &p2c04);}
  637.     if (p1num >= 5)
  638.     {scanf( "%d", &p2c05);}
  639.     if (p1num >= 6)
  640.     {scanf( "%d", &p2c06);}
  641.     if (p1num >= 7)
  642.     {scanf( "%d", &p2c07);}
  643.     if (p1num >= 8)
  644.     {scanf( "%d", &p2c08);}
  645.     if (p1num >= 9)
  646.     {scanf( "%d", &p2c09);}
  647.     if (p1num >= 10)
  648.     {scanf( "%d", &p2c10);}
  649.    
  650.     /* Scan inputs for any errors */
  651.     errors(); /* Go to error subroutine */
  652.     /* Sort input cards from high to low */
  653.    
  654.     bubblesortplayer2();
  655.     bubblesortplayer1();
  656.    
  657.     /* Compare player 1 cards with player 2 cards */
  658.     if (error != 1)
  659.     {
  660.         game();
  661.         /* Workout and Display results */
  662.         results();
  663.     }
  664. }