I am trying to write a poker hand score system. I have worked everything out except how to do full house and 2 two pair. Currently I scan through all 127 ASCII values, then if the code detects that in the input from the user it will increment a counter. But when I try to write an if statement, if the counter is equal to 3 and 2 it will not work. Any ideas why this is not working, or is there another way to do this?
here is my code to help you out, this is not my whole code as it is quite large, just the bits that i feel will help you help me. Thank you very much for your time in reading this.
Code:
#include<stdio.h>int main(void)
{   int c;
    int n;
    int count1[127] = {0};
    int count2[127] = {0};
    int count3 = {0};
    int i;
    int temp;
    int j;
    int difference; 
    char array[5];
    char array1[5];
    int picturedifference;
    int difference1;
    int suitdifference;
    int suitcount = {0};
    int count4 = {0};
    n = 5;
     
     
    for (c = 0; c < n; c++) 
        scanf("%c%c ", &array1[c], &array[c]);
        getchar();

       
     for (i = 0; i < n; i++) {
        count1[array[i]]++;                    //if array[i] is N, then count1[N]++//
    }                                          //these two for statement adds to the counts//
    for (i = 0; i < n; i++) {
        count2[array1[i]]++;}   






    {      for (i = 0; i < 127; i++)             
              { 
              if ( count2[i] == 4 && suitcount!= 4 )
              printf("Four of a kind. Your score is 50.\n");
              
              if( count2[i] == 3 && count2[i] == 2 && suitcount != 4)
              printf("Full House. Your score is 25. \n");
              
              if ( count2[i] == 3 && suitcount != 4  )
              printf("Three of a kind. Your score is 5.\n");
              
              if ( count2[i] == 2 && suitcount != 4  )
              printf("Pair. Your score is 2.\n");
             
              }
              
              
               
             
    }
   
    return 0;
    }