Ajout de la réponse d'Estelle sur le découpage par bloc

This commit is contained in:
Yannick Francois
2018-02-15 16:28:11 +01:00
parent 5de751357a
commit b45c8a8a3c
3 changed files with 123 additions and 3 deletions
@@ -0,0 +1,107 @@
{\rtf1\ansi\deff3\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\froman\fprq2\fcharset0 Courier{\*\falt Courier New};}{\f6\fnil\fprq2\fcharset0 Noto Sans CJK SC Regular;}{\f7\fnil\fprq2\fcharset0 Lohit Devanagari;}{\f8\fnil\fprq0\fcharset128 Lohit Devanagari;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red251\green2\blue255;\red253\green128\blue8;\red33\green255\blue6;\red33\green255\blue255;}
{\stylesheet{\s0\snext0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033 Normal;}
{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af6\dbch\af7\afs28\loch\f4\fs28 Heading;}
{\s16\sbasedon0\snext16\sl288\slmult1\sb0\sa140 Text Body;}
{\s17\sbasedon16\snext17\sl288\slmult1\sb0\sa140\dbch\af8 List;}
{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af8\afs24\ai\fs24 Caption;}
{\s19\sbasedon0\snext19\noline\dbch\af8 Index;}
}{\*\generator LibreOffice/5.4.2.2$Linux_X86_64 LibreOffice_project/40m0$Build-2}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr2018\mo2\dy14\hr17\min42}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab720
{\*\pgdsctbl
{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}}
\formshade{\*\pgdscno0}\paperh16838\paperw11906\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf17\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
local function strsplit(delimiter, text) }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Description}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
if delimiter == "" then }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// If Condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
error("delimiter matches empty string!") }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
//}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
end}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Fin de la condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
local list, pos, first, last = \{\}, 1 }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
//}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
while true do}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// While Condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
first, last = text:find(delimiter, pos, true) }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
//Instruction hi\u233\'e9rarchis\u233\'e9e}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
if first then -- found? }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// If Condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
table.insert(list, text:sub(pos, first - 1))}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Execution}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
pos = last + 1\tab \tab }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Execution \tab }
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
\tab }{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
else}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Instruction hi\u233\'e9rarchis\u233\'e9e}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
table.insert(list, text:sub(pos))\tab }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Execution }
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
break}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Execution}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
end}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Fin de la condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
end}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Fin de la condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\fs24\loch\f5\hich\af5
}{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
return list}{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// }
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
end }{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
// Fin de la condition}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
M.private.strsplit = strsplit}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf20\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
Bleu}{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
se r\u233\'e9f\u232\'e8re \u224\'e0 }{\cf12\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
violet}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
qui se r\u233\'e9f\u232\'e8re \u224\'e0 }{\cf19\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
vert}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
qui se r\u233\'e9f\u232\'e8re \u224\'e0 }{\cf18\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
orange}
\par \pard\plain \s0\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af6\langfe2052\dbch\af7\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033\sl280\slmult0{\cf1\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
qui se r\u233\'e9f\u232\'e8re \u224\'e0 }{\cf17\outl0\expnd0\expndtw0\kerning0\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
rose}
\par }
@@ -0,0 +1,15 @@
J'ai mis des commentaires en bout de chaque ligne, mais je sais que ce n'est pas très "respectueux" du code !
J'ai essayé de comprendre certains mécanismes dans le code, des fois je m'aide de recherches sur Internet pour voir s'il y a des infos, mais ça m'embrouille aussi un peu.
J'essaye de ne pas passer des heures sur l'exercice, même si je veux le faire sérieusement, je sais que je n'ai pas toutes les données donc je me force un peu à conclure en fin de cession.
Je suis contente de prendre le temps de me pencher sur le sujet comme à chaque fois, mais c'est un peu frustrant de ne pas savoir si l'on progresse et de ne pas apprendre de nouveaux éléments par la correction de l'exercice précédent.
Mais j'attends la suite avec impatience,
Bonne journée,
Estelle
+1 -3
View File
@@ -1,14 +1,12 @@
Episode 1:
A envoyer ?
- Christophe
En attente de réponse:
- Anna-Livia
- Sakada
- Carole Gombauld
- Étienne puydebois
- Christophe
- Elodie
- Sarah
- Eric