about summary refs log tree commit diff stats
path: root/blessed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'blessed.cpp')
-rw-r--r--blessed.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/blessed.cpp b/blessed.cpp index 367d0d1..f3d90c4 100644 --- a/blessed.cpp +++ b/blessed.cpp
@@ -44,6 +44,8 @@ int main(int argc, char** argv)
44 emojis.push_back(line); 44 emojis.push_back(line);
45 } 45 }
46 46
47 emojifile.close();
48
47 for (;;) 49 for (;;)
48 { 50 {
49 std::cout << "Generating tweet" << std::endl; 51 std::cout << "Generating tweet" << std::endl;
@@ -66,14 +68,22 @@ int main(int argc, char** argv)
66 68
67 std::string emojibef; 69 std::string emojibef;
68 std::string emojiaft; 70 std::string emojiaft;
71 int emn = 0;
69 do 72 do
70 { 73 {
74 emn++;
71 std::string em = emojis[rand() % emojis.size()]; 75 std::string em = emojis[rand() % emojis.size()];
72 emojibef += em; 76 emojibef += em;
73 emojiaft = em + emojiaft; 77 emojiaft = em + emojiaft;
74 } while (rand() % 4 < 3); 78 } while (rand() % 2 == 0);
75 79
76 std::string result = emojibef + " " + exclamation + " " + emojiaft; 80 std::string result;
81 if (emn > 3)
82 {
83 result = emojibef + "\n" + exclamation + "\n" + emojiaft;
84 } else {
85 result = emojibef + " " + exclamation + " " + emojiaft;
86 }
77 result.resize(140); 87 result.resize(140);
78 88
79 std::string replyMsg; 89 std::string replyMsg;