-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGorillaFacts.cpp
65 lines (61 loc) · 4.56 KB
/
GorillaFacts.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "Server.hpp"
#include "Client.hpp"
#include "Channel.hpp"
void Server::PrintFacts(int fd)
{
std::vector<std::string> facts;
// Pushing back each line
facts.push_back("Gorillas are the largest primates on Earth.\n");
facts.push_back("Gorillas share about 98% of their DNA with humans.\n");
facts.push_back("Gorillas live in groups called troops.\n");
facts.push_back("A group of gorillas is called a band.\n");
facts.push_back("Gorillas are primarily herbivores, feeding on leaves, stems, and fruits.\n");
facts.push_back("Male gorillas are called silverbacks due to the silver hair on their backs.\n");
facts.push_back("Silverbacks are the leaders of their gorilla groups.\n");
facts.push_back("Gorillas have opposable thumbs, allowing them to grasp objects.\n");
facts.push_back("Gorillas are highly intelligent animals.\n");
facts.push_back("Gorillas can learn sign language and communicate with humans.\n");
facts.push_back("Gorillas build nests to sleep in at night.\n");
facts.push_back("Gorillas are mainly found in the forests of central Africa.\n");
facts.push_back("Gorillas have a complex social structure.\n");
facts.push_back("Infant gorillas are called babies.\n");
facts.push_back("Gorillas are peaceful animals, but they can become aggressive when threatened.\n");
facts.push_back("Female gorillas give birth every four years on average.\n");
facts.push_back("Gorillas have a gestation period of about 8.5 months.\n");
facts.push_back("Gorillas have thick fur to keep them warm in their forest habitat.\n");
facts.push_back("The arms of a gorilla are longer than its legs.\n");
facts.push_back("Gorillas have a strong sense of smell.\n");
facts.push_back("Gorillas are diurnal, meaning they are active during the day.\n");
facts.push_back("Gorillas are capable of recognizing themselves in mirrors.\n");
facts.push_back("Gorillas have individual fingerprints, just like humans.\n");
facts.push_back("Gorillas have a vocal range that includes grunts, hoots, and screams.\n");
facts.push_back("Gorillas use chest-beating as a display of strength and dominance.\n");
facts.push_back("Gorillas have strong family bonds.\n");
facts.push_back("Gorillas are an endangered species due to habitat loss and poaching.\n");
facts.push_back("Gorillas can climb trees, but they typically spend most of their time on the ground.\n");
facts.push_back("Gorillas have a lifespan of 35 to 40 years in the wild.\n");
facts.push_back("Gorillas have a lifespan of 50 years or more in captivity.\n");
facts.push_back("Gorillas are protected by national parks and reserves in Africa.\n");
facts.push_back("Gorillas are listed as critically endangered by the IUCN.\n");
facts.push_back("Gorillas have large, powerful jaws capable of crushing hard foods.\n");
facts.push_back("Gorillas have a complex digestive system adapted to their vegetarian diet.\n");
facts.push_back("Gorillas are important for maintaining the health of the forest ecosystem.\n");
facts.push_back("Gorillas play a key role in seed dispersal.\n");
facts.push_back("Gorillas are known to use tools, such as sticks and rocks, in their environment.\n");
facts.push_back("Gorillas are curious animals and may investigate new objects in their habitat.\n");
facts.push_back("Gorillas have a slow reproductive rate, making them vulnerable to population declines.\n");
facts.push_back("Gorillas are closely related to humans, sharing a common ancestor.\n");
facts.push_back("Gorillas have been studied extensively by scientists to understand their behavior and ecology.\n");
facts.push_back("Gorillas have distinct facial expressions that convey their emotions.\n");
facts.push_back("Gorillas have a gentle demeanor when interacting with each other.\n");
facts.push_back("Gorillas have a varied diet that includes over 100 different plant species.\n");
facts.push_back("Gorillas are excellent climbers, using both their hands and feet.\n");
facts.push_back("Gorillas use vocalizations to communicate over long distances in the forest.\n");
facts.push_back("Gorillas have a unique chest structure that allows them to produce deep vocalizations.\n");
facts.push_back("Gorillas are known to groom each other as a form of social bonding.\n");
facts.push_back("Gorillas have a large brain relative to their body size.\n");
// Shuffle the vector
std::random_shuffle(facts.begin(), facts.end());
// Send a random fact to the client
send(fd, facts[0].c_str(), facts[0].size(), 0);
}