Menu
Coddy logo textTech

Dynamic Suit

Lesson 4 of 6 in Coddy's Playing Cards Generator (Text Based) course.

Playing cards have four kind of suits:

  1. clubs (♣)
  2. diamonds (♦)
  3. hearts (♥)
  4. spades (♠)
challenge icon

Challenge

Easy

Make your printCard function get as input string that is "club" or "diamond" or "heart" or "spade" and prints Ace card with the dynamic suit (from the input).

Here are the symbols for your use:

, , ,

If the input string is not one of the four options above, the symbol should be a space (" ").

Try it yourself

#include <stdio.h>

void printCard() {
    printf("╔═════════╗\n");
    printf("║ A       ║\n");
    printf("║         ║\n");
    printf("║         ║\n");
    printf("║    ♥    ║\n");
    printf("║         ║\n");
    printf("║         ║\n");
    printf("║       A ║\n");
    printf("╚═════════╝\n");
}

All lessons in Playing Cards Generator (Text Based)