Dogeku 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +39 -0
- data/app/Historique/Action.rb +29 -0
- data/app/Historique/ChangerCase.rb +44 -0
- data/app/Historique/HistoriqueAction.rb +114 -0
- data/app/components/CaseDessin.rb +325 -0
- data/app/components/GrilleDessin.rb +235 -0
- data/app/components/Header.rb +194 -0
- data/app/config/app.yml +0 -0
- data/app/config/database.yml +2 -0
- data/app/controller/ApprentissageControleur.rb +75 -0
- data/app/controller/ChargerControleur.rb +41 -0
- data/app/controller/JeuLibreControleur.rb +244 -0
- data/app/controller/MenuControleur.rb +57 -0
- data/app/controller/NiveauControleur.rb +54 -0
- data/app/controller/NouvellePartieControleur.rb +34 -0
- data/app/controller/PrincipaleControleur.rb +30 -0
- data/app/controller/PseudoControleur.rb +95 -0
- data/app/controller/ReglagesControleur.rb +86 -0
- data/app/controller/ReglesControleur.rb +34 -0
- data/app/controller/ScoresControleur.rb +42 -0
- data/app/controller/StatistiquesControleur.rb +64 -0
- data/app/core/Conf.rb +26 -0
- data/app/core/Controller.rb +180 -0
- data/app/core/Core.rb +186 -0
- data/app/core/Model.rb +159 -0
- data/app/core/View.rb +56 -0
- data/app/db/main.sqlite3 +0 -0
- data/app/model/Configuration.rb +180 -0
- data/app/model/Grille.rb +180 -0
- data/app/model/Jeu.rb +74 -0
- data/app/model/Score.rb +100 -0
- data/app/model/Utilisateur.rb +113 -0
- data/app/utils/DSubset.rb +98 -0
- data/app/utils/Generateur.rb +171 -0
- data/app/utils/HPTriple.rb +75 -0
- data/app/utils/Peche.rb +46 -0
- data/app/utils/SCandidate.rb +86 -0
- data/app/utils/SCell.rb +73 -0
- data/app/utils/Technique.rb +202 -0
- data/app/utils/TechniqueUsine.rb +25 -0
- data/app/utils/XWing.rb +203 -0
- data/app/view/Fenetre.rb +424 -0
- data/app/view/FenetreApprentissage.rb +272 -0
- data/app/view/FenetreCharger.rb +31 -0
- data/app/view/FenetreJeuLibre.rb +468 -0
- data/app/view/FenetreMenu.rb +198 -0
- data/app/view/FenetreNiveau.rb +105 -0
- data/app/view/FenetreNouvellePartie.rb +92 -0
- data/app/view/FenetrePrincipale.rb +45 -0
- data/app/view/FenetrePseudo.rb +115 -0
- data/app/view/FenetreReglages.rb +209 -0
- data/app/view/FenetreRegles.rb +111 -0
- data/app/view/FenetreScores.rb +120 -0
- data/app/view/FenetreStatistiques.rb +134 -0
- data/assets/css/style.css +69 -0
- data/assets/img/eraser.png +0 -0
- data/assets/img/fond.jpg +0 -0
- data/assets/img/iconApp.png +0 -0
- data/assets/img/logoS.jpeg +0 -0
- data/assets/img/sudokuIntro.jpg +0 -0
- data/assets/img/user.png +0 -0
- data/bin/dogeku +19 -0
- data/doc/Action.html +309 -0
- data/doc/ApprentissageControleur.html +568 -0
- data/doc/CaseDessin.html +2405 -0
- data/doc/ChangerCase.html +405 -0
- data/doc/ChargerControleur.html +342 -0
- data/doc/Conf.html +378 -0
- data/doc/Configuration.html +1115 -0
- data/doc/Controller.html +1008 -0
- data/doc/Core.html +1191 -0
- data/doc/DSubset.html +647 -0
- data/doc/Fenetre.html +2631 -0
- data/doc/FenetreApprentissage.html +1175 -0
- data/doc/FenetreCharger.html +343 -0
- data/doc/FenetreJeuLibre.html +1859 -0
- data/doc/FenetreMenu.html +900 -0
- data/doc/FenetreNiveau.html +626 -0
- data/doc/FenetreNouvellePartie.html +602 -0
- data/doc/FenetrePrincipale.html +371 -0
- data/doc/FenetrePseudo.html +695 -0
- data/doc/FenetreReglages.html +946 -0
- data/doc/FenetreRegles.html +636 -0
- data/doc/FenetreScores.html +650 -0
- data/doc/FenetreStatistiques.html +672 -0
- data/doc/Generateur.html +1015 -0
- data/doc/Grille.html +1348 -0
- data/doc/GrilleDessin.html +1281 -0
- data/doc/HPTriple.html +593 -0
- data/doc/Header.html +1253 -0
- data/doc/HistoriqueAction.html +792 -0
- data/doc/Jeu.html +923 -0
- data/doc/JeuLibreControleur.html +1445 -0
- data/doc/MenuControleur.html +522 -0
- data/doc/Model.html +996 -0
- data/doc/NiveauControleur.html +451 -0
- data/doc/NouvellePartieControleur.html +330 -0
- data/doc/Peche.html +396 -0
- data/doc/PrincipaleControleur.html +320 -0
- data/doc/PseudoControleur.html +695 -0
- data/doc/ReglagesControleur.html +747 -0
- data/doc/ReglesControleur.html +330 -0
- data/doc/SCandidate.html +617 -0
- data/doc/SCell.html +587 -0
- data/doc/Score.html +926 -0
- data/doc/ScoresControleur.html +346 -0
- data/doc/StatistiquesControleur.html +390 -0
- data/doc/Technique.html +543 -0
- data/doc/TechniqueUsine.html +252 -0
- data/doc/Utilisateur.html +806 -0
- data/doc/View.html +844 -0
- data/doc/XWing.html +1031 -0
- data/doc/_index.html +478 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +492 -0
- data/doc/file.README.html +141 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +141 -0
- data/doc/js/app.js +243 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +2523 -0
- data/doc/top-level-namespace.html +112 -0
- data/test/Generateur/grilleCorrecte.rb +198 -0
- data/test/Model/scoreCorrecte.rb +55 -0
- data/test/Model/utilisateurCorrecte.rb +68 -0
- data/test/test_helper.rb +2 -0
- data/test/unitTest.rb +72 -0
- metadata +187 -0
data/doc/XWing.html
ADDED
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Class: XWing
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.8
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
pathId = "XWing";
|
|
19
|
+
relpath = '';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
|
24
|
+
|
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div class="nav_wrap">
|
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
|
32
|
+
<div id="resizer"></div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="main" tabindex="-1">
|
|
36
|
+
<div id="header">
|
|
37
|
+
<div id="menu">
|
|
38
|
+
|
|
39
|
+
<a href="_index.html">Index (X)</a> »
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<span class="title">XWing</span>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div id="search">
|
|
47
|
+
|
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
|
49
|
+
href="class_list.html">
|
|
50
|
+
|
|
51
|
+
<svg width="24" height="24">
|
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
</svg>
|
|
56
|
+
</a>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
<div class="clear"></div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div id="content"><h1>Class: XWing
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Technique.html" title="Technique (class)">Technique</a></span></span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Technique.html" title="Technique (class)">Technique</a></span></li>
|
|
78
|
+
|
|
79
|
+
<li class="next">XWing</li>
|
|
80
|
+
|
|
81
|
+
</ul>
|
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
83
|
+
|
|
84
|
+
</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dt>Defined in:</dt>
|
|
99
|
+
<dd>app/utils/XWing.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
|
105
|
+
<div class="discussion">
|
|
106
|
+
|
|
107
|
+
<p>Technique X-wing.</p>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tags">
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<h2>
|
|
124
|
+
Class Method Summary
|
|
125
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
126
|
+
</h2>
|
|
127
|
+
|
|
128
|
+
<ul class="summary">
|
|
129
|
+
|
|
130
|
+
<li class="public ">
|
|
131
|
+
<span class="summary_signature">
|
|
132
|
+
|
|
133
|
+
<a href="#creer-class_method" title="creer (class method)">.<strong>creer</strong> ⇒ Object </a>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</span>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<span class="summary_desc"><div class='inline'>
|
|
148
|
+
<p>Constructeur de la classe SCell.</p>
|
|
149
|
+
</div></span>
|
|
150
|
+
|
|
151
|
+
</li>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
</ul>
|
|
155
|
+
|
|
156
|
+
<h2>
|
|
157
|
+
Instance Method Summary
|
|
158
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
159
|
+
</h2>
|
|
160
|
+
|
|
161
|
+
<ul class="summary">
|
|
162
|
+
|
|
163
|
+
<li class="public ">
|
|
164
|
+
<span class="summary_signature">
|
|
165
|
+
|
|
166
|
+
<a href="#cptIndice-instance_method" title="#cptIndice (instance method)">#<strong>cptIndice</strong>(lincol, i) ⇒ Object </a>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
</span>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<span class="summary_desc"><div class='inline'>
|
|
181
|
+
<p>Compte le nombre d'indices.</p>
|
|
182
|
+
</div></span>
|
|
183
|
+
|
|
184
|
+
</li>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
<li class="public ">
|
|
188
|
+
<span class="summary_signature">
|
|
189
|
+
|
|
190
|
+
<a href="#findLineForIndice-instance_method" title="#findLineForIndice (instance method)">#<strong>findLineForIndice</strong>(i) ⇒ Object </a>
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
</span>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<span class="summary_desc"><div class='inline'>
|
|
205
|
+
<p>Recherche une ligne qui remplit la condition suivante : que seulement 2
|
|
206
|
+
cases sur les 9 aient un indice commun que les autres n'ont pas.</p>
|
|
207
|
+
</div></span>
|
|
208
|
+
|
|
209
|
+
</li>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
<li class="public ">
|
|
213
|
+
<span class="summary_signature">
|
|
214
|
+
|
|
215
|
+
<a href="#indexIndice-instance_method" title="#indexIndice (instance method)">#<strong>indexIndice</strong>(ligne, indice) ⇒ Object </a>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
</span>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
<span class="summary_desc"><div class='inline'>
|
|
230
|
+
<p>Cherche les emplacements d'un même indice dans une ligne (numéro de
|
|
231
|
+
colone).</p>
|
|
232
|
+
</div></span>
|
|
233
|
+
|
|
234
|
+
</li>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
<li class="public ">
|
|
238
|
+
<span class="summary_signature">
|
|
239
|
+
|
|
240
|
+
<a href="#isSquare-instance_method" title="#isSquare (instance method)">#<strong>isSquare</strong>(lignea, ligneb, indice) ⇒ Object </a>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
</span>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
<span class="summary_desc"><div class='inline'>
|
|
255
|
+
<p>Vérifie que les indices aux lignes trouvées forment un rectangle.</p>
|
|
256
|
+
</div></span>
|
|
257
|
+
|
|
258
|
+
</li>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
<li class="public ">
|
|
262
|
+
<span class="summary_signature">
|
|
263
|
+
|
|
264
|
+
<a href="#rotation-instance_method" title="#rotation (instance method)">#<strong>rotation</strong>(grille) ⇒ Object </a>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
</span>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<span class="summary_desc"><div class='inline'>
|
|
279
|
+
<p>Retourne la grille.</p>
|
|
280
|
+
</div></span>
|
|
281
|
+
|
|
282
|
+
</li>
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
<li class="public ">
|
|
286
|
+
<span class="summary_signature">
|
|
287
|
+
|
|
288
|
+
<a href="#solution-instance_method" title="#solution (instance method)">#<strong>solution</strong>(grille) ⇒ Object </a>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
</span>
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<span class="summary_desc"><div class='inline'>
|
|
303
|
+
<p>Recherche une solution pour la technique utilisée.</p>
|
|
304
|
+
</div></span>
|
|
305
|
+
|
|
306
|
+
</li>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
</ul>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Technique.html" title="Technique (class)">Technique</a></span></h3>
|
|
322
|
+
<p class="inherited"><span class='object_link'><a href="Technique.html#combienEtape-instance_method" title="Technique#combienEtape (method)">#combienEtape</a></span>, <span class='object_link'><a href="Technique.html#etape-instance_method" title="Technique#etape (method)">#etape</a></span></p>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<div id="class_method_details" class="method_details_list">
|
|
326
|
+
<h2>Class Method Details</h2>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
<div class="method_details first">
|
|
330
|
+
<h3 class="signature first" id="creer-class_method">
|
|
331
|
+
|
|
332
|
+
.<strong>creer</strong> ⇒ <tt>Object</tt>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
</h3><div class="docstring">
|
|
339
|
+
<div class="discussion">
|
|
340
|
+
|
|
341
|
+
<p>Constructeur de la classe SCell</p>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
<div class="tags">
|
|
347
|
+
|
|
348
|
+
<p class="tag_title">Returns:</p>
|
|
349
|
+
<ul class="return">
|
|
350
|
+
|
|
351
|
+
<li>
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
<span class='type'></span>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
<div class='inline'>
|
|
360
|
+
<p>Une instance de la classe SCell</p>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
</li>
|
|
364
|
+
|
|
365
|
+
</ul>
|
|
366
|
+
|
|
367
|
+
</div><table class="source_code">
|
|
368
|
+
<tr>
|
|
369
|
+
<td>
|
|
370
|
+
<pre class="lines">
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
21
|
|
374
|
+
22
|
|
375
|
+
23</pre>
|
|
376
|
+
</td>
|
|
377
|
+
<td>
|
|
378
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 21</span>
|
|
379
|
+
|
|
380
|
+
<span class='kw'>def</span> <span class='const'><span class='object_link'><a href="" title="XWing (class)">XWing</a></span></span><span class='period'>.</span><span class='id identifier rubyid_creer'>creer</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
381
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
382
|
+
<span class='kw'>end</span></pre>
|
|
383
|
+
</td>
|
|
384
|
+
</tr>
|
|
385
|
+
</table>
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div id="instance_method_details" class="method_details_list">
|
|
391
|
+
<h2>Instance Method Details</h2>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<div class="method_details first">
|
|
395
|
+
<h3 class="signature first" id="cptIndice-instance_method">
|
|
396
|
+
|
|
397
|
+
#<strong>cptIndice</strong>(lincol, i) ⇒ <tt>Object</tt>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
</h3><div class="docstring">
|
|
404
|
+
<div class="discussion">
|
|
405
|
+
|
|
406
|
+
<p>Compte le nombre d'indices</p>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
<div class="tags">
|
|
412
|
+
<p class="tag_title">Parameters:</p>
|
|
413
|
+
<ul class="param">
|
|
414
|
+
|
|
415
|
+
<li>
|
|
416
|
+
|
|
417
|
+
<span class='name'>lincol</span>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
<span class='type'></span>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
—
|
|
425
|
+
<div class='inline'>
|
|
426
|
+
<p>The lincol</p>
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
</li>
|
|
430
|
+
|
|
431
|
+
<li>
|
|
432
|
+
|
|
433
|
+
<span class='name'>i</span>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<span class='type'></span>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
</li>
|
|
441
|
+
|
|
442
|
+
</ul>
|
|
443
|
+
|
|
444
|
+
<p class="tag_title">Returns:</p>
|
|
445
|
+
<ul class="return">
|
|
446
|
+
|
|
447
|
+
<li>
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
<span class='type'></span>
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
<div class='inline'>
|
|
456
|
+
<p>compteurS</p>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
</li>
|
|
460
|
+
|
|
461
|
+
</ul>
|
|
462
|
+
|
|
463
|
+
</div><table class="source_code">
|
|
464
|
+
<tr>
|
|
465
|
+
<td>
|
|
466
|
+
<pre class="lines">
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
49
|
|
470
|
+
50
|
|
471
|
+
51
|
|
472
|
+
52
|
|
473
|
+
53
|
|
474
|
+
54
|
|
475
|
+
55
|
|
476
|
+
56
|
|
477
|
+
57
|
|
478
|
+
58
|
|
479
|
+
59</pre>
|
|
480
|
+
</td>
|
|
481
|
+
<td>
|
|
482
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 49</span>
|
|
483
|
+
|
|
484
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cptIndice'>cptIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_lincol'>lincol</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span>
|
|
485
|
+
|
|
486
|
+
<span class='id identifier rubyid_cpt'>cpt</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
487
|
+
|
|
488
|
+
<span class='id identifier rubyid_lincol'>lincol</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_elem'>elem</span><span class='op'>|</span>
|
|
489
|
+
<span class='kw'>if</span><span class='lparen'>(</span> <span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span> <span class='rparen'>)</span>
|
|
490
|
+
<span class='id identifier rubyid_cpt'>cpt</span> <span class='op'>+=</span> <span class='int'>1</span>
|
|
491
|
+
<span class='kw'>end</span>
|
|
492
|
+
<span class='kw'>end</span>
|
|
493
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_cpt'>cpt</span>
|
|
494
|
+
<span class='kw'>end</span></pre>
|
|
495
|
+
</td>
|
|
496
|
+
</tr>
|
|
497
|
+
</table>
|
|
498
|
+
</div>
|
|
499
|
+
|
|
500
|
+
<div class="method_details ">
|
|
501
|
+
<h3 class="signature " id="findLineForIndice-instance_method">
|
|
502
|
+
|
|
503
|
+
#<strong>findLineForIndice</strong>(i) ⇒ <tt>Object</tt>
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
</h3><div class="docstring">
|
|
510
|
+
<div class="discussion">
|
|
511
|
+
|
|
512
|
+
<p>Recherche une ligne qui remplit la condition suivante : que seulement 2
|
|
513
|
+
cases sur les 9 aient un indice commun que les autres n'ont pas.</p>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
</div>
|
|
517
|
+
</div>
|
|
518
|
+
<div class="tags">
|
|
519
|
+
|
|
520
|
+
<p class="tag_title">Returns:</p>
|
|
521
|
+
<ul class="return">
|
|
522
|
+
|
|
523
|
+
<li>
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<span class='type'></span>
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
<div class='inline'>
|
|
532
|
+
<p>res une liste de 2 lignes qui remplissent les conditions pour le même
|
|
533
|
+
indice, nil sinon.</p>
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
</li>
|
|
537
|
+
|
|
538
|
+
</ul>
|
|
539
|
+
|
|
540
|
+
</div><table class="source_code">
|
|
541
|
+
<tr>
|
|
542
|
+
<td>
|
|
543
|
+
<pre class="lines">
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
69
|
|
547
|
+
70
|
|
548
|
+
71
|
|
549
|
+
72
|
|
550
|
+
73
|
|
551
|
+
74
|
|
552
|
+
75
|
|
553
|
+
76
|
|
554
|
+
77
|
|
555
|
+
78
|
|
556
|
+
79
|
|
557
|
+
80
|
|
558
|
+
81
|
|
559
|
+
82
|
|
560
|
+
83
|
|
561
|
+
84</pre>
|
|
562
|
+
</td>
|
|
563
|
+
<td>
|
|
564
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 69</span>
|
|
565
|
+
|
|
566
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_findLineForIndice'>findLineForIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span>
|
|
567
|
+
|
|
568
|
+
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
569
|
+
|
|
570
|
+
<span class='ivar'>@grilleIndice</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
|
|
571
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_cptIndice'>cptIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='int'>2</span><span class='rparen'>)</span>
|
|
572
|
+
<span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span>
|
|
573
|
+
<span class='kw'>end</span>
|
|
574
|
+
<span class='kw'>end</span>
|
|
575
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='op'>>=</span> <span class='int'>2</span><span class='rparen'>)</span>
|
|
576
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>res : </span><span class='tstring_end'>'</span></span><span class='op'>+</span><span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> * * * * * </span><span class='tstring_end'>'</span></span><span class='op'>+</span><span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
577
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='id identifier rubyid_res'>res</span><span class='comma'>,</span> <span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
|
|
578
|
+
<span class='kw'>end</span>
|
|
579
|
+
|
|
580
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
|
581
|
+
<span class='kw'>end</span></pre>
|
|
582
|
+
</td>
|
|
583
|
+
</tr>
|
|
584
|
+
</table>
|
|
585
|
+
</div>
|
|
586
|
+
|
|
587
|
+
<div class="method_details ">
|
|
588
|
+
<h3 class="signature " id="indexIndice-instance_method">
|
|
589
|
+
|
|
590
|
+
#<strong>indexIndice</strong>(ligne, indice) ⇒ <tt>Object</tt>
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
</h3><div class="docstring">
|
|
597
|
+
<div class="discussion">
|
|
598
|
+
|
|
599
|
+
<p>Cherche les emplacements d'un même indice dans une ligne (numéro de
|
|
600
|
+
colone)</p>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
<div class="tags">
|
|
606
|
+
|
|
607
|
+
<p class="tag_title">Returns:</p>
|
|
608
|
+
<ul class="return">
|
|
609
|
+
|
|
610
|
+
<li>
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
<span class='type'></span>
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
<div class='inline'>
|
|
619
|
+
<p>index une liste des numéros de colone</p>
|
|
620
|
+
</div>
|
|
621
|
+
|
|
622
|
+
</li>
|
|
623
|
+
|
|
624
|
+
</ul>
|
|
625
|
+
|
|
626
|
+
</div><table class="source_code">
|
|
627
|
+
<tr>
|
|
628
|
+
<td>
|
|
629
|
+
<pre class="lines">
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
93
|
|
633
|
+
94
|
|
634
|
+
95
|
|
635
|
+
96
|
|
636
|
+
97
|
|
637
|
+
98
|
|
638
|
+
99
|
|
639
|
+
100
|
|
640
|
+
101
|
|
641
|
+
102
|
|
642
|
+
103
|
|
643
|
+
104</pre>
|
|
644
|
+
</td>
|
|
645
|
+
<td>
|
|
646
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 93</span>
|
|
647
|
+
|
|
648
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_indexIndice'>indexIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_ligne'>ligne</span><span class='comma'>,</span> <span class='id identifier rubyid_indice'>indice</span><span class='rparen'>)</span>
|
|
649
|
+
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
650
|
+
|
|
651
|
+
<span class='ivar'>@grilleIndice</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span>
|
|
652
|
+
<span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_elem'>elem</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
|
|
653
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_elem'>elem</span><span class='lbracket'>[</span><span class='id identifier rubyid_indice'>indice</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
654
|
+
<span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span>
|
|
655
|
+
<span class='kw'>end</span>
|
|
656
|
+
<span class='kw'>end</span>
|
|
657
|
+
<span class='kw'>end</span>
|
|
658
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_index'>index</span>
|
|
659
|
+
<span class='kw'>end</span></pre>
|
|
660
|
+
</td>
|
|
661
|
+
</tr>
|
|
662
|
+
</table>
|
|
663
|
+
</div>
|
|
664
|
+
|
|
665
|
+
<div class="method_details ">
|
|
666
|
+
<h3 class="signature " id="isSquare-instance_method">
|
|
667
|
+
|
|
668
|
+
#<strong>isSquare</strong>(lignea, ligneb, indice) ⇒ <tt>Object</tt>
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
</h3><div class="docstring">
|
|
675
|
+
<div class="discussion">
|
|
676
|
+
|
|
677
|
+
<p>Vérifie que les indices aux lignes trouvées forment un rectangle.</p>
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
</div>
|
|
681
|
+
</div>
|
|
682
|
+
<div class="tags">
|
|
683
|
+
<p class="tag_title">Parameters:</p>
|
|
684
|
+
<ul class="param">
|
|
685
|
+
|
|
686
|
+
<li>
|
|
687
|
+
|
|
688
|
+
<span class='name'>lignea</span>
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
<span class='type'></span>
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
—
|
|
696
|
+
<div class='inline'>
|
|
697
|
+
<p>et ligneb des numero de ligne et</p>
|
|
698
|
+
</div>
|
|
699
|
+
|
|
700
|
+
</li>
|
|
701
|
+
|
|
702
|
+
<li>
|
|
703
|
+
|
|
704
|
+
<span class='name'>indice</span>
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
<span class='type'></span>
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
—
|
|
712
|
+
<div class='inline'>
|
|
713
|
+
<p>Le nombre recherché.</p>
|
|
714
|
+
</div>
|
|
715
|
+
|
|
716
|
+
</li>
|
|
717
|
+
|
|
718
|
+
</ul>
|
|
719
|
+
|
|
720
|
+
<p class="tag_title">Returns:</p>
|
|
721
|
+
<ul class="return">
|
|
722
|
+
|
|
723
|
+
<li>
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
<span class='type'></span>
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
<div class='inline'>
|
|
732
|
+
<p>true si cela donne un carré, nil sinon.</p>
|
|
733
|
+
</div>
|
|
734
|
+
|
|
735
|
+
</li>
|
|
736
|
+
|
|
737
|
+
</ul>
|
|
738
|
+
|
|
739
|
+
</div><table class="source_code">
|
|
740
|
+
<tr>
|
|
741
|
+
<td>
|
|
742
|
+
<pre class="lines">
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
116
|
|
746
|
+
117
|
|
747
|
+
118
|
|
748
|
+
119
|
|
749
|
+
120
|
|
750
|
+
121
|
|
751
|
+
122
|
|
752
|
+
123
|
|
753
|
+
124
|
|
754
|
+
125
|
|
755
|
+
126
|
|
756
|
+
127</pre>
|
|
757
|
+
</td>
|
|
758
|
+
<td>
|
|
759
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 116</span>
|
|
760
|
+
|
|
761
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_isSquare'>isSquare</span><span class='lparen'>(</span><span class='id identifier rubyid_lignea'>lignea</span><span class='comma'>,</span> <span class='id identifier rubyid_ligneb'>ligneb</span><span class='comma'>,</span> <span class='id identifier rubyid_indice'>indice</span><span class='rparen'>)</span>
|
|
762
|
+
<span class='id identifier rubyid_couplea'>couplea</span> <span class='op'>=</span> <span class='id identifier rubyid_indexIndice'>indexIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_lignea'>lignea</span><span class='comma'>,</span> <span class='id identifier rubyid_indice'>indice</span><span class='rparen'>)</span>
|
|
763
|
+
<span class='id identifier rubyid_coupleb'>coupleb</span> <span class='op'>=</span> <span class='id identifier rubyid_indexIndice'>indexIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_ligneb'>ligneb</span><span class='comma'>,</span> <span class='id identifier rubyid_indice'>indice</span><span class='rparen'>)</span>
|
|
764
|
+
|
|
765
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>aie aie aie</span><span class='tstring_end'>"</span></span>
|
|
766
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>couple a : </span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_couplea'>couplea</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='op'>+</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> ****</span><span class='tstring_end'>"</span></span>
|
|
767
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_coupleb'>coupleb</span>
|
|
768
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_couplea'>couplea</span> <span class='op'>==</span> <span class='id identifier rubyid_coupleb'>coupleb</span><span class='rparen'>)</span>
|
|
769
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_couplea'>couplea</span>
|
|
770
|
+
<span class='kw'>end</span>
|
|
771
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
|
772
|
+
<span class='kw'>end</span></pre>
|
|
773
|
+
</td>
|
|
774
|
+
</tr>
|
|
775
|
+
</table>
|
|
776
|
+
</div>
|
|
777
|
+
|
|
778
|
+
<div class="method_details ">
|
|
779
|
+
<h3 class="signature " id="rotation-instance_method">
|
|
780
|
+
|
|
781
|
+
#<strong>rotation</strong>(grille) ⇒ <tt>Object</tt>
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
</h3><div class="docstring">
|
|
788
|
+
<div class="discussion">
|
|
789
|
+
|
|
790
|
+
<p>Retourne la grille</p>
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
</div>
|
|
794
|
+
</div>
|
|
795
|
+
<div class="tags">
|
|
796
|
+
<p class="tag_title">Parameters:</p>
|
|
797
|
+
<ul class="param">
|
|
798
|
+
|
|
799
|
+
<li>
|
|
800
|
+
|
|
801
|
+
<span class='name'>grille</span>
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
<span class='type'></span>
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
—
|
|
809
|
+
<div class='inline'>
|
|
810
|
+
<p>The grille</p>
|
|
811
|
+
</div>
|
|
812
|
+
|
|
813
|
+
</li>
|
|
814
|
+
|
|
815
|
+
</ul>
|
|
816
|
+
|
|
817
|
+
<p class="tag_title">Returns:</p>
|
|
818
|
+
<ul class="return">
|
|
819
|
+
|
|
820
|
+
<li>
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
<span class='type'></span>
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
<div class='inline'>
|
|
829
|
+
<p>la grille</p>
|
|
830
|
+
</div>
|
|
831
|
+
|
|
832
|
+
</li>
|
|
833
|
+
|
|
834
|
+
</ul>
|
|
835
|
+
|
|
836
|
+
</div><table class="source_code">
|
|
837
|
+
<tr>
|
|
838
|
+
<td>
|
|
839
|
+
<pre class="lines">
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
32
|
|
843
|
+
33
|
|
844
|
+
34
|
|
845
|
+
35
|
|
846
|
+
36
|
|
847
|
+
37
|
|
848
|
+
38
|
|
849
|
+
39</pre>
|
|
850
|
+
</td>
|
|
851
|
+
<td>
|
|
852
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 32</span>
|
|
853
|
+
|
|
854
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_rotation'>rotation</span><span class='lparen'>(</span><span class='id identifier rubyid_grille'>grille</span><span class='rparen'>)</span>
|
|
855
|
+
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
856
|
+
|
|
857
|
+
<span class='int'>0</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span><span class='lparen'>(</span><span class='int'>8</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_n'>n</span><span class='op'>|</span>
|
|
858
|
+
<span class='id identifier rubyid_res'>res</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_ligne'>ligne</span><span class='lparen'>(</span><span class='id identifier rubyid_grille'>grille</span><span class='comma'>,</span> <span class='id identifier rubyid_n'>n</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
859
|
+
<span class='kw'>end</span>
|
|
860
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_res'>res</span>
|
|
861
|
+
<span class='kw'>end</span></pre>
|
|
862
|
+
</td>
|
|
863
|
+
</tr>
|
|
864
|
+
</table>
|
|
865
|
+
</div>
|
|
866
|
+
|
|
867
|
+
<div class="method_details ">
|
|
868
|
+
<h3 class="signature " id="solution-instance_method">
|
|
869
|
+
|
|
870
|
+
#<strong>solution</strong>(grille) ⇒ <tt>Object</tt>
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
</h3><div class="docstring">
|
|
877
|
+
<div class="discussion">
|
|
878
|
+
|
|
879
|
+
<p>Recherche une solution pour la technique utilisée</p>
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
</div>
|
|
883
|
+
</div>
|
|
884
|
+
<div class="tags">
|
|
885
|
+
<p class="tag_title">Parameters:</p>
|
|
886
|
+
<ul class="param">
|
|
887
|
+
|
|
888
|
+
<li>
|
|
889
|
+
|
|
890
|
+
<span class='name'>grille</span>
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
<span class='type'></span>
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
—
|
|
898
|
+
<div class='inline'>
|
|
899
|
+
<p>La grille</p>
|
|
900
|
+
</div>
|
|
901
|
+
|
|
902
|
+
</li>
|
|
903
|
+
|
|
904
|
+
</ul>
|
|
905
|
+
|
|
906
|
+
<p class="tag_title">Returns:</p>
|
|
907
|
+
<ul class="return">
|
|
908
|
+
|
|
909
|
+
<li>
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
<span class='type'></span>
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
<div class='inline'>
|
|
918
|
+
<p>Les informations pour aider l'utilisateur, ou nul si la méthode ne
|
|
919
|
+
trouve rien</p>
|
|
920
|
+
</div>
|
|
921
|
+
|
|
922
|
+
</li>
|
|
923
|
+
|
|
924
|
+
</ul>
|
|
925
|
+
|
|
926
|
+
</div><table class="source_code">
|
|
927
|
+
<tr>
|
|
928
|
+
<td>
|
|
929
|
+
<pre class="lines">
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
139
|
|
933
|
+
140
|
|
934
|
+
141
|
|
935
|
+
142
|
|
936
|
+
143
|
|
937
|
+
144
|
|
938
|
+
145
|
|
939
|
+
146
|
|
940
|
+
147
|
|
941
|
+
148
|
|
942
|
+
149
|
|
943
|
+
150
|
|
944
|
+
151
|
|
945
|
+
152
|
|
946
|
+
153
|
|
947
|
+
154
|
|
948
|
+
155
|
|
949
|
+
156
|
|
950
|
+
157
|
|
951
|
+
158
|
|
952
|
+
159
|
|
953
|
+
160
|
|
954
|
+
161
|
|
955
|
+
162
|
|
956
|
+
163
|
|
957
|
+
164
|
|
958
|
+
165
|
|
959
|
+
166
|
|
960
|
+
167
|
|
961
|
+
168
|
|
962
|
+
169
|
|
963
|
+
170
|
|
964
|
+
171
|
|
965
|
+
172
|
|
966
|
+
173
|
|
967
|
+
174
|
|
968
|
+
175
|
|
969
|
+
176
|
|
970
|
+
177</pre>
|
|
971
|
+
</td>
|
|
972
|
+
<td>
|
|
973
|
+
<pre class="code"><span class="info file"># File 'app/utils/XWing.rb', line 139</span>
|
|
974
|
+
|
|
975
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_solution'>solution</span><span class='lparen'>(</span><span class='id identifier rubyid_grille'>grille</span><span class='rparen'>)</span>
|
|
976
|
+
|
|
977
|
+
<span class='ivar'>@grilleIndice</span> <span class='op'>=</span> <span class='id identifier rubyid_indice'>indice</span><span class='lparen'>(</span><span class='id identifier rubyid_grille'>grille</span><span class='rparen'>)</span>
|
|
978
|
+
|
|
979
|
+
<span class='id identifier rubyid_col'>col</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
980
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
981
|
+
<span class='id identifier rubyid_candidat'>candidat</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
<span class='int'>1</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span><span class='lparen'>(</span><span class='int'>9</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span>
|
|
985
|
+
<span class='id identifier rubyid_candidat'>candidat</span> <span class='op'>=</span> <span class='id identifier rubyid_findLineForIndice'>findLineForIndice</span><span class='lparen'>(</span><span class='id identifier rubyid_i'>i</span><span class='rparen'>)</span>
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_candidat'>candidat</span> <span class='op'>!=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
989
|
+
|
|
990
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_candidat'>candidat</span>
|
|
991
|
+
<span class='id identifier rubyid_col'>col</span> <span class='op'>=</span> <span class='id identifier rubyid_isSquare'>isSquare</span><span class='lparen'>(</span><span class='id identifier rubyid_candidat'>candidat</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_candidat'>candidat</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_candidat'>candidat</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
|
992
|
+
|
|
993
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_col'>col</span> <span class='op'>!=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
994
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>col : </span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='id identifier rubyid_col'>col</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
995
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>IT IS SQUARE !!!!</span><span class='tstring_end'>"</span></span>
|
|
996
|
+
<span class='kw'>return</span> <span class='kw'>true</span>
|
|
997
|
+
<span class='kw'>end</span>
|
|
998
|
+
<span class='kw'>end</span>
|
|
999
|
+
<span class='kw'>end</span>
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_line'>line</span>
|
|
1003
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>*******</span><span class='tstring_end'>'</span></span>
|
|
1004
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_col'>col</span>
|
|
1005
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>*******</span><span class='tstring_end'>'</span></span>
|
|
1006
|
+
|
|
1007
|
+
<span class='int'>0</span><span class='period'>.</span><span class='id identifier rubyid_upto'>upto</span><span class='lparen'>(</span><span class='int'>8</span><span class='rparen'>)</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
|
|
1008
|
+
<span class='comment'>#puts @grilleIndice[x].to_s.gsub('nil', ' ')
|
|
1009
|
+
</span> <span class='rbrace'>}</span>
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
<span class='kw'>return</span> <span class='kw'>nil</span>
|
|
1013
|
+
<span class='kw'>end</span></pre>
|
|
1014
|
+
</td>
|
|
1015
|
+
</tr>
|
|
1016
|
+
</table>
|
|
1017
|
+
</div>
|
|
1018
|
+
|
|
1019
|
+
</div>
|
|
1020
|
+
|
|
1021
|
+
</div>
|
|
1022
|
+
|
|
1023
|
+
<div id="footer">
|
|
1024
|
+
Generated on Sat Apr 22 22:47:30 2017 by
|
|
1025
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1026
|
+
0.9.8 (ruby-2.3.3).
|
|
1027
|
+
</div>
|
|
1028
|
+
|
|
1029
|
+
</div>
|
|
1030
|
+
</body>
|
|
1031
|
+
</html>
|