This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.pl
executable file
·272 lines (262 loc) · 8.72 KB
/
input.pl
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
% integrama(id_integrama, număr_linii, număr_coloane, listă_celule, dicționar).
integrama(0, 5, 5, [
( (0, 0), x),
( (0, 4), x),
( (1, 4), x),
( (2, 4), x),
( (3, 4), x),
( (4, 4), x),
( (0, 1), x),
( (1, 1), [
( 'Afirmativ', d),
( 'Negativ', j)
]),
( (0, 2), ('Al doilea număr', j)),
( (0, 3), ('Primii 3 din artă', j)),
( (1, 0), x),
( (2, 0), ('Din care plouă', d)),
( (3, 0), ('Când nu îmi amintesc', d)),
( (4, 0), x),
( (4, 1), x),
( (4, 2), x),
( (4, 3), x)
],
['DA', 'NU', 'NOR', 'ART', 'UIT', 'DOI']).
integrama(1, 11, 7, [
((0, 0), x),
((0, 1), x),
((0, 2), x),
((0, 3), x),
((0, 4), ('Cută pe față', j)),
((0, 5), x),
((0, 6), ('Aglomerare urbană', j)),
((1, 0), x),
((1, 1), x),
((1, 2), x),
((1, 3), ('24 de ore', j)),
((1, 5), x),
((2, 0), x),
((2, 1), ('ABCDEFG...', j)),
((2, 2), x),
((2, 5), x),
((3, 0), ('Secetos', d)),
((3, 5), x),
((4, 0), x),
((4, 2), x),
((4, 3), x),
((4, 4), x),
((4, 5), ('Ingineria Calculatoarelor', j)),
((5, 0), ('Buchet de', d)),
((5, 6), x),
((6, 0), x),
((6, 2), ('Al patrulea semn astrologic din zodiac', d)),
((6, 6), x),
((7, 0), x),
((7, 2), x),
((7, 3), x),
((7, 4), x),
((7, 5), x),
((7, 6), x),
((8, 0), x),
((8, 2), x),
((8, 3), x),
((8, 4), x),
((8, 5), x),
((8, 6), x),
((9, 0), ('Teoria Sistemelor', d)),
((9, 3), x),
((9, 4), x),
((9, 5), x),
((9, 6), x),
((10, 0), x),
((10, 1), x),
((10, 2), x),
((10, 3), x),
((10, 4), x),
((10, 5), x),
((10, 6), x)],
['TS', 'IC', 'FLORI', 'RAC', 'RID', 'ZI', 'ALFABET', 'ARID', 'ORAS',
'CAPRICORN', 'RM', 'RADICAL', 'GEMENI', 'SIMPSON', 'AN', 'MOUSE']).
integrama(2, 12, 9, [
((0, 0), x),
((0, 1), x),
((0, 2), ('Piure, prăjit, la cuptor', j)),
((0, 3), x),
((0, 4), ('A se zvânta', j)),
((0, 5), x),
((0, 6), ('Indivizi', j)),
((0, 7), x),
((0, 8), x),
((1, 0), x),
((1, 1), x),
((1, 3), ('Sora mărului', j)),
((1, 5), x),
((1, 7), ('Alina Voicu', j)),
((1, 8), x),
((2, 0), ('Fruct al căpșunului', d)),
((2, 8), x),
((3, 0), x),
((3, 1), ('Al patrulea semn astrologic din zodiac', d)),
((3, 5), ('Sud-Vest', d)),
((3, 8), x),
((4, 0), ('Drumuri prin oraș', d)),
((4, 7), ('Fruct cu coaja galbenă, bogat în Magneziu', j)),
((4, 8), x),
((5, 0), [('Scâncet', j), ('Reptilă amazoniană', d)]),
((5, 4), ('Reptile care sâsâie', j)),
((5, 5), x),
((5, 6), ('Cu Heliu', j)),
((5, 8), x),
((6, 1), x),
((6, 3), [('Primele litere din alfabet', j), ('de teracotă', d)]),
((6, 8), x),
((7, 1), x),
((7, 2), [('ionatan', j), ('Primele vocale', d)]),
((7, 5), ('2016', d)),
((7, 8), x),
((8, 0), ('Paravan pentru ploaie', d)),
((8, 8), x),
((9, 0), x),
((9, 1), x),
((9, 3), ('Cea mai puțin puternică piesă de șah', d)),
((9, 8), x),
((10, 0), ('Grizzly', d)),
((10, 5), ('Sfârșit de toamnă', d)),
((10, 8), x),
((11, 0), x),
((11, 1), x),
((11, 2), x),
((11, 3), x),
((11, 4), x),
((11, 5), x),
((11, 6), x),
((11, 7), x),
((11, 8), x)],
['CARTOF', 'USCA', 'INSI', 'PARA', 'AV', 'CAPSUNA', 'RAC', 'SV',
'STRAZI', 'BANANA', 'OF', 'LEU', 'SERPI', 'BALON', 'SOBA', 'MAR',
'UMBRELA', 'PION', 'URSI', 'NA', 'AN', 'AB', 'SANDWICH', 'MARTIPAN',
'INOT', 'MOUSE', 'ATOM', 'CREIER', 'PLAJA', 'MARE',
'SALAMANDRA', 'CROCODIL', 'REBUS', 'BOA', 'AE']).
integrama(3, 10, 10, [
((0, 0), x),
((0, 1), x),
((0, 2), x),
((0, 3), ('Mâncarea preferată a lui Popeye Marinarul', j)),
((0, 4), x),
((0, 5), ('Diodă luminiscentă', j)),
((0, 6), x),
((0, 7), x),
((0, 8), x),
((0, 9), x),
((1, 0), x),
((1, 1), ('Ansamblu de trăsături specifice unui grup social sau unei epoci', j)),
((1, 2), ('de spectacole', d)),
((1, 7), x),
((1, 8), x),
((1, 9), x),
((2, 0), x),
((2, 2), x),
((2, 4), x),
((2, 6), x),
((2, 7), ('Privilegiu acordat de papă, care conferă puteri excepționale', j)),
((2, 8), x),
((2, 9), x),
((3, 0), x),
((3, 2), ('Paprika', d)),
((3, 8), x),
((3, 9), x),
((4, 0), x),
((4, 2), x),
((4, 4), x),
((4, 5), ('Instrument de numărat cu ajutorul unor bile mobile', j)),
((4, 6), x),
((4, 8), x),
((4, 9), x),
((5, 0), ('Piatră prețioasă verde', d)),
((5, 8), x),
((5, 9), x),
((6, 0), x),
((6, 1), x),
((6, 2), x),
((6, 4), ('Traian Vuia', j)),
((6, 6), x),
((6, 8), x),
((6, 9), x),
((7, 0), x),
((7, 1), x),
((7, 2), x),
((7, 3), ('Scriu cu creta pe ea', d)),
((7, 9), x),
((8, 0), x),
((8, 1), x),
((8, 2), x),
((8, 3), x),
((8, 6), x),
((8, 8), x),
((8, 9), x),
((9, 0), x),
((9, 1), x),
((9, 2), x),
((9, 3), x),
((9, 4), x),
((9, 5), x),
((9, 6), x),
((9, 7), x),
((9, 8), x),
((9, 9), x)],
['SEMAFOR', 'DIAMANT', 'TURBULENT', 'KIWI', 'BEC', 'CACTUS', 'CAFEA',
'LAMPA', 'ASTRONAUT', 'IMPRIMANTA', 'INIMA', 'UNIVERS', 'AGRAFA',
'CUB', 'PIX', 'CAINE', 'PISICA', 'MAIMUTA', 'FUNDA',
'VOT', 'BANCA', 'AVION', 'TRABUC', 'PLAMAN', 'INIMA', 'CAFEA', 'CIOCOLATA',
'CEAI', 'RUBARBA', 'CANAPEA', 'FAZAN', 'ANTET', 'ETANOL', 'ICRE','SPANAC',
'LED', 'ETOS', 'SALA', 'INDULT', 'ABAC', 'ARDEI', 'TV',
'SMARALD', 'TABLA', 'JOS', 'TROTUAR', 'BROCOLI', 'CANOE', 'ROSIE']).
stress_test([
'ORNITORINC', 'YYY', 'ZZZ', 'MOSCOVA', 'BEIJING', 'TOKYO', 'CAIRO',
'KHARTOUM', 'BANGUI', 'NIAMEY', '12345678', '{}[](*)00', 'DOLAR', 'LIBYA',
'HASKELL', 'RULETA', 'ANIMAL', 'DESERT', 'EMAIL', 'TELEVIZOR', 'CARNIVOR',
'DEZOXIRIBONUCLEIC', 'CASTOR', 'CHROME', 'FRANTA', 'MADAGASCAR', 'ABECEDAR',
'CATASTROFAL', 'TORNADA', 'ZIMBABWE', 'WEYLAND', 'XENOMORPH', 'SOMALIA',
'SUDAN', 'LUMINA', '12345', '23451', '34521', '45321', '54321', '777777',
'[(-+__4%@', 'KAZAHSTAN', 'PAKISTAN', 'AFGANISTAN', 'UZBEKISTAN',
'TADJIKISTAN', 'BANGLADESH', '<<..>.>>,./??{', 'GRAFIT', 'TRAMVAI',
'CONGOLEZ', 'HARABABURA', 'MOGADISHU', 'CARDIOLOG',
'PNEUMOLOGIE', 'EEEEEEEE', 'TURCIA', 'FLAMINGO', 'IRIGATIE',
'INUNDATIE', 'MEDICINA', 'MUNTOS', 'ENCICLOPEDIE', 'BEZEA', 'AUSTRALIA',
'<>V.B,(G,E)?!', 'CREVETE', 'CRISTAL', 'URANGUTAN', 'CIMPANZEU', 'GORILA',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'BABUIN', 'FOCAR', 'FURNICAR', 'CASTRAVETE', 'AES',
'LONGITUDINE', 'LATITUDINE', 'EVEREST', 'BACKTRACKING', 'FIZIOTERAPIE',
'PLASMA', 'SOARE', 'MARTE', 'NEPTUN', 'PLUTO', 'CALVAR', 'HOMAR', 'RAR',
'JUBILEAZA', 'ZANZIBAR', 'ZAMBIA', 'TANZANIA', 'PIATRA', 'BARTOLOMEU',
'PERFECTIUNE', 'PATISERIE', 'DECOFEINIZATA', 'LITRU', 'MUNTE',
'CALIFICATIV', 'MASINARIE', 'CALCULATOR', 'GROAPA', 'LOPATA', 'VIESPE',
'MALDIVE', 'PANTALONI', 'FURNICATURI', 'COVID', 'SUCULENT', 'BARBAR',
'ANANAS', 'MANGO', 'MOFTUROS', 'LISTA', 'DUBAI', 'ALGORITM', 'URECHI',
'CIUPERCI', 'FERMENTARE', '980', '098', '890', '809', '089', '908',
'100000', '010000', 'ISLAM', 'CRESTINISM', 'IUDAISM', 'BUDISM', 'HINDUISM',
'PIPER', 'SARAT', 'ATMOSFERA', 'RAVAGII', 'BRAZILIA', 'PARAGUAY', 'URUGUAY',
'ARGENTINA', 'CHILE', 'COLUMBIA', 'GUYANA', 'PANAMA', 'NICARAGUA', 'MEXIC',
'CANADA', 'HAWAII', 'FILIPINE', 'OREGON', 'PLASTILINA', 'RANDOM', 'STEAM',
'CONSULTATIE', 'CONGREGATIE', 'POLITICA', 'DIACRITICE', 'TROMBOZA'
]).
stress_test2(Dict) :- words(11, Dict).
words(0, []) :- !.
words(Len, Dict) :-
Len > 0,
findall(Word, (word(Len, WL), string_chars(Word, WL)), DictLen),
L is Len - 1, words(L, DictL),
append(DictLen, DictL, Dict).
word(0, []) :- !.
word(Len, [Char|Word]) :- Len > 0, L is Len - 1, L >= 0, word(L, Word),
string_chars("ABCDEF", Letters), member(Char, Letters).
letters(['A', 'B', 'C', 'D', 'E', 'F']).
words2(0, [[]]) :- !.
words2(Len, Dict) :-
Len > 0, L is Len - 1,
words2(L, Words),
letters(Letters),
findall([Let|W], (member(Let, Letters), member(W, Words)), Dict).
words2a(Len, Dict) :- words2(Len, Lists),
findall(String, (member(W, Lists), atom_chars(String, W)), Dict).