Don’t Panic
#include <unistd.h>
void. ft_dont_panic(void)
{
. /* 12 is the exact byte count of “Don’t Panic\n” */
. write(1, “Don’t Panic\n”, 12);
}
Returning the Ultimate Answer
int. ft_return_the_answer(void)
{
. return (42);
}
Searching for the Spaceship
/* A conceptual example of searching for an Easter egg string */
int. ft_check_easter_egg(char *str)
Get Jonathan Justice’s stories in your inbox
Join Medium for free to get updates from this writer.
{
. char. *easter_egg;
. int. i;
. easter_egg = “Heart of Gold”;
. i = 0;
. while (str[i] != ‘\0' && easter_egg[i] != ‘\0')
. {
. if (str[i] != easter_egg[i])
. return (0);
. i++;
. }
. if (easter_egg[i] == ‘\0')
. return (1);
. return (0);
}






