Rev 11557 | Rev 13476 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3392 | bpr | 1 | type=game |
2 | textarea="data" |
||
3 | |||
12172 | mquerol | 4 | :Joc del penjat |
5 | Es tracta d'endevinar una paraula proposant lletres d'acord amb el principi del joc de l'home penjat. |
||
3392 | bpr | 6 | <p> |
12172 | mquerol | 7 | Autor del model: Bernadette Perrin-Riou <bpr@math.u-psud.fr> |
3392 | bpr | 8 | </p> |
9 | :%%%%%%%%%%%%%%%%% ATTENTION %%%%%%%%%%%%%%%%%%%% |
||
10 | |||
11 | Enlevez l'en-tête ci-dessus si vous détruisez les balises pour le modèle ! |
||
12 | (Ce sont les lignes qui commencent par un ':'.) |
||
13 | Sinon l'exercice risque de ne pas pouvoir repasser sous Createxo. |
||
14 | |||
15 | :%%%%%%%% Paramètres d'exemples à redéfinir %%%%%%%%%%%%%%%%% |
||
12172 | mquerol | 16 | :\title{Joc del penjat} |
5354 | obado | 17 | :\author{Bernadette Perrin-Riou} |
12172 | mquerol | 18 | :\email{bpr@math.u-psud.fr} |
19 | :\credits{} |
||
20 | :Enunciat |
||
21 | Enunciat de l'exercici |
||
22 | \text{instruction=Trobar la paraula oferint lletres una per una.} |
||
5354 | obado | 23 | |
12172 | mquerol | 24 | :Feedback general |
25 | Text que es mostra al final de l'exercici, independentment del resultat. |
||
26 | \text{feedback=Heu trobat la paraula} |
||
3392 | bpr | 27 | |
12172 | mquerol | 28 | :Feedback de fracàs |
29 | Text que es mostra al final de l'exercici, quan no s'ha trobat la paraula. |
||
30 | \text{echec=Has perdut!} |
||
5354 | obado | 31 | |
12172 | mquerol | 32 | :Missatge sobre el nombre d'intents restants |
5722 | bpr | 33 | |
12172 | mquerol | 34 | \text{message0=Teniu dret a XXXX errors} |
5354 | obado | 35 | |
12172 | mquerol | 36 | :Tipus de disseny |
37 | Elecció del disseny: "Penjat", "Targes vermelles" o "Cranis" |
||
38 | \text{type=item(2,3 (Cranis), |
||
39 | 2 (Tarja_vermella, Tarja_verda), |
||
40 | 1 (Penjat))} |
||
41 | |||
42 | :Dades principals. |
||
43 | Introduïu a la primera columna les paraules en minúscules i en la segona una possible indicació. |
||
44 | En el cas dels grups de paraules, reemplaça el blanc amb un <span class="tt">_</span>. |
||
3392 | bpr | 45 | \text{data=éléphant,un animal |
4122 | bpr | 46 | chandelier, la première lettre est c |
5452 | bpr | 47 | mouette_rieuse, sur la plage |
3392 | bpr | 48 | vague, sur la plage |
49 | } |
||
50 | |||
51 | :%%%%%%%%%%%%%% Rien à modifier avant l'énoncé %%%%%%%%%%%%%%%% |
||
12172 | mquerol | 52 | \text{Indication=Indicació} |
53 | \text{motatrouver=Paraula a trobar} |
||
54 | \text{proposer=Proposa una lletra en minúscula} |
||
5722 | bpr | 55 | \text{typename=wims(declosing wims(word 2 to -1 of \type))} |
5354 | obado | 56 | \text{type=wims(word 1 of \type)} |
5722 | bpr | 57 | \text{typename=wims(words2items wims(nospace \typename))} |
11557 | bpr | 58 | \text{typename=slib(oef/blank _,,\typename)} |
3392 | bpr | 59 | \text{mot=randrow(\data)} |
60 | \text{indication=\mot[2..-1]} |
||
61 | \text{mot=\mot[1]} |
||
5354 | obado | 62 | \text{jok=—} |
3392 | bpr | 63 | \css{<style type="text/css"> |
5354 | obado | 64 | .centrer{text-align:center;} |
65 | .seen {opacity:0.5;font-weight: bold;} |
||
66 | .lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 0.5em;} |
||
67 | .w {padding : 0 2px;} |
||
68 | .word {background-color:orange;font-size:20px;white-space: nowrap;} |
||
69 | .forget {background-color:red;color:white;font-size:20px;} |
||
70 | .good {color:green;} |
||
71 | .bad {color:red;} |
||
72 | .indication {font-size:16px;font-weight:bold;} |
||
73 | .pendu {background-color:#CCC;width:80%;margin:auto;min-height:54px;padding:3px;} |
||
74 | .reponse, .lettres, .question {margin:1em;} |
||
75 | |||
76 | .dessin{border-right:1px dashed gray;} |
||
77 | .small_col{width:25%;} |
||
78 | .large_col{max-width:75%;} |
||
79 | .floating{float:left;} |
||
80 | |||
81 | .type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 0.5em;margin:2px;} |
||
82 | .type2 span.red {background-color:red;color:red;} |
||
83 | .type1 {min-width:210px;} |
||
84 | .type2,.type3 {min-width:80px;} |
||
3392 | bpr | 85 | </style> |
86 | } |
||
4122 | bpr | 87 | \if{\type=1}{ |
5354 | obado | 88 | \text{dessin=xrange 0,10 |
3392 | bpr | 89 | yrange 0,10 |
90 | lines black, 0,1,2,1 |
||
3396 | bpr | 91 | lines black,1,1,1,8,5,8,5,6.5 |
92 | linewidth 3} |
||
5354 | obado | 93 | |
3392 | bpr | 94 | \matrix{pendu=ellipse 5,6,1.5,1.5,red |
95 | lines red, 5,5.4,5,3 |
||
96 | lines red,4,4,5,5 |
||
97 | lines red,6,4,5,5 |
||
98 | lines red,6,2,5,3 |
||
99 | lines red,4,2,5,3} |
||
5354 | obado | 100 | |
101 | \text{Dessin=<img src="draw(200,200 |
||
5722 | bpr | 102 | \dessin)" alt="\typename[1]"/>} |
5354 | obado | 103 | |
4122 | bpr | 104 | } |
5354 | obado | 105 | |
106 | \text{contenu= } |
||
4122 | bpr | 107 | \if{\type=2}{ |
5722 | bpr | 108 | \text{contenu=\typename[2]} |
4122 | bpr | 109 | } |
5354 | obado | 110 | |
111 | \if{\type>1}{ |
||
112 | \text{order=shuffle(6)} |
||
113 | \text{dessin= |
||
114 | <div class="pendu"> |
||
115 | <span id="essai_4">\contenu</span><span id="essai_5">\contenu</span> |
||
116 | <span id="essai_6">\contenu</span><span id="essai_1">\contenu</span> |
||
117 | <span id="essai_2">\contenu</span><span id="essai_3">\contenu</span> |
||
118 | </div> |
||
119 | } |
||
120 | \text{Dessin=\dessin} |
||
4122 | bpr | 121 | } |
3392 | bpr | 122 | |
123 | \text{nb=wims(charcnt \mot)} |
||
4122 | bpr | 124 | \text{mot1=wims(words2items wims(singlespace \mot))} |
125 | \text{mot=wims(replace internal , by _ in \mot1)} |
||
3392 | bpr | 126 | \text{mot=wims(text expand \mot using 10)} |
127 | \text{mot=wims(words2items \mot)} |
||
4755 | bpr | 128 | \text{blanc=position(_,\mot)} |
4122 | bpr | 129 | \text{MOT=wims(makelist \jok for x=1 to \nb)} |
4755 | bpr | 130 | \for{a in \blanc}{ |
131 | \text{MOT=wims(replace item number \a by _ in \MOT)} |
||
132 | } |
||
5354 | obado | 133 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) } |
3392 | bpr | 134 | \text{MOT2=wims(items2words \MOT1)} |
4755 | bpr | 135 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 136 | |
137 | \text{nstep=r1} |
||
138 | |||
5354 | obado | 139 | \text{lettre1=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} |
140 | \text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,-,!,?} |
||
141 | \text{lettre1=\lettre1,\accents} |
||
142 | \text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)} |
||
3392 | bpr | 143 | \text{lettre2=\lettre} |
144 | \text{lettre2=\lettre2[1..10] |
||
5354 | obado | 145 | <br/>\lettre2[11..20] |
146 | <br/>\lettre2[21..30] |
||
147 | <br/>\lettre2[31..-1]} |
||
3392 | bpr | 148 | \text{lettre2=wims(replace internal , by in \lettre2)} |
149 | \nextstep{\nstep} |
||
150 | \text{cnt=0} |
||
151 | |||
5354 | obado | 152 | \integer{reste=6 - \cnt} |
5722 | bpr | 153 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
5354 | obado | 154 | \statement{ |
12172 | mquerol | 155 | <p class="instruction">\instruction</p> |
5452 | bpr | 156 | <p ><em>\Indication : <span class="indication">\indication</span></em></p> |
5354 | obado | 157 | <div class="floating small_col centrer type\type"> |
158 | <div class="dessin"><p>\message</p> |
||
159 | \Dessin</div> |
||
160 | </div> |
||
161 | <div class="floating large_col centrer"> |
||
5452 | bpr | 162 | <div class="question">\motatrouver :<span class="word"> \MOT2</span></div> |
5354 | obado | 163 | <div class="reponse"> |
5452 | bpr | 164 | <label for="reply\step">\proposer : </label> |
5354 | obado | 165 | \embed{r\step,1 |
166 | default |
||
11557 | bpr | 167 | autocomplete="off" maxlength="1" style="text-align:center;"} |
5354 | obado | 168 | </div> |
169 | <div class="lettres">\lettre2</div> |
||
170 | </div> |
||
171 | |||
172 | <br style="clear:both;"/> |
||
3392 | bpr | 173 | } |
174 | |||
175 | \answer{}{\rep1}{type=case}{option=noanalyzeprint} |
||
176 | \answer{}{\rep2}{type=case}{option=noanalyzeprint} |
||
177 | \answer{}{\rep3}{type=case}{option=noanalyzeprint} |
||
178 | \answer{}{\rep4}{type=case}{option=noanalyzeprint} |
||
179 | \answer{}{\rep5}{type=case}{option=noanalyzeprint} |
||
180 | \answer{}{\rep6}{type=case}{option=noanalyzeprint} |
||
181 | \answer{}{\rep7}{type=case}{option=noanalyzeprint} |
||
182 | \answer{}{\rep8}{type=case}{option=noanalyzeprint} |
||
183 | \answer{}{\rep9}{type=case}{option=noanalyzeprint} |
||
184 | \answer{}{\rep10}{type=case}{option=noanalyzeprint} |
||
185 | \answer{}{\rep11}{type=case}{option=noanalyzeprint} |
||
186 | \answer{}{\rep12}{type=case}{option=noanalyzeprint} |
||
187 | \answer{}{\rep13}{type=case}{option=noanalyzeprint} |
||
188 | \answer{}{\rep14}{type=case}{option=noanalyzeprint} |
||
189 | \answer{}{\rep15}{type=case}{option=noanalyzeprint} |
||
190 | \answer{}{\rep16}{type=case}{option=noanalyzeprint} |
||
191 | \answer{}{\rep17}{type=case}{option=noanalyzeprint} |
||
192 | \answer{}{\rep18}{type=case}{option=noanalyzeprint} |
||
193 | \answer{}{\rep19}{type=case}{option=noanalyzeprint} |
||
194 | \answer{}{\rep20}{type=case}{option=noanalyzeprint} |
||
4122 | bpr | 195 | \answer{}{\rep21}{type=case}{option=noanalyzeprint} |
196 | \answer{}{\rep22}{type=case}{option=noanalyzeprint} |
||
197 | \answer{}{\rep23}{type=case}{option=noanalyzeprint} |
||
198 | \answer{}{\rep24}{type=case}{option=noanalyzeprint} |
||
199 | \answer{}{\rep25}{type=case}{option=noanalyzeprint} |
||
200 | \answer{}{\rep26}{type=case}{option=noanalyzeprint} |
||
201 | \answer{}{\rep27}{type=case}{option=noanalyzeprint} |
||
202 | \answer{}{\rep28}{type=case}{option=noanalyzeprint} |
||
203 | \answer{}{\rep29}{type=case}{option=noanalyzeprint} |
||
204 | \answer{}{\rep30}{type=case}{option=noanalyzeprint} |
||
3392 | bpr | 205 | |
206 | \text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14, |
||
4754 | bpr | 207 | \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24, |
208 | \rep25,\rep26,\rep27,\rep28,\rep29,\rep30} |
||
3392 | bpr | 209 | |
5354 | obado | 210 | |
211 | \text{w_class=good} |
||
212 | |||
213 | \if{\rep[\step-1] notitemof \mot }{ |
||
214 | \integer{cnt=\cnt+1} |
||
215 | \integer{reste=6 - \cnt} |
||
216 | \text{w_class=bad} |
||
217 | |||
218 | \if {\reste > 0}{ |
||
5722 | bpr | 219 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
5354 | obado | 220 | } |
221 | \if {\reste <= 0} { |
||
222 | \text{message=<strong class="oef_condbad">\echec</strong>} |
||
223 | } |
||
224 | |||
225 | \if{\type = 1}{ |
||
226 | \text{dessin=\dessin |
||
227 | \pendu[\cnt;]} |
||
228 | \text{Dessin=<img src="draw(200,200 |
||
5722 | bpr | 229 | \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison..."/>} |
5354 | obado | 230 | } |
231 | |||
232 | \if{\type>1}{ |
||
233 | \integer{h=\order[\cnt]} |
||
234 | \text{jj=<span id="essai_\h">\contenu</span>} |
||
235 | \if{\type=2}{ |
||
5722 | bpr | 236 | \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)} |
5354 | obado | 237 | } |
238 | \if{\type=3}{ |
||
5722 | bpr | 239 | \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"/> in \dessin)} |
5354 | obado | 240 | } |
11557 | bpr | 241 | \text{Dessin=\dessin} |
5354 | obado | 242 | } |
243 | } |
||
244 | |||
245 | # On affiche differement les lettres deja tapées |
||
3392 | bpr | 246 | \text{z=position(\rep[\step-1],\lettre1)} |
5354 | obado | 247 | \text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)} |
248 | |||
249 | # On repartit les lettres par groupes de 10 maxi par ligne |
||
3392 | bpr | 250 | \text{lettre2=\lettre[1..10] |
5354 | obado | 251 | <br/>\lettre[11..20] |
252 | <br/>\lettre[21..30] |
||
253 | <br/>\lettre[31..-1]} |
||
3392 | bpr | 254 | \text{lettre2=wims(replace internal , by in \lettre2)} |
5354 | obado | 255 | |
256 | |||
3392 | bpr | 257 | \text{z=position(\rep[\step-1],\mot)} |
258 | \for{k in \z}{ |
||
259 | \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)} |
||
260 | } |
||
5354 | obado | 261 | |
262 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)} |
||
3392 | bpr | 263 | \text{MOT2=wims(items2words \MOT1)} |
4755 | bpr | 264 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 265 | \text{nstep=} |
4122 | bpr | 266 | \text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step} |
267 | \if{\step>30 or \cnt>=6}{ |
||
268 | \text{w=position(\jok,\MOT)} |
||
3392 | bpr | 269 | \for{a in \w}{ |
5354 | obado | 270 | \text{MOT1=wims(replace internal item number \a by <span class="w forget">\mot[\a]</span> in \MOT1)} |
3392 | bpr | 271 | } |
272 | \text{MOT2=wims(items2words \MOT1)} |
||
4755 | bpr | 273 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
3392 | bpr | 274 | } |
275 | |||
4122 | bpr | 276 | \condition{Vous avez trouvé le mot ?}{\jok notitemof \MOT} |
3392 | bpr | 277 | \condition{}{\cnt<=3}{option=hide} |
5722 | bpr | 278 | \condition{}{\cnt<=4}{option=hide} |