Poker game in C?

This is the code I have and I don't know why nothing is showing up when i run it. I'm a beginner so i'm sorry if it's a dumb question. It's as if its not running the analyzeHand function and i don't know why. There is random code that won't fit in the question so i didn't include it. I just want to know if i called the function correctly.

#include <stdio.h>

#include <stdlib.h>

void analyzeHand (int facesInHand[], int suitsInHand[]);

int main(){

 int facesInHand[13], suitsInHand[4];

 int num;

 int i = 0;







 analyzeHand (facesInHand, suitsInHand);


void analyzeHand(int facesInHand[], int suitsInHand[])



 if (straight && flush)

  printf("Straight flush\n\n");

 else if (four)

  printf("Four of a kind\n\n");

 else if (three && pairs == 1)

  printf("Full house\n\n");

 else if (flush)


 else if (straight)


 else if (three)

  printf("Three of a kind\n\n");

 else if (pairs == 2)

  printf("Two pairs\n\n");

 else if (pairs == 1)



  printf("High card\n\n");


3 Answers

  • Mike W
    Lv 7
    1 year ago

    There seems to be an awful lot missing from the programme.  Your while loop is basically an infinite loop.  

  • EddieJ
    Lv 7
    1 year ago

    Your code doesn't seem to make any sense.

    There are 13 faces in a deck, not in a hand.

    You aren't incrementing <i> so it's stuck in an infinite loop.

  • Anonymous
    1 year ago

    did you try debugging?

Still have questions? Get your answers by asking now.