Conversation
02e8869 to
ac9e7d8
Compare
ac9e7d8 to
c894da3
Compare
|
|
||
| To do this, you need to: | ||
|
|
||
| - Generate random birthdates. |
There was a problem hiding this comment.
Creating random birthdays is not part of the exercise here. Do you think it would make sense to add an append to clarify that we don't do this here and maybe also give some reasoning?
There was a problem hiding this comment.
We could ask students to generate random birthdates.
Perhaps
typedef struct {
uint8_t day;
uint8_t month;
uint16_t year;
} date_t;
void random_birthdates(date_t *buffer, size_t date_count, uint64_t seed);
(If in the example solution the struct is read/written as uint32_t, on little endian machines the low bits have the day and the high bits have the year)
There was a problem hiding this comment.
How exactly would you have students generate random birthdates? Have them implement some simple RNG?
There was a problem hiding this comment.
Are you waiting for something from me here? If so, let me know please!
There was a problem hiding this comment.
I know this response is late, but allowing the student to provide birthdays, without worrying if they are random or otherwise, may be a thing. If we are not focusing on the RNG, it does not matter in terms of doing the exercise.
But the tests provide birthdays to exercise the student, so it is not likely needed.
| FUNC_PROTO = """\ | ||
| #include "vendor/unity.h" | ||
|
|
||
| #include <stddef.h> |
There was a problem hiding this comment.
I include it for the definition of NULL
|
|
||
| void test_multiple_birthdates_with_more_than_one_shared_birthday(void) { | ||
| TEST_IGNORE(); | ||
| const char *birthdates[] = {"1966-07-29", "1977-02-12", "2001-12-25", "1980-07-29", "2019-02-12", NULL}; |
There was a problem hiding this comment.
Other tracks make this less about string parsing by using some Date structure that has year, month, and day fields. I think I would prefer that here as well, but if you prefer using the raw string format, fine as well.
|
This is with me to update based on feedback. |
|
🐪 |
No description provided.