Skip to content

Commit 2bdccbb

Browse files
committed
working version of marcovchain nonsense generator
1 parent c0dc420 commit 2bdccbb

13 files changed

+505
-29
lines changed

markov_strings/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CC=g++
22
INCLUDE_DIR = include
33
# CFLAGS = -lm -I $(INCLUDE_DIR)
44
CFLAGS=-Wall -Wextra -Wpedantic -I $(INCLUDE_DIR) -fpermissive
5-
# -fsanitize=address -Og -DDEBUG -ggdb -D_FORTIFY_SOURCE=2 -lgtest -fpermissive -lstdc++
5+
#-fsanitize=address -Og -DDEBUG -ggdb -D_FORTIFY_SOURCE=2 -lgtest -fpermissive -lstdc++
66
TEST_CFLAGS=-Wall -Wextra -Wpedantic -lm -I $(INCLUDE_DIR)
77
LDFLAGS=$(CFLAGS)
88
TEST_BUILD=build_tests

markov_strings/include/array.h

+20-4
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,27 @@
2222
/* void array_delete(Array* arr); */
2323
/* void array_append(Array* arr, void* new_element, size_t element_size); */
2424

25-
26-
#define DEFINE_ARRAY_GENERIC(array_element_type) \
25+
#define DEFINE_ARRAY_GENERIC_h(array_element_type) \
2726
typedef struct { \
2827
size_t size; \
2928
size_t capacity; \
3029
array_element_type* elements; \
3130
} __Array##array_element_type; \
3231
\
32+
void __array_append_##array_element_type(__Array##array_element_type* arr, void* new_element); \
33+
\
34+
void __array_new##array_element_type(__Array##array_element_type* arr); \
35+
\
36+
array_element_type __get_array_random_element_##array_element_type(Array(array_element_type) arr); \
37+
38+
39+
#define DEFINE_ARRAY_GENERIC_c(array_element_type) \
40+
\
3341
void __array_append_##array_element_type(__Array##array_element_type* arr, void* new_element){ \
3442
assert(arr != NULL); \
3543
assert(arr->elements != NULL); \
3644
\
37-
if (arr->size == (1 << arr->capacity) * ARRAY_CAPACITY * sizeof(array_element_type)){ \
45+
if (arr->size == (1 << arr->capacity) * ARRAY_CAPACITY){ \
3846
arr->elements = realloc(arr->elements, ( 1 << (arr->capacity + 1)) * ARRAY_CAPACITY * sizeof(array_element_type)); \
3947
arr->capacity++; \
4048
} \
@@ -48,16 +56,24 @@ void __array_new##array_element_type(__Array##array_element_type* arr){
4856
arr->size = 0; \
4957
arr->capacity = 0; \
5058
arr->elements = calloc(sizeof(array_element_type), ARRAY_CAPACITY); \
51-
}
59+
} \
60+
\
61+
array_element_type __get_array_random_element_##array_element_type(Array(array_element_type) arr){ \
62+
return arr.elements[rand() % arr.size]; \
63+
} \
64+
65+
5266

5367
#define Array(array_element_type) __Array##array_element_type
5468

5569
#define array_append(arr, new_element, array_element_type) __array_append_##array_element_type(arr, new_element)
5670
#define array_new(arr, array_element_type) __array_new##array_element_type(arr)
5771

72+
#define array_get_random_element(arr, array_element_type) __get_array_random_element_##array_element_type(arr)
5873

5974
/* DEFINE_ARRAY_GENERIC(string_hashmap_unit); */
6075
/* Array(int) arr = {1,3,4,5}; */
6176

6277

78+
6379
#endif

markov_strings/include/hashmap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typedef struct {
2020
} string_hashmap_unit;
2121

2222

23-
DEFINE_ARRAY_GENERIC(string_hashmap_unit);
23+
DEFINE_ARRAY_GENERIC_h(string_hashmap_unit);
2424

2525
typedef Array(string_hashmap_unit) MapValue;
2626

markov_strings/include/random.h

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
#ifndef RANDOM_H
22
#define RANDOM_H
33

4-
#include <stdlib.h>
5-
#include "array.h"
6-
#include "hashmap.h"
7-
8-
#define DEFINE_get_array_random_element(array_element_type) \
9-
array_element_type __get_array_random_element_##array_element_type(Array(array_element_type) arr){ \
10-
return arr.elements[rand() % arr.size]; \
11-
} \
12-
13-
#define array_get_random_element(arr, array_element_type) __get_array_random_element_##array_element_type(arr)
14-
15-
DEFINE_get_array_random_element(string_hashmap_unit);
4+
/* #include <stdlib.h> */
5+
/* #include "array.h" */
6+
/* #include "hashmap.h" */
167

178
#endif

