Rev 17234 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 4137 | bpr | 1 | type=game |
| 13715 | obado | 2 | textarea="data instruction" |
| 3 | iEdit="instruction" |
||
| 4137 | bpr | 4 | |
| 12172 | mquerol | 5 | :Juego del ahorcado |
| 6 | Se trata de adivinar una palabra proponiendo letras según el principio del juego del ahorcado. |
||
| 13478 | obado | 7 | </p><p class="wims_credits"> |
| 15179 | lemaire | 8 | Autor del modelo: <a href="mailto:bernadette.m.riou@orange.fr">Bernadette Perrin-Riou</a> |
| 4137 | bpr | 9 | </p> |
| 13478 | obado | 10 | :%%%%%%%%%%%%%%%%% ATENCIÓN %%%%%%%%%%%%%%%%%%%% |
| 4137 | bpr | 11 | |
| 13478 | obado | 12 | Elimina la cabecera anterior si borra las etiquetas para el modelo! |
| 13 | (Son las líneas que comienzan con un ':'.) |
||
| 14 | En caso contrario el ejercicio puede no funcionar bajo Createxo. |
||
| 4137 | bpr | 15 | |
| 13478 | obado | 16 | :%%%%%%%% Parámetros del ejemplo a redefinir %%%%%%%%%%%%%%%%% |
| 12172 | mquerol | 17 | :\title{Juego del ahorcado} |
| 18 | :\author{Bernadette Perrin-Riou} |
||
| 19 | :\email{bpr@math.u-psud.fr} |
||
| 5724 | bpr | 20 | :\credits{} |
| 13478 | obado | 21 | |
| 12172 | mquerol | 22 | :Enunciado |
| 23 | Enunciado del ejercicio |
||
| 24 | \text{instruction=Encontrar la palabra ofreciendo letras una a una.} |
||
| 4137 | bpr | 25 | |
| 12172 | mquerol | 26 | :Comentario general |
| 27 | Texto que se muestra al final del ejercicio, independientemente del resultado. |
||
| 28 | \text{feedback=Encontraste la palabra} |
||
| 4137 | bpr | 29 | |
| 12172 | mquerol | 30 | :Comentario de fracaso |
| 31 | Texto que se muestra al final del ejercicio, cuando no se encontró la palabra. |
||
| 16445 | bpr | 32 | \text{echec=¡Has perdido!} |
| 5722 | bpr | 33 | |
| 12172 | mquerol | 34 | :Mensaje sobre el número de intentos restantes |
| 5722 | bpr | 35 | |
| 12172 | mquerol | 36 | \text{message0=Tiene derecho a XXXX errores} |
| 5722 | bpr | 37 | |
| 12172 | mquerol | 38 | :Tipo de diseño |
| 39 | Elección del diseño: "Ahorcado", "Tarjetas rojas" o "Calaveras" |
||
| 40 | \text{type=item(2,3 (Calaveras), |
||
| 41 | 2 (Tarjeta_roja, Tarjeta_verde), |
||
| 42 | 1 (Ahorcado))} |
||
| 15691 | bpr | 43 | :Options |
| 16445 | bpr | 44 | Las opciones pueden ser: <span class="tt">noaccent</span> (no toma en cuenta acentos), <span class="tt">pista</span> (se muestran la primera y la última letra). |
| 15691 | bpr | 45 | \text{option=} |
| 12172 | mquerol | 46 | :Datos principales |
| 47 | Coloque en la primera columna las palabras en minúsculas y en la segunda una posible indicación. |
||
| 48 | En el caso de grupos de palabras, reemplace el espacio en blanco con un <span class="tt">_</span>. |
||
| 16445 | bpr | 49 | \text{data=elefante,un animal |
| 50 | candelabro, la primera letra es c |
||
| 51 | gaviota, en la playa |
||
| 52 | ola, en la playa |
||
| 12172 | mquerol | 53 | } |
| 5722 | bpr | 54 | |
| 13478 | obado | 55 | :%%%%%%%%%%%%%% Nada que modificar hasta el enunciado %%%%%%%%%%%%%%%% |
| 12172 | mquerol | 56 | \text{Indication=Indicación} |
| 57 | \text{motatrouver=Palabra a encontrar} |
||
| 58 | \text{proposer=Proponer una letra minúscula} |
||
| 5722 | bpr | 59 | \text{typename=wims(declosing wims(word 2 to -1 of \type))} |
| 60 | \text{type=wims(word 1 of \type)} |
||
| 61 | \text{typename=wims(words2items wims(nospace \typename))} |
||
| 8512 | bpr | 62 | \text{typename=slib(oef/blank _,,\typename)} |
| 4137 | bpr | 63 | \text{mot=randrow(\data)} |
| 64 | \text{indication=\mot[2..-1]} |
||
| 65 | \text{mot=\mot[1]} |
||
| 5722 | bpr | 66 | \text{jok=—} |
| 13715 | obado | 67 | \css{<style> |
| 5722 | bpr | 68 | .centrer{text-align:center;} |
| 15691 | bpr | 69 | .seen {opacity:.5;font-weight: bold;} |
| 70 | .lettres{display: flex; |
||
| 71 | flex-wrap: wrap; |
||
| 72 | justify-content: center;} |
||
| 73 | .lettres span{background-color:orange;font-size:20px;font-family:monospace;padding:0 .5em;} |
||
| 5722 | bpr | 74 | .w {padding : 0 2px;} |
| 75 | .word {background-color:orange;font-size:20px;white-space: nowrap;} |
||
| 76 | .forget {background-color:red;color:white;font-size:20px;} |
||
| 77 | .good {color:green;} |
||
| 78 | .bad {color:red;} |
||
| 79 | .indication {font-size:16px;font-weight:bold;} |
||
| 80 | .pendu {background-color:#CCC;width:80%;margin:auto;min-height:54px;padding:3px;} |
||
| 81 | .reponse, .lettres, .question {margin:1em;} |
||
| 82 | |||
| 83 | .dessin{border-right:1px dashed gray;} |
||
| 84 | .small_col{width:25%;} |
||
| 85 | .large_col{max-width:75%;} |
||
| 86 | .floating{float:left;} |
||
| 87 | |||
| 15691 | bpr | 88 | .type2 span {background-color:green;color:green; display: inline-block; min-height: 40px;width: 40px;padding:0 .5em;margin:2px;} |
| 5722 | bpr | 89 | .type2 span.red {background-color:red;color:red;} |
| 90 | .type1 {min-width:210px;} |
||
| 91 | .type2,.type3 {min-width:80px;} |
||
| 4137 | bpr | 92 | </style> |
| 93 | } |
||
| 94 | \if{\type=1}{ |
||
| 5722 | bpr | 95 | \text{dessin=xrange 0,10 |
| 4137 | bpr | 96 | yrange 0,10 |
| 18061 | bpr | 97 | segments black, 0,1,2,1 |
| 98 | polyline black,1,1,1,8,5,8,5,6.5 |
||
| 4137 | bpr | 99 | linewidth 3} |
| 100 | \matrix{pendu=ellipse 5,6,1.5,1.5,red |
||
| 18061 | bpr | 101 | segments red, 5,5.4,5,3,4,4,5,5,6,4,5,5,6,2,5,3,4,2,5,3} |
| 102 | } |
||
| 5722 | bpr | 103 | |
| 104 | \text{Dessin=<img src="draw(200,200 |
||
| 17234 | bpr | 105 | \dessin)" alt="\typename[1]">} |
| 4137 | bpr | 106 | } |
| 5722 | bpr | 107 | |
| 108 | \text{contenu= } |
||
| 4137 | bpr | 109 | \if{\type=2}{ |
| 5722 | bpr | 110 | \text{contenu=\typename[2]} |
| 4137 | bpr | 111 | } |
| 5722 | bpr | 112 | |
| 113 | \if{\type>1}{ |
||
| 114 | \text{order=shuffle(6)} |
||
| 115 | \text{dessin= |
||
| 116 | <div class="pendu"> |
||
| 15691 | bpr | 117 | <span id="essai_4">\contenu</span> |
| 118 | <span id="essai_5">\contenu</span> |
||
| 119 | <span id="essai_6">\contenu</span> |
||
| 120 | <span id="essai_1">\contenu</span> |
||
| 121 | <span id="essai_2">\contenu</span> |
||
| 122 | <span id="essai_3">\contenu</span> |
||
| 123 | </div> |
||
| 5722 | bpr | 124 | } |
| 125 | \text{Dessin=\dessin} |
||
| 4137 | bpr | 126 | } |
| 127 | |||
| 128 | \text{nb=wims(charcnt \mot)} |
||
| 129 | \text{mot1=wims(words2items wims(singlespace \mot))} |
||
| 130 | \text{mot=wims(replace internal , by _ in \mot1)} |
||
| 131 | \text{mot=wims(text expand \mot using 10)} |
||
| 132 | \text{mot=wims(words2items \mot)} |
||
| 4755 | bpr | 133 | \text{blanc=position(_,\mot)} |
| 4137 | bpr | 134 | \text{MOT=wims(makelist \jok for x=1 to \nb)} |
| 4755 | bpr | 135 | \for{a in \blanc}{ |
| 136 | \text{MOT=wims(replace item number \a by _ in \MOT)} |
||
| 137 | } |
||
| 15691 | bpr | 138 | option première et dernière lettre |
| 139 | \if{hint isin \option}{ |
||
| 140 | \text{MOT=wims(replace item number 1 by \mot[1] in \MOT)} |
||
| 141 | \text{MOT=wims(replace item number -1 by \mot[-1] in \MOT)} |
||
| 142 | } |
||
| 143 | |||
| 5722 | bpr | 144 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT) } |
| 4137 | bpr | 145 | \text{MOT2=wims(items2words \MOT1)} |
| 4755 | bpr | 146 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
| 4137 | bpr | 147 | |
| 148 | \text{nstep=r1} |
||
| 149 | |||
| 5722 | bpr | 150 | \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} |
| 15691 | bpr | 151 | \text{accents=à,ä,â,é,è,ê,ë,î,ï,ô,ö,û,ù,ç} |
| 152 | \text{ponctu=?,!,-} |
||
| 153 | \text{lettre1=\lettre1,\accents,\ponctu} |
||
| 154 | \text{accents=wims(replace internal , by in \accents)} |
||
| 155 | \text{ponctu=wims(replace internal , by in \ponctu)} |
||
| 5722 | bpr | 156 | \text{lettre=wims(makelist <span class="notseen">x</span> for x in \lettre1)} |
| 15691 | bpr | 157 | \text{lettre2=wims(replace internal , by in \lettre)} |
| 4137 | bpr | 158 | \nextstep{\nstep} |
| 159 | \text{cnt=0} |
||
| 160 | |||
| 5722 | bpr | 161 | \integer{reste=6 - \cnt} |
| 162 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
||
| 15691 | bpr | 163 | \if{noaccent isin \option}{ |
| 164 | \text{motnoaccent=wims(deaccent \mot)} |
||
| 165 | }{\text{motnoaccent=\mot}} |
||
| 166 | |||
| 5722 | bpr | 167 | \statement{ |
| 15703 | obado | 168 | <div class="instruction">\instruction</div> |
| 15691 | bpr | 169 | \if{\indication!=\empty}{ |
| 170 | <p><em>\Indication : <span class="indication">\indication</span></em></p> |
||
| 171 | } |
||
| 172 | <div class="floating small_col centrer type\type"> |
||
| 173 | <div class="dessin"> |
||
| 174 | <p>\message</p> |
||
| 175 | \Dessin |
||
| 176 | </div> |
||
| 5722 | bpr | 177 | </div> |
| 15691 | bpr | 178 | <div class="floating large_col centrer"> |
| 179 | <div class="question">\motatrouver :<span class="word">\MOT2</span></div> |
||
| 180 | <div class="reponse"> |
||
| 181 | <label for="reply\step">\proposer :</label> |
||
| 182 | \embed{r\step,1 |
||
| 183 | default |
||
| 184 | maxlength="1" pattern="[a-z\accents\ponctu]" style="text-align:center;"} |
||
| 185 | </div> |
||
| 186 | <div class="lettres">\lettre2</div> |
||
| 187 | </div> |
||
| 4137 | bpr | 188 | } |
| 189 | |||
| 190 | \answer{}{\rep1}{type=case}{option=noanalyzeprint} |
||
| 191 | \answer{}{\rep2}{type=case}{option=noanalyzeprint} |
||
| 192 | \answer{}{\rep3}{type=case}{option=noanalyzeprint} |
||
| 193 | \answer{}{\rep4}{type=case}{option=noanalyzeprint} |
||
| 194 | \answer{}{\rep5}{type=case}{option=noanalyzeprint} |
||
| 195 | \answer{}{\rep6}{type=case}{option=noanalyzeprint} |
||
| 196 | \answer{}{\rep7}{type=case}{option=noanalyzeprint} |
||
| 197 | \answer{}{\rep8}{type=case}{option=noanalyzeprint} |
||
| 198 | \answer{}{\rep9}{type=case}{option=noanalyzeprint} |
||
| 199 | \answer{}{\rep10}{type=case}{option=noanalyzeprint} |
||
| 200 | \answer{}{\rep11}{type=case}{option=noanalyzeprint} |
||
| 201 | \answer{}{\rep12}{type=case}{option=noanalyzeprint} |
||
| 202 | \answer{}{\rep13}{type=case}{option=noanalyzeprint} |
||
| 203 | \answer{}{\rep14}{type=case}{option=noanalyzeprint} |
||
| 204 | \answer{}{\rep15}{type=case}{option=noanalyzeprint} |
||
| 205 | \answer{}{\rep16}{type=case}{option=noanalyzeprint} |
||
| 206 | \answer{}{\rep17}{type=case}{option=noanalyzeprint} |
||
| 207 | \answer{}{\rep18}{type=case}{option=noanalyzeprint} |
||
| 208 | \answer{}{\rep19}{type=case}{option=noanalyzeprint} |
||
| 209 | \answer{}{\rep20}{type=case}{option=noanalyzeprint} |
||
| 210 | \answer{}{\rep21}{type=case}{option=noanalyzeprint} |
||
| 211 | \answer{}{\rep22}{type=case}{option=noanalyzeprint} |
||
| 212 | \answer{}{\rep23}{type=case}{option=noanalyzeprint} |
||
| 213 | \answer{}{\rep24}{type=case}{option=noanalyzeprint} |
||
| 214 | \answer{}{\rep25}{type=case}{option=noanalyzeprint} |
||
| 215 | \answer{}{\rep26}{type=case}{option=noanalyzeprint} |
||
| 216 | \answer{}{\rep27}{type=case}{option=noanalyzeprint} |
||
| 217 | \answer{}{\rep28}{type=case}{option=noanalyzeprint} |
||
| 218 | \answer{}{\rep29}{type=case}{option=noanalyzeprint} |
||
| 219 | \answer{}{\rep30}{type=case}{option=noanalyzeprint} |
||
| 220 | |||
| 221 | \text{rep=\rep1,\rep2,\rep3,\rep4,\rep5,\rep6,\rep7,\rep8,\rep9,\rep10,\rep11,\rep12,\rep13,\rep14, |
||
| 4754 | bpr | 222 | \rep15,\rep16,\rep17,\rep18,\rep19,\rep20,\rep21,\rep22,\rep23,\rep24, |
| 223 | \rep25,\rep26,\rep27,\rep28,\rep29,\rep30} |
||
| 4137 | bpr | 224 | |
| 5722 | bpr | 225 | |
| 226 | \text{w_class=good} |
||
| 227 | |||
| 228 | \if{\rep[\step-1] notitemof \mot }{ |
||
| 229 | \integer{cnt=\cnt+1} |
||
| 230 | \integer{reste=6 - \cnt} |
||
| 231 | \text{w_class=bad} |
||
| 232 | \if {\reste > 0}{ |
||
| 233 | \text{message=wims(replace internal XXXX by <strong>\reste</strong> in \message0)} |
||
| 234 | } |
||
| 235 | \if {\reste <= 0} { |
||
| 236 | \text{message=<strong class="oef_condbad">\echec</strong>} |
||
| 237 | } |
||
| 238 | \if{\type = 1}{ |
||
| 239 | \text{dessin=\dessin |
||
| 240 | \pendu[\cnt;]} |
||
| 241 | \text{Dessin=<img src="draw(200,200 |
||
| 17234 | bpr | 242 | \dessin)" alt="Vous avez fait \cnt erreur(s). Vous avancez vers la pendaison...">} |
| 5722 | bpr | 243 | } |
| 244 | |||
| 245 | \if{\type>1}{ |
||
| 246 | \integer{h=\order[\cnt]} |
||
| 247 | \text{jj=<span id="essai_\h">\contenu</span>} |
||
| 248 | \if{\type=2}{ |
||
| 249 | \text{dessin=wims(replace internal \jj by <span class="red">\typename[1]</span> in \dessin)} |
||
| 250 | } |
||
| 251 | \if{\type=3}{ |
||
| 17234 | bpr | 252 | \text{dessin=wims(replace internal \jj by <img src="gifs/images/skull_and_crossbones50.png" alt="\typename[1]"> in \dessin)} |
| 5722 | bpr | 253 | } |
| 8512 | bpr | 254 | \text{Dessin=\dessin} |
| 5722 | bpr | 255 | } |
| 256 | } |
||
| 257 | |||
| 15691 | bpr | 258 | %% On affiche differement les lettres deja tapées |
| 4137 | bpr | 259 | \text{z=position(\rep[\step-1],\lettre1)} |
| 5722 | bpr | 260 | \text{lettre=wims(replace internal item number \z by <span class="seen \w_class">\rep[\step-1]</span> in \lettre)} |
| 15691 | bpr | 261 | \text{lettre2=wims(items2words \lettre)} |
| 5722 | bpr | 262 | |
| 4137 | bpr | 263 | \text{z=position(\rep[\step-1],\mot)} |
| 264 | \for{k in \z}{ |
||
| 265 | \text{MOT=wims(replace internal item number \k by \rep[\step-1] in \MOT)} |
||
| 266 | } |
||
| 15691 | bpr | 267 | \if{noaccent isin \option}{ |
| 268 | \text{z=position(\rep[\step-1],\motnoaccent)} |
||
| 269 | \for{k in \z}{ |
||
| 270 | \text{MOT=wims(replace internal item number \k by \mot[\k] in \MOT)} |
||
| 271 | } |
||
| 272 | } |
||
| 5722 | bpr | 273 | \text{MOT1=wims(makelist <span class="w">x</span> for x in \MOT)} |
| 4137 | bpr | 274 | \text{MOT2=wims(items2words \MOT1)} |
| 4755 | bpr | 275 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
| 4137 | bpr | 276 | \text{nstep=} |
| 277 | \text{nstep=\jok isitemof \MOT and \step<30 and \cnt<6 ? r \step} |
||
| 278 | \if{\step>30 or \cnt>=6}{ |
||
| 279 | \text{w=position(\jok,\MOT)} |
||
| 280 | \for{a in \w}{ |
||
| 5722 | bpr | 281 | \text{MOT1=wims(replace internal item number \a by <span class="w forget">\mot[\a]</span> in \MOT1)} |
| 4137 | bpr | 282 | } |
| 283 | \text{MOT2=wims(items2words \MOT1)} |
||
| 4755 | bpr | 284 | \text{MOT2=wims(replace internal _ by in \MOT2)} |
| 4137 | bpr | 285 | } |
| 286 | |||
| 16445 | bpr | 287 | \condition{¿Encontró la palabra?}{\jok notitemof \MOT} |
| 4137 | bpr | 288 | \condition{}{\cnt<=3}{option=hide} |
| 289 | \condition{}{\cnt<=4}{option=hide} |