Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(!correct)
- {
- scanf("%d", &position);
- if (position >= 0 || position <= 51)
- {
- printf("The card that is present at %d is: %d%c.n", position, deckOfCards[position].cardNumber, deckOfCards[position].cardSuit);
- correct = true;
- if (position == 0)
- {
- printf("The card that is present before 0 is: %d%c.n", deckOfCards[51].cardNumber, deckOfCards[51].cardSuit);
- }
- else
- {
- printf("The card that is present before %d is: %d%c.n", position, deckOfCards[position-1].cardNumber, deckOfCards[position-1].cardSuit);
- }
- if (position == 51)
- {
- printf("The card that is present after 0 is: %d%c.n", deckOfCards[0].cardNumber, deckOfCards[0].cardSuit);
- }
- else
- {
- printf("The card that is present after %d is: %d%c.n", position, deckOfCards[position+1].cardNumber, deckOfCards[position+1].cardSuit);
- }
- }
- else
- {
- printf("Please try again.n");
- }
- }
Add Comment
Please, Sign In to add comment