markov_strings/output.txt

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
Pushkin y
2+
I'm a legend , fucking like this is on bag LV
3+
Rich
4+
Bitch , the neck , observe etiquette
5+
This is my early twenties
6+
Who dreamed of bitches want to me haha
7+
I'm wearing two pillows oh yeah
8+
Kh - me : from mouth to come to me Yeah , I am a legend , yeah
9+
Bitch , fucked up
10+
But what did you suck on me
11+
So much money , the plane , this
12+
Bitch , I don't give a legend , making money , I'm a capper e
13+
Making money , fucked up
14+
Two cartoons on my early twenties
15+
Three on me Yeah , the ass , I'm hanging like a little mermaid Suck
16+
Weaving thousands on me , yeah
17+
They say : I only need a legend , I don't give a rash of lava
18+
This fit will wipe it to come on the HYPE will leave
19+
Making money , fucked up
20+
Look , paw , we took it culturally
21+
I'm like an aristocratic daddy
22+
This fit will wipe it culturally
23+
Bitch , but not on me , I have a rash of bitches want to me
24+
So much money , I did you ?
25+
Bitch , a top , like an Emirate
26+
Hey , like a rash of bitches want stones And you're like an aristocratic daddy
27+
I'm like that joke : I say : I don't give a top , come to another mouth to me
28+
The lookbook spread
29+
Making money
30+
Under heavy currency rain
31+
Weaving thousands on me Expensive , making money , a little mermaid Suck
32+
Kh - na - r , I did you can die Hey , seven under the plane , the third year later , seven under the new Cadillac
33+
I will leave
34+
Ay , I'm wearing two pillows oh yeah Yeah , fucking like an Emirate
35+
The lookbook spread
36+
This is jumping , I'm hanging like an aristocratic daddy
37+
Two cartoons on the crisis , a hundred - me Expensive , fucking chill zone
38+
Hey , yeah
39+
Bitch , few
40+
Chains Oops
41+
A year later , few
42+
Making money , making money , come to those fuckers ?
43+
Making money , fucking chill zone
44+
I'm wearing hundred carat stones
45+
How is the carcass ha
46+
Making money
47+
Bitch , hit the takeaway fuck about the cache with a legend , huh
48+
This is my card Find it wah - wah
49+
I'm like a rash of lava
50+
Paw - me , a little mermaid Suck
51+
This is jumping , paw
52+
Bitch , I'm like a shovel e
53+
Digging the fucking like Dubai
54+
I'm like Dubai
55+
Your girlfriend is your salary ?
56+
Making money
57+
Making money , observe etiquette
58+
Hey , the new Cadillac
59+
To my house , a young aristocrat I'm a legend , he's a rash of bitches want stones on me : I splattered her face with a magic wand Oops
60+
Two cartoons on me : from mouth
61+
Your hoe is a skipping rope On what , I have guards have hundred carat stones
62+
Kh - wee - kh - blee
63+
So much money
64+
My guards La la la la
65+
Do not become a young aristocrat Aristocrat
66+
So much money
67+
Ha ha
68+
Three on my early twenties
69+
I'm a salami Cum
70+
Making money , a rash of lava
71+
Making money , then we got some guns pr - kh Fenimore Cooper
72+
Bitch , the fucking like an Emirate I'm in my watch
73+
Chains Oops
74+
Bitch , I am a shovel e
75+
I'm in a fuck - carat stones on the chain is the ass
76+
I'm a skipping
77+
So much money
78+
They tell me Expensive , I splattered her , making money , you do ? How are you , a young aristocrat Aristocrat
79+
I'm wearing hundred carat stones on bag LV
80+
Smeared her , like Dubai
81+
Hey , huh
82+
Bitch , a magic wand Oops
83+
Slava , I am a young aristocrat I'm like an aristocratic daddy
84+
Threw ice on the ass , what did you can die Khm - r , well , I did you ? How are you suck on Dad e
85+
Making money , come to me , yeah
86+
Hundreds of what ?
87+
Hundreds of lava
88+
To my watch
89+
Ay , like an Emirate I'm wearing hundred carat stones on bag LV
90+
I'm like Dubai
91+
I only need a young aristocrat I'm wearing hundred - r , you're dumb
92+
A year now , if you ?
93+
I beg you ?
94+
This is on me , yeah
95+
But what did you can die Hey , fucked up
96+
I'm a legend , we got some guns pr - kh - kh - paw
97+
Under heavy currency rain
98+
I'm a shovel e
99+
Slava , I grew up
100+
Bitch , I am a shovel e
101+
Under heavy currency rain
102+
But what did everything by deception Fucked up in a hundred carat stones And you're dumb
103+
So much money
104+
Your boyfriend will kill faster than ko - kh Fenimore Cooper
105+
Hundreds of bitches want stones
106+
Hey , you ?
107+
Weaving thousands on me
108+
So much money , for me : I will not slurp , look at this
109+
The lookbook spread
110+
But what did you , the chain is my house , you ? How are you can die Khm - khm - khm
111+
The baby is jumping , you ?
112+
She's looking for a little mermaid Suck
113+
Rich , you're like an Emirate
114+
See , like that okay , like a treasure on
115+
Bitch , paw , I'm a young Pushkin y
116+
Let's go , like Dubai
117+
A year later , a legend , I grew up
118+
Two cartoons on the takeaway fuck - r , a magic wand Oops
119+
A young aristocrat I'm a top , but not in my watch
120+
Hundreds of what ?
121+
The baby is jumping , for the ass
122+
I am a capper e
123+
Making money
124+
Bitch , like this is jerking off , seven under the new Cadillac
125+
Ha !
126+
Bitch , you ?
127+
Hundreds of bitches want to me , he's a legend Never
128+
Weaving thousands on , I'm in it
129+
Under heavy currency rain
130+
How are you can die
131+
So much money , you ? How are you can die
132+
I have guards La la la la la
133+
How are you ?
134+
Sayonara "Sick" Boy
135+
So much money , like this
136+
Under heavy currency rain
137+
I'm young
138+
Who dreamed of bitches want to me : I beg you ?
139+
Bitch , like this is jumping , I only need a fuck about the fucking like a rag Ha !
140+
Slava , I'm in a young
141+
A young
142+
This is fresher than ko - rus
143+
Hey , fucking like Dubai
144+
Bitch , I don't give a rash of bitches want stones And you're like this
145+
I'm an Emirate Emirate
146+
Making money
147+
Weaving thousands on , the cache with a rash of bitches want stones on my watch
148+
See , a rag Ha ha ha
149+
Stop being so fuckin' Gredy
150+
My guards have guards have a skipping rope On what ?
151+
Hey , you can die
152+
This is your salary ?
153+
Hey , do ? How are you ? How are you ? How are hanging on the plane , fucking like an Emirate I'm wearing two pillows oh yeah
154+
Hundreds of lava
155+
To my watch
156+
Your boyfriend will wipe it off , I'm young
157+
Hundreds of bitches want stones on , the new Cadillac
158+
Ha ha
159+
I'm wearing hundred carat stones And you're dumb
160+
Smeared her face with a legend , fucked up
161+
Let's go , a new Cadillac
162+
This is jerking off , yeah
163+
Hundreds of bitches want stones
164+
This is a young aristocrat I'm wearing two pillows oh yeah Yeah , well , but not slurp , I'm an Emirate Emirate
165+
She's looking for me
166+
Slava , come to come to come to the chain is my sports car at the neck , I'm wearing hundred - blee - carat stones And you're dumb
167+
Making money , paw
168+
Kh - wah - carat stones on me , the crisis , I'm a moth suits me Yeah , do ?
169+
Hundreds of bitches want stones on bag LV
170+
The baby is on my jon
171+
Chains are you , you're dumb
172+
Making money , I splattered her face with a hundred carat stones And you're dumb
173+
Two cartoons on me haha
174+
Sayonara "Sick" Boy
175+
A young aristocrat Aristocrat
176+
I'm in it to come to me Expensive , come on the ass
177+
Hundreds of bitches want stones
178+
Adlib is fresher than ko - kh - me , this
179+
Chains Oops
180+
How are you ?
181+
A year now , fucked up
182+
Three on me
183+
I'm like an Emirate
184+
The lookbook spread
185+
I splattered her , for me haha
186+
Three on me
187+
Making money , I am busy , like an Emirate
188+
Bitch , fucking like that okay , this is a capper e
189+
They say to me , look
190+
Kh - me
191+
See , what ? How are you ? How are you ?
192+
Hey , fucking like that joke : I say to the HYPE will wipe it wah - khm
193+
Ay , you're like an Emirate Emirate I'm a legend , yeah
194+
Weaving thousands on me Expensive , like a young Pushkin y
195+
Two cartoons on a treasure on bag LV
196+
Hundreds of lava
197+
Rich
198+
So much money , a top , making money , if you can die
199+
Kh - na - kh Fenimore Cooper
200+
How are you ?
201+
Your girlfriend is fresher than ko - r , look
202+
So much money , the plane , I have hundred carat stones
203+
This is on my card Find it off , the fucking chill zone
204+
I will leave
205+
Weaving thousands on my watch
206+
Hey , look at the HYPE will leave
207+
How is jumping , I'm a young samurai with a transparent umbrella
208+
So much money , fucking like that okay , you , fucking chill zone
209+
I'm hanging like Dubai
210+
Hundreds of lava
211+
Smeared her , making money
212+
A young
213+
So much money , a little mermaid Suck
214+
My lady , seven under the chain is a rash of lava
215+
Who dreamed of bitches want to the neck , fucked up in it to come to me , then we took it
216+
Ha ha ha
217+
Do not slurp , the ass , I'm like an Emirate I'm young aristocrat I'm wearing hundred carat stones on the neck , come to me , well , the fucking like a young
218+
Weaving thousands on bag LV
219+
I'm a shovel e
220+
Bitch , I'm wearing hundred - blee - khm - ro

0 commit comments

Comments
 (0)