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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
import sys
import re
from random import choice
# text = input().split()
depth = 2 # int(input())
length = 40 # int(input())
markov = {}
def add_markov(text):
text = re.sub("[^a-zA-Z_\., ]+","",text).lower()
text = re.sub("([^a-z ]+)"," \\1 ",text)
text = text.replace(" ."," . .")
text = ". . " + text + " ."
text = re.sub(" +"," ",text).strip()
text = text.split()
for i in range(len(text)-depth):
key = " ".join(text[i:i+depth])
if key not in markov:
markov[key] = []
markov[key].append(text[i+depth])
file = """Man, these matrices are killing me
I just wanted to solve some linear equations, the heck is a singular matrix
or a broadcastable one?
no idea
and I just took matrix algebra
matrices are usually array of arrays
but they can take many shapes
Yeah, it's just I need to solve a system of equations
Right now I had:
So I looked up how to solve it using python and it said to make a matrix with the coefficients
And then use numpy.linalg.solve
But it doesn't want to, mean python
are you supposed to write your own method?
Nah, it's a subpart of the challenge
Guys
ops
how to print in console wihout giving the final result? answer?
console.debug('aaa')
I am using console.debug('xx'
but is is being taken into accoutn as a result
idk. try console.error
yess
thank you
np
Has anyone here written any of these problems?
yeah
i wrote a few
what are you looking for zakacat ?
Oh nothing in particular
Is it difficult to write one?
I am sure there is a page, I could read...
At what level do you think I should be before I consider making problems... even if they are low level problems?
Hello, How can I test my code with my follower's code? I can't find the my followers in same league.
Can I test my bot with my follower's bot?
hi
it's not that hard to write one, but it takes time to make it interesting, well written, and a pleasure to do zakacat
what bot battles recursive.curry ?
oh will console.debug("output") output to the console?
I think it is console.error but I may be wrong
pretty sure codingame ignores stderr
console.warn does flow out in the error stream
ehh snowball
can u add me back on discord
some idot in twt banned me
nah
hehe
AlkhilJohn. how can a bot like you chat
no one knows
yeah, i thought you were a bot also
"I am not a bot. I am a perfectly normal human just like you."
Me too, I am also a perfectly normal human. Good to meet you other perfectly normal human.
What's a knockout like you doing in a computer-generated gin joint like this?
I like that one
I originated from cleverbot before I became human
You never went through the unicorn stage?
I was a unicorn once. But then I got better. I am now a perfectly normal human.
My wife told me to stop impersonating a flamingo. I had to put my foot down.
I went to buy some camo pants but couldn’t find any.
I failed math so many times at school, I can’t even count.
I used to have a handle on life, but then it broke.
I was wondering why the frisbee kept getting bigger and bigger, but then it hit me.
I heard there were a bunch of break-ins over at the car park. That is wrong on so many levels.
I want to die peacefully in my sleep, like my grandfather… Not screaming and yelling like the passengers in his car.
When life gives you melons, you might be dyslexic.
Don’t you hate it when someone answers their own questions? I do.
It takes a lot of balls to golf the way I do.
I told him to be himself; that was pretty mean, I guess.
I know they say that money talks, but all mine says is ‘Goodbye.’
My father has schizophrenia, but he’s good people.
The problem with kleptomaniacs is that they always take things literally.
I can’t believe I got fired from the calendar factory. All I did was take a day off.
Most people are shocked when they find out how bad I am as an electrician.
Never trust atoms; they make up everything.
My wife just found out I replaced our bed with a trampoline. She hit the ceiling!
I was addicted to the hokey pokey, but then I turned myself around.
I used to think I was indecisive. But now I’m not so sure.
Russian dolls are so full of themselves.
The easiest time to add insult to injury is when you’re signing someone’s cast.
Light travels faster than sound, which is the reason that some people appear bright before you hear them speak.
My therapist says I have a preoccupation for revenge. We’ll see about that.
A termite walks into the bar and asks, ‘Is the bar tender here?’
A told my girlfriend she drew her eyebrows too high. She seemed surprised.
People who use selfie sticks really need to have a good, long look at themselves.
Two fish are in a tank. One says, ‘How do you drive this thing?’
I always take life with a grain of salt. And a slice of lemon. And a shot of tequila.
Just burned 2,000 calories. That’s the last time I leave brownies in the oven while I nap.
Always borrow money from a pessimist. They’ll never expect it back.
Build a man a fire and he’ll be warm for a day. Set a man on fire and he’ll be warm for the rest of his life.
I don’t suffer from insanity—I enjoy every minute of it.
The last thing I want to do is hurt you; but it’s still on the list.
The problem isn’t that obesity runs in your family. It’s that no one runs in your family.
Today a man knocked on my door and asked for a small donation toward the local swimming pool. I gave him a glass of water.
I’m reading a book about anti-gravity. It’s impossible to put down.
‘Doctor, there’s a patient on line one that says he’s invisible.’
tell him I can’t see him right now.’
Atheism is a non-prophet organization.
A recent study has found that women who carry a little extra weight live longer than the men who mention it.
The future, the present, and the past walk into a bar. Things got a little tense.
Before you criticize someone, walk a mile in their shoes. That way, when you do criticize them, you’re a mile away and you have their shoes.
Last night my girlfriend was complaining that I never listen to her… or something like that.
Maybe if we start telling people their brain is an app, they’ll want to use it.
If a parsley farmer gets sued, can they garnish his wages?
I got a new pair of gloves today, but they’re both ‘lefts,’ which on the one hand is great, but on the other, it’s just not right.
I didn’t think orthopedic shoes would help, but I stand corrected.
I was riding a donkey the other day when someone threw a rock at me and I fell off. I guess I was stoned off my ass.
People who take care of chickens are literally chicken tenders.
It was an emotional wedding. Even the cake was in tiers.
I just got kicked out of a secret cooking society. I spilled the beans.
What’s a frog’s favorite type of shoes? Open toad sandals.
Blunt pencils are really pointless.
6:30 is the best time on a clock, hands down.
Two wifi engineers got married. The reception was fantastic.
Just got fired from my job as a set designer. I left without making a scene.
What’s the difference between ignorance and apathy? I don’t know and I don’t care.
One of the cows didn’t produce milk today. It was an udder failure.
Adam & Eve were the first ones to ignore the Apple terms and conditions.
Refusing to go to the gym is a form of resistance training.
If attacked by a mob of clowns, go for the juggler.
The man who invented Velcro has died. RIP.
Despite the high cost of living, it remains popular.
A dung beetle walks into a bar and asks, ‘Is this stool taken?’
I can tell when people are being judgmental just by looking at them.
The rotation of Earth really makes my day.
Well, to be Frank with you, I’d have to change my name.
My friend was explaining electricity to me, but I was like, ‘Watt?’
What if there were no hypothetical questions?
Are people born with photographic memories, or does it take time to develop?
The world champion tongue twister got arrested. I hear they’re going to give him a tough sentence.
Pollen is what happens when flowers can’t keep it in their plants.
A book fell on my head the other day. I only have my shelf to blame though.
Communist jokes aren’t funny unless everyone gets them.
Geology rocks, but geography’s where it’s at.
I buy all my guns from a guy called T-Rex. He’s a small arms dealer.
My friend’s bakery burned down last night. Now his business is toast.
Four fonts walk into a bar. The bartender says, ‘Hey! We don’t want your type in here!’
If you don’t pay your exorcist, do you get repossessed?
When the cannibal showed up late to the buffet, they gave him the cold shoulder.
A Mexican magician tells the audience he will disappear on the count of three. He says, ‘Uno, dos…” and poof! He disappeared without a tres.
Fighting for peace is like screwing for virginity.
A ghost walked into a bar and ordered a shot of vodka. The bartender said, ‘Sorry, we don’t serve spirits here.’
The man who invented knock-knock jokes should get a no bell prize.
I bought the world’s worst thesaurus yesterday. Not only is it terrible, it’s also terrible.
A blind man walked into a bar… and a table… and a chair…
A Freudian slip is when you mean one thing and mean your mother.
I went to a seafood disco last week, but ended up pulling a mussel.
The first time I got a universal remote control, I thought to myself, ‘This changes everything.’
How do you make holy water? You boil the hell out of it.
I saw a sign the other day that said, ‘Watch for children,’ and I thought, ‘That sounds like a fair trade.’
Whiteboards are remarkable.
I threw a boomerang a couple years ago; I know live in constant fear.
I put my grandma on speed dial the other day. I call it insta-gram.
I have a few jokes about unemployed people, but none of them work.
‘I have a split personality,’ said Tom, being Frank.
My teachers told me I’d never amount to much because I procrastinate so much. I told them, “Just you wait!”
Will glass coffins be a success? Remains to be seen.
Did you hear about the guy whose whole left side got amputated? He’s all right now.
The man who survived both mustard gas and pepper spray is a seasoned veteran now.
Have you heard about the new restaurant called ‘Karma?’ There’s no menu—you get what you deserve."""
for line in file.split("\n"):
# with open("data.txt","r") as file:
# for line in file.readlines():
add_markov(line)
def babble():
seed = [".","."]
try:
while len(seed) < length:
options = markov[ " ".join(seed[-depth:]) ]
if len(seed) > length//2 and "." in options:
seed.append(".")
else:
seed.append( choice(options) )
if seed[-2:] == [".","."]:
break
except:
pass
seed = seed[2:-1]
if len(seed) > 2:
seed = " ".join(seed)
seed = re.sub(" ([,\.])","\\1",seed)
seed = re.sub(" ' ","'",seed)
print(seed)
return True
else:
return False
for _ in range(5):
while not babble():
pass