Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- #include "card.h"
- Card card_constructor(void) {
- return (Card){0};
- }
- void card_initialize(Card* this, int value, int color, int seed) {
- card_set_value(this, value);
- card_set_color(this, color);
- card_set_seed(this, seed);
- }
- void card_print_values(Card* this) {
- printf("Value: %d\tColor: %d\tSeed: %d\n", this->value, this->color, this->seed);
- }
- bool card_is_valid(Card* this) {
- if (this->seed > 0 && this->seed < 5 &&
- this->value > 0 && this->value < 14 &&
- this->color > 0 && this->color < 5)
- return true;
- }
- void card_reset_values(Card* card) {
- card->color = 0;
- card->seed = 0;
- card->value = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment