[plm] 02/04: Imported Upstream version 2.3+repack
Martin Quinson
mquinson at moszumanska.debian.org
Sun Nov 24 17:06:27 UTC 2013
This is an automated email from the git hooks/post-receive script.
mquinson pushed a commit to branch debian-debian
in repository plm.
commit 70ae732aaef706925dc853d27be3cb1fba501f1c
Author: Martin Quinson <martin.quinson at loria.fr>
Date: Sun Nov 24 16:50:49 2013 +0100
Imported Upstream version 2.3+repack
---
COPYING | 39 +-
ChangeLog | 22 +
TODO | 1 +
build.xml | 4 +-
lib/l10n-engine/en.po | 264 +-
lib/l10n-engine/fr.po | 265 +-
lib/l10n-engine/plm.pot | 256 +-
lib/l10n/fr.po | 9352 +++++++++++---------
lib/l10n/plm.pot | 5712 ++++++------
lib/resources/plm.configuration.properties | 6 +-
po4a.conf | 128 +-
src/lessons/bat/string1/StringMatch.fr.html | 2 +-
src/lessons/lightbot/Board01TwoSteps.fr.html | 2 +-
src/lessons/recursion/Main.fr.html | 21 +-
src/lessons/recursion/Main.html | 16 +-
src/lessons/recursion/Main.java | 8 +
.../recursion/dragoncurve/DragonCurve1.fr.html | 8 +-
.../recursion/dragoncurve/DragonCurve1.html | 4 +-
src/lessons/recursion/hanoi/Main.html | 2 +-
.../recursion/hanoi/universe/HanoiWorld.fr.html | 5 +-
.../recursion/hanoi/universe/HanoiWorld.html | 5 +-
.../recursion/hanoi/universe/HanoiWorld.java | 9 +-
.../recursion/hanoi/universe/HanoiWorldView.java | 194 +-
src/lessons/recursion/koch/Crab.fr.html | 18 +
src/lessons/recursion/koch/Crab.html | 12 +
src/lessons/recursion/koch/Crab.java | 52 +
src/lessons/recursion/koch/CrabEntity.java | 26 +
src/lessons/recursion/koch/CrabEntity.py | 18 +
src/lessons/recursion/koch/CrabEntity.scala | 27 +
src/lessons/recursion/koch/HexaKoch.fr.html | 15 +
src/lessons/recursion/koch/HexaKoch.html | 13 +
src/lessons/recursion/koch/HexaKoch.java | 44 +
src/lessons/recursion/koch/HexaKochEntity.java | 32 +
src/lessons/recursion/koch/HexaKochEntity.py | 22 +
src/lessons/recursion/koch/HexaKochEntity.scala | 33 +
src/lessons/recursion/koch/Koch.fr.html | 21 +-
src/lessons/recursion/koch/Koch.html | 17 +-
src/lessons/recursion/koch/Koch.java | 12 +-
src/lessons/recursion/koch/KochEntity.java | 21 +-
src/lessons/recursion/koch/KochEntity.scala | 2 +-
src/lessons/recursion/koch/KochHint.png | Bin 0 -> 3381 bytes
src/lessons/recursion/koch/PentaKoch.fr.html | 13 +
src/lessons/recursion/koch/PentaKoch.html | 9 +
src/lessons/recursion/koch/PentaKoch.java | 44 +
src/lessons/recursion/koch/PentaKochEntity.java | 50 +
src/lessons/recursion/koch/PentaKochEntity.py | 19 +
src/lessons/recursion/koch/PentaKochEntity.scala | 33 +
src/lessons/recursion/koch/SquareKoch.fr.html | 15 +
src/lessons/recursion/koch/SquareKoch.html | 15 +
src/lessons/recursion/koch/SquareKoch.java | 44 +
src/lessons/recursion/koch/SquareKochEntity.java | 61 +
src/lessons/recursion/koch/SquareKochEntity.py | 33 +
src/lessons/recursion/koch/SquareKochEntity.scala | 44 +
src/lessons/recursion/koch/SquareKochHint.png | Bin 0 -> 1285 bytes
src/lessons/sort/dutchflag/DutchFlagAlgo.fr.html | 33 +
src/lessons/sort/dutchflag/DutchFlagAlgo.html | 8 +-
src/lessons/sort/dutchflag/Main.fr.html | 19 +
src/lessons/sort/dutchflag/short_desc.fr.html | 4 +
.../sort/dutchflag/universe/DutchFlagWorld.fr.html | 26 +
.../sort/dutchflag/universe/DutchFlagWorld.html | 6 +-
.../dutchflag/universe/DutchFlagWorldView.java | 140 +-
.../sort/pancake/universe/PancakeWorld.java | 4 +-
.../pancake/{img => universe}/world_pancake.png | Bin
.../pancake/{img => universe}/world_pancake.svg | 0
src/lessons/turtleart/short_desc.html | 3 +-
src/lessons/welcome/array/basics/Array1.fr.html | 10 +-
src/lessons/welcome/bat/bool1/HasTeen.fr.html | 2 +-
src/lessons/welcome/bat/bool1/In1020.fr.html | 2 +-
src/lessons/welcome/bat/bool1/In3050.fr.html | 2 +-
src/lessons/welcome/bat/bool1/LoneTeen.fr.html | 2 +-
src/lessons/welcome/bat/bool1/Max1020.fr.html | 4 +-
src/lessons/welcome/bat/bool1/ParotTrouble.fr.html | 2 +-
src/lessons/welcome/bat/bool2/AlarmClock.fr.html | 2 +-
src/lessons/welcome/bat/bool2/GreenTicket.fr.html | 2 +-
src/lessons/welcome/bat/bool2/In1To10.fr.html | 6 +-
src/lessons/welcome/bat/bool2/RedTicket.fr.html | 2 +-
src/lessons/welcome/bat/bool2/SquirrelPlay.fr.html | 6 +-
src/lessons/welcome/bat/bool2/TeenSum.fr.html | 2 +-
src/lessons/welcome/loopfor/LoopForEntity.py | 8 +-
.../welcome/methods/args/MethodsArgsEntity.py | 2 +-
src/plm/core/model/LessonRunner.java | 3 +-
src/plm/core/model/session/SourceFile.java | 2 +-
src/plm/core/ui/AboutLessonDialog.java | 7 +-
src/plm/core/ui/AboutPLMDialog.java | 106 +-
src/plm/core/ui/ChooseLectureDialog.java | 4 +
src/plm/core/ui/FeedbackDialog.java | 2 +-
src/plm/core/ui/MainFrame.java | 90 +-
src/plm/core/ui/TipsDialog.java | 6 +-
src/plm/core/ui/editor/MissionEditor.java | 2 +-
src/plm/universe/EntityControlPanel.java | 2 +-
src/plm/universe/bugglequest/BuggleWorld.java | 57 +-
src/plm/universe/sort/SortingWorld.java | 14 +-
src/plm/universe/turtles/Turtle.java | 17 +
src/plm/universe/turtles/TurtleWorld.fr.html | 9 +
src/plm/universe/turtles/TurtleWorld.html | 9 +
src/plm/universe/turtles/TurtleWorld.java | 36 +-
src/plm/universe/turtles/TurtleWorldView.java | 10 +-
97 files changed, 10195 insertions(+), 7568 deletions(-)
diff --git a/COPYING b/COPYING
index bc356e1..9f2b477 100644
--- a/COPYING
+++ b/COPYING
@@ -1,21 +1,29 @@
-Most of the PLM software was written internally by the team. This
-software is distributed under the GNU general public license version
-3, which you can find in the archive under the name LICENSE-GPL-3.
+Copyright (c) 2008-2013.
+The PLM Team: Martin Quinson, Gérald Oster and others.
+(see the git logs for the exact authorship of each file).
-For any copyright year range specified as YYYY-ZZZZ in this package
-note that the range specifies every single year in that closed
-interval.
-Some perticular files distributed with the project have other
-licenses. More specifically, these files are listed below, along with
-their license.
+The PLM software was written internally by the team. This software is
+distributed under the GNU general public license version 3 (GPLv3).
-=========================================================================
+The pedagogical material distributed with the PLM is covered both by
+the GPLv3 license (mainly for the included code) and by the CC-BY-SA
+license (mainly for the other media files). But the exact boundary
+here between the source code and the media is left as an exercise to
+the reader, so this material is distributed under both licenses for
+sake of simplicity.
-The pedagogical material distributed with PLM is also covered by the
-CC-BY-SA license, that you can find at:
+The GPLv3 license can be found in the archive under the name
+LICENSE-GPL-3. The CC-BY-SA license can be found online:
http://creativecommons.org/licenses/by-sa/3.0/
+
+The whole artwork is free content, licenced under CC-BY-SA, GPL, LGPL
+and/or CC0-public domain. Some parts were done by us, other parts were
+borowed from free collections. The specific license and origin of each
+files is listed below.
+
+
=========================================================================
The artwork we did ourselves is distributed under the CC-BY-SA license.
@@ -37,12 +45,14 @@ The artwork we did ourselves is distributed under the CC-BY-SA license.
img/btn-reset.png is a mashup of mine between btn-start.png (CC-BY-SA) and
http://openiconlibrary.sourceforge.net/gallery2/?./Icons/actions/run-rebuild.png
(LGPL-2.1). The result can be used under either licence.
+
+ Several exercises provide screenshot of PLM itself to help the
+ student. These images are naturally CC-BY-SA too.
=========================================================================
We borrowed the following icons, that are CC-BY-SA too:
-* The turtle was borowed from the kturtle project, from KDE edu.
* The bunny and egg in BuggleQuest universe come from:
plm/universe/bugglequest/ui/egg.png http://openclipart.org/detail/93979/
plm/universe/bugglequest/ui/rabbit.png http://openclipart.org/detail/23052/
@@ -85,7 +95,7 @@ The following icons are LGPL:
The following logos are GPLv2:
img/busyicon/*: (gnome) http://openiconlibrary.sourceforge.net/gallery2/?./Icons/animations/process-working.png
- img/world_turtle.png : stollen to the kturtle project, that is GPLv2+
+ img/world_turtle.png : stolen to the kturtle project, that is GPLv2+
=========================================================================
@@ -96,6 +106,7 @@ img/lang_java.png
img/lang_javascript.png
img/lang_python.png
img/lang_ruby.png
+img/lang_scala.png
=========================================================================
diff --git a/ChangeLog b/ChangeLog
index 2e370b6..e1709aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+20131113: Release 2.3
+
+ * LectureChooser: fix preferred size to the MainFrame one (fix #118)
+ * AboutDialog: display the license and ChangeLog too
+ * TurtleWorld: better error message when the amount of lines differs
+ * TurtleWorld: new builtins to hide()/show() the turtle.
+ * PancakeWorld: The larger pancake is getStackSize()-1
+ * PancakeWorld: avoid ../ in the icon path: doesn't work in jarfiles
+ * recursion.DragonCurve1: slight mission text improvement
+ * recursion.SquareKoch: new exercise (variation over the Koch idea)
+ * recursion.PentaKoch: new exercise (another variation of Koch curve)
+ * recursion.HexaKoch: new exercise (yet another Koch curve)
+ * recursion.Crab: new exercise (another L-system: the Lévy C curve)
+ * sort.dutchflag: mention about the existing colors in the doc
+ * sort.dutchflag: allow to play with the mouse through drag and drop
+ * recursion.hanoi: builtin getRadius(slot): radius of top-most disk
+ * recursion.hanoi: allow to play with the mouse through drag and drop
+ * MainFrame: Implement a "Save a picture" feature, useful in turtleart
+ * welcome.MethodsArgs.py: compare directions without relying on
+ their name to avoid l10n issues (fix #122)
+ * As usual, fix some typos in the French translation
+
20130930: Release 2.2.7
* recursion.spiralUse: rewrite to leverage the creative mode,
diff --git a/TODO b/TODO
index 41d9a47..c499a5e 100644
--- a/TODO
+++ b/TODO
@@ -44,6 +44,7 @@ Programmer games (may require a King of Hill mode?)
* CodeRally (racing cars)
* CodeInvaders (fight between spaceships)
* MARS (assembly) http://courses.missouristate.edu/kenvollmar/mars/
+ * MMIX (assembly by Knuth) http://mmix.cs.hm.edu/index.html
* Corewars
http://www.essentialmath.com/tutorial.htm
diff --git a/build.xml b/build.xml
index 3d77eb8..b745b68 100644
--- a/build.xml
+++ b/build.xml
@@ -66,6 +66,7 @@
<fileset dir="${classes.dir}" excludes="**/.gitignore **/*.java **/*.css **/*.html"/>
<fileset dir="${src.dir}" includes="**/*.py **/*.scala **/*.java **/*.html **/*.css **/*.png **/*.map" excludes="**/.gitignore"/>
<fileset dir="${base.dir}" includes="img/*/*.png img/*.png" excludes="*"/>
+ <fileset dir="${base.dir}" includes="ChangeLog" />
<fileset dir="${lib.dir}" excludes="**/*.jar *.pl lib/l10n/* lib/l10n-engine/*"/>
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/twitter4j-core-3.0.3.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jsyntaxpane-0.9.6~r156.jar" />
@@ -102,7 +103,8 @@
<fileset dir="${classes.dir}" excludes="**/.gitignore **/*.java **/*.css **/*.html"/>
<fileset dir="${src.dir}" includes="**/*.py **/*.scala **/*.java **/*.html **/*.css **/*.png **/*.map" excludes="**/.gitignore"/>
<fileset dir="${base.dir}" includes="img/*/*.png img/*.png" excludes="*"/>
- <fileset dir="${lib.dir}" excludes="**/*.jar *.pl lib/l10n/* lib/l10n-engine/*"/>
+ <fileset dir="${base.dir}" includes="ChangeLog" />
+ <fileset dir="${lib.dir}" excludes="**/*.jar *.pl lib/l10n/* lib/l10n-engine/*"/>
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/twitter4j-core-3.0.3.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jsyntaxpane-0.9.6~r156.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib.dir}/miglayout-3.7.4.jar" />
diff --git a/lib/l10n-engine/en.po b/lib/l10n-engine/en.po
index 39e8a6c..69841dc 100644
--- a/lib/l10n-engine/en.po
+++ b/lib/l10n-engine/en.po
@@ -8,13 +8,13 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-24 01:33+0200\n"
+"POT-Creation-Date: 2013-11-13 15:44+0100\n"
"PO-Revision-Date: 2013-09-12 13:06+0200\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ASCII\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/lessons/maze/island/IslandMazeEntity.java:10
@@ -23,6 +23,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:12
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:12
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:12
+#: src/lessons/recursion/tree/TreeEntity.java:12
#: src/lessons/welcome/array/basics/Array1Entity.java:11
#: src/lessons/welcome/array/basics/Array2Entity.java:12
msgid ""
@@ -36,6 +37,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:17
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:17
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:17
+#: src/lessons/recursion/tree/TreeEntity.java:17
#: src/lessons/welcome/array/basics/Array1Entity.java:16
#: src/lessons/welcome/array/basics/Array2Entity.java:17
msgid ""
@@ -49,6 +51,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:22
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:22
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:22
+#: src/lessons/recursion/tree/TreeEntity.java:22
#: src/lessons/welcome/array/basics/Array1Entity.java:21
#: src/lessons/welcome/array/basics/Array2Entity.java:22
msgid ""
@@ -57,12 +60,14 @@ msgid ""
msgstr ""
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:68
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:163
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:73
#, java-format
msgid "move({0},{1})"
msgstr ""
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:71
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:167
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:77
msgid "Invalid move"
msgstr ""
@@ -157,37 +162,81 @@ msgstr "Switch to time view"
msgid "Switch to state view"
msgstr "Switch to state view"
+#: src/lessons/sort/dutchflag/universe/DutchFlagEntity.java:25
+msgid "Flag sorter"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:102
+msgid "This world is not a dutch flag"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:106
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
+msgid "The two worlds are of differing size"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:111
+#, java-format
+msgid " Ray #{0} differs: color {1} is not color {2}\n"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:177
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:180
+#, java-format
+msgid "Cannot swap {0} and {1} because {2} is not between 0 and {3}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:197
+#, java-format
+msgid "Cannot get the color of line #{0} because it''s not between 0 and {1}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:232
+#, java-format
+msgid ""
+"It''s still not sorted!! PLEASE REPORT THIS BUG, along with the following "
+"information:\n"
+"Initial situation: {0}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java:145
+#: src/plm/universe/sort/SortingButtonPanel.java:70
+#, java-format
+msgid "swap({0},{1})"
+msgstr ""
+
#: src/lessons/sort/pancake/universe/PancakeFlipButtonPanel.java:66
#, java-format
msgid "flip({0})"
msgstr ""
#: src/lessons/sort/pancake/universe/PancakeWorld.java:116
-msgid "This is not a world of pancakes :-("
+msgid "This is not a world of pancakes"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
-msgid "The two worlds are of differing size"
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:125
+#, java-format
+msgid " Pancake #{0} differs: {1} vs. {2}\n"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:202
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:203
#, java-format
msgid "Asked to flip {0} pancakes, but you must flip at least one"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:204
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:205
#, java-format
msgid ""
"Asked to flip {0} pancakes, but there is only {1} pancakes on this stack"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:238
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:239
#, java-format
msgid ""
"Cannot get the radius of pancake #{0} because it''s not between 0 and {1}"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:257
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:258
#, java-format
msgid ""
"Cannot get the orientation of pancake #{0} because it''s not between 0 and "
@@ -505,8 +554,8 @@ msgstr ""
#: src/plm/core/model/LessonRunner.java:97
#: src/plm/core/model/LessonRunner.java:103
-#: src/plm/core/model/LessonRunner.java:112
-#: src/plm/core/model/LessonRunner.java:118
+#: src/plm/core/model/LessonRunner.java:113
+#: src/plm/core/model/LessonRunner.java:119
msgid "Exercice passed \\o/"
msgstr "Exercice passed \\o/"
@@ -526,7 +575,7 @@ msgid ""
msgstr ""
"Congratulations, you passed this test. Which exercise will you do now?\n"
-#: src/plm/core/model/LessonRunner.java:117
+#: src/plm/core/model/LessonRunner.java:118
#, fuzzy
msgid ""
"Congratulations, you passed this exercise.\n"
@@ -700,15 +749,61 @@ msgstr ""
msgid "Abording on user request"
msgstr ""
-#: src/plm/core/ui/AboutLessonDialog.java:24
+#: src/plm/core/ui/AboutLessonDialog.java:19
msgid "About lesson - "
msgstr "About lesson - "
-#: src/plm/core/ui/AboutPLMDialog.java:34
-msgid "About PLM dialogTitle"
-msgstr "About PLM dialogTitle"
+#: src/plm/core/ui/AboutPLMDialog.java:36 src/plm/core/ui/MainFrame.java:417
+#: src/plm/core/ui/MainFrame.java:753
+msgid "About PLM"
+msgstr "About PLM"
+
+#: src/plm/core/ui/AboutPLMDialog.java:53
+#, java-format
+msgid ""
+"<html><h3 style=\"color:#666666;margin:0px;padding:0px;\">version {0} "
+"<span style=\"font-size:8px; color:#AAAAAA;margin:0px;padding:0px;\">({1})</"
+"span></h3><br/>© 2008-2011 Contributors. All rights reserved.<br/><ul "
+"style=\"margin-left:20px;\"><li>Original idea: <i>L. Turbak (Wellesley "
+"College)</i></li><li>Design and code: <i>M. Quinson and G. Oster</i></"
+"li><li>Tests: <i>Telecom Nancy students (all classes since ''11)</i></li></"
+"ul><br/>Your code is saved to {2}<br/></html>"
+msgstr ""
-#: src/plm/core/ui/AboutPLMDialog.java:71
+#: src/plm/core/ui/AboutPLMDialog.java:74
+#, fuzzy
+msgid "About"
+msgstr "About PLM"
+
+#: src/plm/core/ui/AboutPLMDialog.java:97
+msgid "Changes"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:103
+msgid ""
+"<h2>PLM is proudly Free Software</h2><p>Copyright (c) 2008-2013.<br/> The "
+"PLM Team: Martin Quinson, Gérald Oster and others.<br/> (see the git logs "
+"for the exact authorship of each file).</p> <p>The PLM software was written "
+"internally by the team. This software is distributed under the GNU general "
+"public license version 3 (GPLv3).</p> <p>The pedagogical material "
+"distributed with the PLM is covered both by the GPLv3 license (mainly for "
+"the included code) and by the CC-BY-SA license (mainly for the other media "
+"files). But the exact boundary here between the source code and the media is "
+"left as an exercise to the reader, so this material is distributed under "
+"both licenses for sake of simplicity.</p><p>The GPLv3 license can be found "
+"in the archive under the name LICENSE-GPL-3. The CC-BY-SA license can be "
+"found online: http://creativecommons.org/licenses/by-sa/3.0/</p><p>The whole "
+"artwork is free content, licenced under CC-BY-SA, GPL, LGPL and/or CC0-"
+"public domain. Some parts were done by us, other parts were borowed from "
+"free collections. The specific license and origin of each files is listed in "
+"the COPYING file distributed with the archive.</p>"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:129
+msgid "Copying"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:135
#: src/plm/core/ui/ExerciseFailedDialog.java:38
msgid "Close"
msgstr "Close"
@@ -719,6 +814,11 @@ msgstr "Close"
msgid "About world - {0}"
msgstr "About world - "
+#: src/plm/core/ui/ChooseLectureDialog.java:76
+#, fuzzy
+msgid "Choose your next exercise"
+msgstr "Choose your course"
+
#: src/plm/core/ui/ChooseLessonDialog.java:40
#, fuzzy
msgid "Choose your lesson"
@@ -740,12 +840,12 @@ msgid ""
msgstr ""
#: src/plm/core/ui/ChooseLessonDialog.java:132
-#: src/plm/core/ui/MainFrame.java:168
+#: src/plm/core/ui/MainFrame.java:215
msgid "PLM lesson files"
msgstr "PLM lesson files"
#: src/plm/core/ui/ChooseLessonDialog.java:141
-#: src/plm/core/ui/MainFrame.java:177
+#: src/plm/core/ui/MainFrame.java:224
msgid "Error"
msgstr "Error"
@@ -869,7 +969,7 @@ msgid ""
"(such as your version of PLM and Java) will <br/>automatically be added to "
"your feedback. None of these automatic information <br/>are personal and you "
"still have to identify yourself if you want to.</p><p>Alternatively, you can "
-"use the <a href='http://github.com/oster/JLM/issues'>github interface</a> "
+"use the <a href='http://github.com/oster/PLM/issues'>github interface</a> "
"for feedback.</p></html>"
msgstr ""
@@ -906,142 +1006,162 @@ msgstr "Where error and other messages get written"
#. === FILE menu ===
#. for now: leave the calls to i18n.tr: that way one is sure to get all the localized strings...
#. Menus
-#: src/plm/core/ui/MainFrame.java:157 src/plm/core/ui/MainFrame.java:675
+#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:722
msgid "File"
msgstr "File"
-#: src/plm/core/ui/MainFrame.java:159
+#: src/plm/core/ui/MainFrame.java:164
msgid "File related functions"
msgstr "File related functions"
-#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:676
+#: src/plm/core/ui/MainFrame.java:166 src/plm/core/ui/MainFrame.java:723
+msgid "Save a picture"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:172
+#, fuzzy
+msgid "PNG Image Files"
+msgstr "PLM lesson files"
+
+#: src/plm/core/ui/MainFrame.java:180
+#, java-format
+msgid "Do you want to overwrite {0}?"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:181
+#, java-format
+msgid "{0} exists"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:200
+#, java-format
+msgid "Image saved into {0}."
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:724
msgid "Load lesson"
msgstr "Load lesson"
-#: src/plm/core/ui/MainFrame.java:184 src/plm/core/ui/MainFrame.java:677
+#: src/plm/core/ui/MainFrame.java:231 src/plm/core/ui/MainFrame.java:725
msgid "Switch lesson"
msgstr "Switch lesson"
-#: src/plm/core/ui/MainFrame.java:196 src/plm/core/ui/MainFrame.java:444
-#: src/plm/core/ui/MainFrame.java:672 src/plm/core/ui/MainFrame.java:678
+#: src/plm/core/ui/MainFrame.java:243 src/plm/core/ui/MainFrame.java:491
+#: src/plm/core/ui/MainFrame.java:719 src/plm/core/ui/MainFrame.java:726
msgid "Switch exercise"
msgstr "Switch exercise"
-#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:680
+#: src/plm/core/ui/MainFrame.java:256 src/plm/core/ui/MainFrame.java:728
msgid "Teacher Console"
msgstr "Teacher Console"
#. Menu item to change the current Course
-#: src/plm/core/ui/MainFrame.java:228 src/plm/core/ui/MainFrame.java:681
+#: src/plm/core/ui/MainFrame.java:275 src/plm/core/ui/MainFrame.java:729
msgid "Choose your course"
msgstr "Choose your course"
-#: src/plm/core/ui/MainFrame.java:247 src/plm/core/ui/MainFrame.java:682
+#: src/plm/core/ui/MainFrame.java:294 src/plm/core/ui/MainFrame.java:730
msgid "Quit"
msgstr "Quit"
#. === Edit menu ===
-#: src/plm/core/ui/MainFrame.java:255 src/plm/core/ui/MainFrame.java:684
+#: src/plm/core/ui/MainFrame.java:302 src/plm/core/ui/MainFrame.java:732
msgid "Session"
msgstr "Session"
-#: src/plm/core/ui/MainFrame.java:260 src/plm/core/ui/MainFrame.java:686
+#: src/plm/core/ui/MainFrame.java:307 src/plm/core/ui/MainFrame.java:734
msgid "Revert Exercise"
msgstr "Revert Exercise"
-#: src/plm/core/ui/MainFrame.java:263 src/plm/core/ui/MainFrame.java:687
+#: src/plm/core/ui/MainFrame.java:310 src/plm/core/ui/MainFrame.java:735
msgid "Export Session Cache"
msgstr "Export Session Cache"
-#: src/plm/core/ui/MainFrame.java:266 src/plm/core/ui/MainFrame.java:688
+#: src/plm/core/ui/MainFrame.java:313 src/plm/core/ui/MainFrame.java:736
msgid "Import Session Cache"
msgstr "Import Session Cache"
-#: src/plm/core/ui/MainFrame.java:271 src/plm/core/ui/MainFrame.java:689
+#: src/plm/core/ui/MainFrame.java:318 src/plm/core/ui/MainFrame.java:737
#, fuzzy
msgid "Export Session Cache to Cloud"
msgstr "Export Session Cache"
-#: src/plm/core/ui/MainFrame.java:274 src/plm/core/ui/MainFrame.java:690
+#: src/plm/core/ui/MainFrame.java:321 src/plm/core/ui/MainFrame.java:738
#, fuzzy
msgid "Import Session Cache from Cloud"
msgstr "Import Session Cache"
-#: src/plm/core/ui/MainFrame.java:280 src/plm/core/ui/MainFrame.java:692
+#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:740
msgid "Debug mode"
msgstr "Debug mode"
-#: src/plm/core/ui/MainFrame.java:291 src/plm/core/ui/MainFrame.java:693
+#: src/plm/core/ui/MainFrame.java:338 src/plm/core/ui/MainFrame.java:741
msgid "Creative mode"
msgstr ""
#. === Language menu ===
-#: src/plm/core/ui/MainFrame.java:304 src/plm/core/ui/MainFrame.java:696
+#: src/plm/core/ui/MainFrame.java:351 src/plm/core/ui/MainFrame.java:744
msgid "Language"
msgstr "Language"
#. === Programming language changing ===
-#: src/plm/core/ui/MainFrame.java:309 src/plm/core/ui/MainFrame.java:697
+#: src/plm/core/ui/MainFrame.java:356 src/plm/core/ui/MainFrame.java:745
msgid "Human"
msgstr "Human"
-#: src/plm/core/ui/MainFrame.java:323 src/plm/core/ui/MainFrame.java:698
+#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:746
msgid "Computer"
msgstr "Computer"
#. === Help menu ===
-#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:700
+#: src/plm/core/ui/MainFrame.java:374 src/plm/core/ui/MainFrame.java:748
msgid "Help"
msgstr "Help"
-#: src/plm/core/ui/MainFrame.java:331 src/plm/core/ui/MainFrame.java:701
+#: src/plm/core/ui/MainFrame.java:378 src/plm/core/ui/MainFrame.java:749
msgid "Provide feedback"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:341 src/plm/core/ui/MainFrame.java:702
+#: src/plm/core/ui/MainFrame.java:388 src/plm/core/ui/MainFrame.java:750
msgid "About this lesson"
msgstr "About this lesson"
-#: src/plm/core/ui/MainFrame.java:354 src/plm/core/ui/MainFrame.java:703
+#: src/plm/core/ui/MainFrame.java:401 src/plm/core/ui/MainFrame.java:751
msgid "About this world"
msgstr "About this world"
-#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:705
-msgid "About PLM"
-msgstr "About PLM"
-
#. Buttons
-#: src/plm/core/ui/MainFrame.java:403 src/plm/core/ui/MainFrame.java:666
+#: src/plm/core/ui/MainFrame.java:450 src/plm/core/ui/MainFrame.java:713
msgid "Run"
msgstr "Run"
-#: src/plm/core/ui/MainFrame.java:407 src/plm/core/ui/MainFrame.java:507
-#: src/plm/core/ui/MainFrame.java:667
+#: src/plm/core/ui/MainFrame.java:454 src/plm/core/ui/MainFrame.java:554
+#: src/plm/core/ui/MainFrame.java:714
msgid "Step"
msgstr "Step"
-#: src/plm/core/ui/MainFrame.java:412 src/plm/core/ui/MainFrame.java:668
+#: src/plm/core/ui/MainFrame.java:459 src/plm/core/ui/MainFrame.java:715
msgid "Stop"
msgstr "Stop"
-#: src/plm/core/ui/MainFrame.java:418 src/plm/core/ui/MainFrame.java:669
+#: src/plm/core/ui/MainFrame.java:465 src/plm/core/ui/MainFrame.java:716
msgid "Reset"
msgstr "Reset"
-#: src/plm/core/ui/MainFrame.java:424 src/plm/core/ui/MainFrame.java:670
+#: src/plm/core/ui/MainFrame.java:471 src/plm/core/ui/MainFrame.java:717
msgid "Demo"
msgstr "Demo"
-#: src/plm/core/ui/MainFrame.java:430 src/plm/core/ui/MainFrame.java:671
+#: src/plm/core/ui/MainFrame.java:477 src/plm/core/ui/MainFrame.java:718
#: src/plm/core/ui/action/HelpMe.java:37
msgid "Call for Help"
msgstr "Call for Help"
-#: src/plm/core/ui/MainFrame.java:492
+#: src/plm/core/ui/MainFrame.java:539
msgid "Next"
msgstr "Next"
-#: src/plm/core/ui/MainFrame.java:685
+#: src/plm/core/ui/MainFrame.java:733
msgid "Lesson related functions"
msgstr "Lesson related functions"
@@ -1084,6 +1204,14 @@ msgstr "Playing demo "
msgid "Loading "
msgstr "Loading"
+#: src/plm/core/ui/TipsDialog.java:20
+msgid "Tips"
+msgstr ""
+
+#: src/plm/core/ui/TipsDialog.java:21
+msgid "(no tips to display)"
+msgstr ""
+
#: src/plm/core/ui/action/ExportCloudSession.java:78
#: src/plm/core/ui/action/ImportCloudSession.java:53
#, java-format
@@ -1254,7 +1382,7 @@ msgstr "PLM lesson files"
msgid ""
"You chose a translated mission text for edition ({0}).\n"
"This is wrong. The translations should be handled with po4a in PLM.\n"
-"Please refer to https://github.com/oster/JLM/wiki/Working-with-the-"
+"Please refer to https://github.com/oster/PLM/wiki/Working-with-the-"
"translations for more information.\n"
"\n"
"Proceed anyway?"
@@ -1571,17 +1699,17 @@ msgid ""
"Parse error. I was expecting a cell or a buggle description but got: {0}"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:551
+#: src/plm/universe/bugglequest/BuggleWorld.java:552
#, java-format
msgid " The world''s name is {0}"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:555
+#: src/plm/universe/bugglequest/BuggleWorld.java:556
#, java-format
msgid " In ({0},{1})"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:558
+#: src/plm/universe/bugglequest/BuggleWorld.java:559
#, java-format
msgid " Something is wrong about buggle ''{0}'':\n"
msgstr ""
@@ -1716,11 +1844,6 @@ msgstr ""
msgid "go"
msgstr "go"
-#: src/plm/universe/sort/SortingButtonPanel.java:70
-#, java-format
-msgid "swap({0},{1})"
-msgstr ""
-
#: src/plm/universe/sort/SortingButtonPanel.java:74
#, java-format
msgid "setValue({0},{1})"
@@ -1805,12 +1928,15 @@ msgstr ""
msgid "That's not a line."
msgstr ""
-#: src/plm/universe/turtles/TurtleWorld.java:235
+#: src/plm/universe/turtles/TurtleWorld.java:249
#, java-format
-msgid " There is only {0} shapes where {1} shapes were expected\n"
+msgid " There is {0} shapes, but {1} shapes were expected\n"
msgstr ""
-#: src/plm/universe/turtles/TurtleWorld.java:238
+#: src/plm/universe/turtles/TurtleWorld.java:252
#, java-format
msgid " {0} (got {1} instead of {2})\n"
msgstr ""
+
+#~ msgid "About PLM dialogTitle"
+#~ msgstr "About PLM dialogTitle"
diff --git a/lib/l10n-engine/fr.po b/lib/l10n-engine/fr.po
index b64adaf..99a62ff 100644
--- a/lib/l10n-engine/fr.po
+++ b/lib/l10n-engine/fr.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PLM\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-24 01:33+0200\n"
-"PO-Revision-Date: 2013-09-24 01:35+0200\n"
+"POT-Creation-Date: 2013-11-13 15:44+0100\n"
+"PO-Revision-Date: 2013-11-13 15:51+0100\n"
"Last-Translator: Martin Quinson <martin.quinson at loria.fr> and Frank STENGEL "
"<fstengel at mac.com>\n"
"Language-Team: not really\n"
@@ -24,6 +24,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:12
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:12
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:12
+#: src/lessons/recursion/tree/TreeEntity.java:12
#: src/lessons/welcome/array/basics/Array1Entity.java:11
#: src/lessons/welcome/array/basics/Array2Entity.java:12
msgid ""
@@ -39,6 +40,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:17
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:17
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:17
+#: src/lessons/recursion/tree/TreeEntity.java:17
#: src/lessons/welcome/array/basics/Array1Entity.java:16
#: src/lessons/welcome/array/basics/Array2Entity.java:17
msgid ""
@@ -54,6 +56,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:22
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:22
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:22
+#: src/lessons/recursion/tree/TreeEntity.java:22
#: src/lessons/welcome/array/basics/Array1Entity.java:21
#: src/lessons/welcome/array/basics/Array2Entity.java:22
msgid ""
@@ -64,12 +67,14 @@ msgstr ""
"exercice. Marche jusqu'à ton objectif."
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:68
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:163
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:73
#, java-format
msgid "move({0},{1})"
msgstr "deplace({0},{1})"
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:71
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:167
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:77
msgid "Invalid move"
msgstr "Déplacement invalide"
@@ -176,27 +181,73 @@ msgstr "Accéder à la vue temporelle"
msgid "Switch to state view"
msgstr "Accéder à la vue d'état"
+#: src/lessons/sort/dutchflag/universe/DutchFlagEntity.java:25
+msgid "Flag sorter"
+msgstr "Trieur de drapeau"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:102
+msgid "This world is not a dutch flag"
+msgstr "Ce monde n'est pas un drapeau Holandais"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:106
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
+msgid "The two worlds are of differing size"
+msgstr "Les deux mondes ne sont pas de la même taille"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:111
+#, java-format
+msgid " Ray #{0} differs: color {1} is not color {2}\n"
+msgstr " La ligne #{0} est différente : la couleur {1} n''est pas la couleur {2}\n"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:177
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:180
+#, java-format
+msgid "Cannot swap {0} and {1} because {2} is not between 0 and {3}"
+msgstr "Impossible d''échanger les lignes {0} et {1} car {2} n''est pas entre 0 et {3}"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:197
+#, java-format
+msgid "Cannot get the color of line #{0} because it''s not between 0 and {1}"
+msgstr "Impossible d''obtenir la couleur de la ligne numéro {0} car ce n''est pas entre 0 et {1}"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:232
+#, java-format
+msgid ""
+"It''s still not sorted!! PLEASE REPORT THIS BUG, along with the following "
+"information:\n"
+"Initial situation: {0}"
+msgstr ""
+"Ce n''est toujours pas trié !! MERCI DE RAPPORTER CE PROBLÈME, avec les informations suivantes:\n"
+"Situation initiale: {0}"
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java:145
+#: src/plm/universe/sort/SortingButtonPanel.java:70
+#, java-format
+msgid "swap({0},{1})"
+msgstr "echange({0},{1})"
+
#: src/lessons/sort/pancake/universe/PancakeFlipButtonPanel.java:66
#, java-format
msgid "flip({0})"
msgstr "retourne({0})"
#: src/lessons/sort/pancake/universe/PancakeWorld.java:116
-msgid "This is not a world of pancakes :-("
-msgstr "Ce n'est pas un monde de crêpes :-("
+msgid "This is not a world of pancakes"
+msgstr "Ce n'est pas un monde de crêpes"
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
-msgid "The two worlds are of differing size"
-msgstr "Les deux mondes ne sont pas de la même taille"
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:125
+#, java-format
+msgid " Pancake #{0} differs: {1} vs. {2}\n"
+msgstr " La crèpe numéro {0} diffère : {1} vs {2}\n"
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:202
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:203
#, java-format
msgid "Asked to flip {0} pancakes, but you must flip at least one"
msgstr ""
"Vous avez demandé de retourner {0} crêpes, mais il faut en retourner au "
"moins une."
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:204
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:205
#, java-format
msgid ""
"Asked to flip {0} pancakes, but there is only {1} pancakes on this stack"
@@ -204,7 +255,7 @@ msgstr ""
"Vous avez demandé de retourner {0} crêpes, mais il n''y a que {1} crêpes sur "
"la pile."
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:238
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:239
#, java-format
msgid ""
"Cannot get the radius of pancake #{0} because it''s not between 0 and {1}"
@@ -212,7 +263,7 @@ msgstr ""
"Impossible d''obtenir la taille de la crêpe numéro {0} car ce n''est pas "
"entre 0 et {1}"
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:257
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:258
#, java-format
msgid ""
"Cannot get the orientation of pancake #{0} because it''s not between 0 and "
@@ -592,8 +643,8 @@ msgstr ""
#: src/plm/core/model/LessonRunner.java:97
#: src/plm/core/model/LessonRunner.java:103
-#: src/plm/core/model/LessonRunner.java:112
-#: src/plm/core/model/LessonRunner.java:118
+#: src/plm/core/model/LessonRunner.java:113
+#: src/plm/core/model/LessonRunner.java:119
msgid "Exercice passed \\o/"
msgstr "Exercice réussi \\o/"
@@ -612,7 +663,7 @@ msgstr ""
"({0} tests passés)\n"
"Par quel exercice voulez vous continuer ?"
-#: src/plm/core/model/LessonRunner.java:117
+#: src/plm/core/model/LessonRunner.java:118
msgid ""
"Congratulations, you passed this exercise.\n"
"Which exercise will you do now?"
@@ -816,15 +867,60 @@ msgstr "Erreur lors du chargement de votre session"
msgid "Abording on user request"
msgstr "Abandon, comme demandé par l'utilisateur"
-#: src/plm/core/ui/AboutLessonDialog.java:24
+#: src/plm/core/ui/AboutLessonDialog.java:19
msgid "About lesson - "
msgstr "À propos de la leçon - "
-#: src/plm/core/ui/AboutPLMDialog.java:34
-msgid "About PLM dialogTitle"
+#: src/plm/core/ui/AboutPLMDialog.java:36 src/plm/core/ui/MainFrame.java:417
+#: src/plm/core/ui/MainFrame.java:753
+msgid "About PLM"
msgstr "À propos de PLM"
-#: src/plm/core/ui/AboutPLMDialog.java:71
+#: src/plm/core/ui/AboutPLMDialog.java:53
+#, java-format
+msgid ""
+"<html><h3 style=\"color:#666666;margin:0px;padding:0px;\">version {0} "
+"<span style=\"font-size:8px; color:#AAAAAA;margin:0px;padding:0px;\">({1})</"
+"span></h3><br/>© 2008-2011 Contributors. All rights reserved.<br/><ul "
+"style=\"margin-left:20px;\"><li>Original idea: <i>L. Turbak (Wellesley "
+"College)</i></li><li>Design and code: <i>M. Quinson and G. Oster</i></"
+"li><li>Tests: <i>Telecom Nancy students (all classes since ''11)</i></li></"
+"ul><br/>Your code is saved to {2}<br/></html>"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:74
+msgid "About"
+msgstr "À propos"
+
+#: src/plm/core/ui/AboutPLMDialog.java:97
+msgid "Changes"
+msgstr "Changements"
+
+#: src/plm/core/ui/AboutPLMDialog.java:103
+msgid ""
+"<h2>PLM is proudly Free Software</h2><p>Copyright (c) 2008-2013.<br/> The "
+"PLM Team: Martin Quinson, Gérald Oster and others.<br/> (see the git logs "
+"for the exact authorship of each file).</p> <p>The PLM software was written "
+"internally by the team. This software is distributed under the GNU general "
+"public license version 3 (GPLv3).</p> <p>The pedagogical material "
+"distributed with the PLM is covered both by the GPLv3 license (mainly for "
+"the included code) and by the CC-BY-SA license (mainly for the other media "
+"files). But the exact boundary here between the source code and the media is "
+"left as an exercise to the reader, so this material is distributed under "
+"both licenses for sake of simplicity.</p><p>The GPLv3 license can be found "
+"in the archive under the name LICENSE-GPL-3. The CC-BY-SA license can be "
+"found online: http://creativecommons.org/licenses/by-sa/3.0/</p><p>The whole "
+"artwork is free content, licenced under CC-BY-SA, GPL, LGPL and/or CC0-"
+"public domain. Some parts were done by us, other parts were borowed from "
+"free collections. The specific license and origin of each files is listed in "
+"the COPYING file distributed with the archive.</p>"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:129
+msgid "Copying"
+msgstr "Licence"
+
+#: src/plm/core/ui/AboutPLMDialog.java:135
#: src/plm/core/ui/ExerciseFailedDialog.java:38
msgid "Close"
msgstr "Fermer"
@@ -835,6 +931,10 @@ msgstr "Fermer"
msgid "About world - {0}"
msgstr "À propos du monde - {0}"
+#: src/plm/core/ui/ChooseLectureDialog.java:76
+msgid "Choose your next exercise"
+msgstr "Sélectionner votre prochain exercice"
+
#: src/plm/core/ui/ChooseLessonDialog.java:40
msgid "Choose your lesson"
msgstr "Sélectionner une leçon"
@@ -866,12 +966,12 @@ msgstr ""
"d'apprendre à votre rythme.</font></p><br/>"
#: src/plm/core/ui/ChooseLessonDialog.java:132
-#: src/plm/core/ui/MainFrame.java:168
+#: src/plm/core/ui/MainFrame.java:215
msgid "PLM lesson files"
msgstr "Fichiers de leçons pour la PLM"
#: src/plm/core/ui/ChooseLessonDialog.java:141
-#: src/plm/core/ui/MainFrame.java:177
+#: src/plm/core/ui/MainFrame.java:224
msgid "Error"
msgstr "Erreur"
@@ -995,6 +1095,7 @@ msgid "Report your feedback"
msgstr "Signaler un problème dans PLM"
#: src/plm/core/ui/FeedbackDialog.java:61
+#, fuzzy
msgid ""
"<html><p>Thanks for your feedback on PLM. We deeply need this to make the "
"tool match <br>your needs, so please don't hesitate to report any "
@@ -1008,7 +1109,7 @@ msgid ""
"(such as your version of PLM and Java) will <br/>automatically be added to "
"your feedback. None of these automatic information <br/>are personal and you "
"still have to identify yourself if you want to.</p><p>Alternatively, you can "
-"use the <a href='http://github.com/oster/JLM/issues'>github interface</a> "
+"use the <a href='http://github.com/oster/PLM/issues'>github interface</a> "
"for feedback.</p></html>"
msgstr ""
"<html><p>Merci pour votre retour sur PLM. Nous en avons vraiment besoin "
@@ -1062,140 +1163,159 @@ msgstr "Endroit ou les erreurs et autres messages sont écrits"
#. === FILE menu ===
#. for now: leave the calls to i18n.tr: that way one is sure to get all the localized strings...
#. Menus
-#: src/plm/core/ui/MainFrame.java:157 src/plm/core/ui/MainFrame.java:675
+#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:722
msgid "File"
msgstr "Fichier"
-#: src/plm/core/ui/MainFrame.java:159
+#: src/plm/core/ui/MainFrame.java:164
msgid "File related functions"
msgstr "Fonction relatives à la gestion de fichiers"
-#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:676
+#: src/plm/core/ui/MainFrame.java:166 src/plm/core/ui/MainFrame.java:723
+msgid "Save a picture"
+msgstr "Prendre une photo"
+
+#: src/plm/core/ui/MainFrame.java:172
+msgid "PNG Image Files"
+msgstr "Fichiers d'images PNG"
+
+#: src/plm/core/ui/MainFrame.java:180
+#, java-format
+msgid "Do you want to overwrite {0}?"
+msgstr "Voulez-vous écraser {0} ?"
+
+#: src/plm/core/ui/MainFrame.java:181
+#, java-format
+msgid "{0} exists"
+msgstr "{0} existe"
+
+#: src/plm/core/ui/MainFrame.java:200
+#, java-format
+msgid "Image saved into {0}."
+msgstr "L''image a été sauvegardée dans {0}."
+
+#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:724
msgid "Load lesson"
-msgstr "Charger Leçon"
+msgstr "Charger une leçon"
-#: src/plm/core/ui/MainFrame.java:184 src/plm/core/ui/MainFrame.java:677
+#: src/plm/core/ui/MainFrame.java:231 src/plm/core/ui/MainFrame.java:725
msgid "Switch lesson"
msgstr "Sélectionner une leçon"
-#: src/plm/core/ui/MainFrame.java:196 src/plm/core/ui/MainFrame.java:444
-#: src/plm/core/ui/MainFrame.java:672 src/plm/core/ui/MainFrame.java:678
+#: src/plm/core/ui/MainFrame.java:243 src/plm/core/ui/MainFrame.java:491
+#: src/plm/core/ui/MainFrame.java:719 src/plm/core/ui/MainFrame.java:726
msgid "Switch exercise"
msgstr "Changer d'exercice"
-#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:680
+#: src/plm/core/ui/MainFrame.java:256 src/plm/core/ui/MainFrame.java:728
msgid "Teacher Console"
msgstr "Console enseignant"
#. Menu item to change the current Course
-#: src/plm/core/ui/MainFrame.java:228 src/plm/core/ui/MainFrame.java:681
+#: src/plm/core/ui/MainFrame.java:275 src/plm/core/ui/MainFrame.java:729
msgid "Choose your course"
msgstr "Sélectionner un cours"
-#: src/plm/core/ui/MainFrame.java:247 src/plm/core/ui/MainFrame.java:682
+#: src/plm/core/ui/MainFrame.java:294 src/plm/core/ui/MainFrame.java:730
msgid "Quit"
msgstr "Quitter"
#. === Edit menu ===
-#: src/plm/core/ui/MainFrame.java:255 src/plm/core/ui/MainFrame.java:684
+#: src/plm/core/ui/MainFrame.java:302 src/plm/core/ui/MainFrame.java:732
msgid "Session"
msgstr "Session"
-#: src/plm/core/ui/MainFrame.java:260 src/plm/core/ui/MainFrame.java:686
+#: src/plm/core/ui/MainFrame.java:307 src/plm/core/ui/MainFrame.java:734
msgid "Revert Exercise"
msgstr "Recommencer l'exercice"
-#: src/plm/core/ui/MainFrame.java:263 src/plm/core/ui/MainFrame.java:687
+#: src/plm/core/ui/MainFrame.java:310 src/plm/core/ui/MainFrame.java:735
msgid "Export Session Cache"
msgstr "Exporter le cache de session"
-#: src/plm/core/ui/MainFrame.java:266 src/plm/core/ui/MainFrame.java:688
+#: src/plm/core/ui/MainFrame.java:313 src/plm/core/ui/MainFrame.java:736
msgid "Import Session Cache"
msgstr "Importer le cache de session"
-#: src/plm/core/ui/MainFrame.java:271 src/plm/core/ui/MainFrame.java:689
+#: src/plm/core/ui/MainFrame.java:318 src/plm/core/ui/MainFrame.java:737
msgid "Export Session Cache to Cloud"
msgstr "Exporter la session dans le cloud"
-#: src/plm/core/ui/MainFrame.java:274 src/plm/core/ui/MainFrame.java:690
+#: src/plm/core/ui/MainFrame.java:321 src/plm/core/ui/MainFrame.java:738
msgid "Import Session Cache from Cloud"
msgstr "Importer la session depuis le cloud"
-#: src/plm/core/ui/MainFrame.java:280 src/plm/core/ui/MainFrame.java:692
+#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:740
msgid "Debug mode"
msgstr "Mode débogage"
-#: src/plm/core/ui/MainFrame.java:291 src/plm/core/ui/MainFrame.java:693
+#: src/plm/core/ui/MainFrame.java:338 src/plm/core/ui/MainFrame.java:741
msgid "Creative mode"
msgstr "Mode créatif"
#. === Language menu ===
-#: src/plm/core/ui/MainFrame.java:304 src/plm/core/ui/MainFrame.java:696
+#: src/plm/core/ui/MainFrame.java:351 src/plm/core/ui/MainFrame.java:744
msgid "Language"
msgstr "Langage"
#. === Programming language changing ===
-#: src/plm/core/ui/MainFrame.java:309 src/plm/core/ui/MainFrame.java:697
+#: src/plm/core/ui/MainFrame.java:356 src/plm/core/ui/MainFrame.java:745
msgid "Human"
msgstr "Humain"
-#: src/plm/core/ui/MainFrame.java:323 src/plm/core/ui/MainFrame.java:698
+#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:746
msgid "Computer"
msgstr "Ordinateur"
#. === Help menu ===
-#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:700
+#: src/plm/core/ui/MainFrame.java:374 src/plm/core/ui/MainFrame.java:748
msgid "Help"
msgstr "Aide"
-#: src/plm/core/ui/MainFrame.java:331 src/plm/core/ui/MainFrame.java:701
+#: src/plm/core/ui/MainFrame.java:378 src/plm/core/ui/MainFrame.java:749
msgid "Provide feedback"
msgstr "Rapport d'anomalie"
-#: src/plm/core/ui/MainFrame.java:341 src/plm/core/ui/MainFrame.java:702
+#: src/plm/core/ui/MainFrame.java:388 src/plm/core/ui/MainFrame.java:750
msgid "About this lesson"
msgstr "À propos de cette leçon"
-#: src/plm/core/ui/MainFrame.java:354 src/plm/core/ui/MainFrame.java:703
+#: src/plm/core/ui/MainFrame.java:401 src/plm/core/ui/MainFrame.java:751
msgid "About this world"
msgstr "À propos de ce monde"
-#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:705
-msgid "About PLM"
-msgstr "À propos de PLM"
-
#. Buttons
-#: src/plm/core/ui/MainFrame.java:403 src/plm/core/ui/MainFrame.java:666
+#: src/plm/core/ui/MainFrame.java:450 src/plm/core/ui/MainFrame.java:713
msgid "Run"
msgstr "Exécuter"
-#: src/plm/core/ui/MainFrame.java:407 src/plm/core/ui/MainFrame.java:507
-#: src/plm/core/ui/MainFrame.java:667
+#: src/plm/core/ui/MainFrame.java:454 src/plm/core/ui/MainFrame.java:554
+#: src/plm/core/ui/MainFrame.java:714
msgid "Step"
msgstr "Un pas"
-#: src/plm/core/ui/MainFrame.java:412 src/plm/core/ui/MainFrame.java:668
+#: src/plm/core/ui/MainFrame.java:459 src/plm/core/ui/MainFrame.java:715
msgid "Stop"
msgstr "Stop"
-#: src/plm/core/ui/MainFrame.java:418 src/plm/core/ui/MainFrame.java:669
+#: src/plm/core/ui/MainFrame.java:465 src/plm/core/ui/MainFrame.java:716
msgid "Reset"
msgstr "Réinitialiser"
-#: src/plm/core/ui/MainFrame.java:424 src/plm/core/ui/MainFrame.java:670
+#: src/plm/core/ui/MainFrame.java:471 src/plm/core/ui/MainFrame.java:717
msgid "Demo"
msgstr "Démo"
-#: src/plm/core/ui/MainFrame.java:430 src/plm/core/ui/MainFrame.java:671
+#: src/plm/core/ui/MainFrame.java:477 src/plm/core/ui/MainFrame.java:718
#: src/plm/core/ui/action/HelpMe.java:37
msgid "Call for Help"
msgstr "Appeler à l'aide"
-#: src/plm/core/ui/MainFrame.java:492
+#: src/plm/core/ui/MainFrame.java:539
msgid "Next"
msgstr "Suivant"
-#: src/plm/core/ui/MainFrame.java:685
+#: src/plm/core/ui/MainFrame.java:733
msgid "Lesson related functions"
msgstr "Fonctions relatives aux leçons"
@@ -1237,6 +1357,14 @@ msgstr "Exécution de la démo "
msgid "Loading "
msgstr "Chargement de "
+#: src/plm/core/ui/TipsDialog.java:20
+msgid "Tips"
+msgstr "Astuces"
+
+#: src/plm/core/ui/TipsDialog.java:21
+msgid "(no tips to display)"
+msgstr "(aucune astuce disponible pour l'instant)"
+
#: src/plm/core/ui/action/ExportCloudSession.java:78
#: src/plm/core/ui/action/ImportCloudSession.java:53
#, java-format
@@ -1415,7 +1543,7 @@ msgstr "Fichiers HTML"
msgid ""
"You chose a translated mission text for edition ({0}).\n"
"This is wrong. The translations should be handled with po4a in PLM.\n"
-"Please refer to https://github.com/oster/JLM/wiki/Working-with-the-"
+"Please refer to https://github.com/oster/PLM/wiki/Working-with-the-"
"translations for more information.\n"
"\n"
"Proceed anyway?"
@@ -1773,17 +1901,17 @@ msgstr ""
"Erreur de syntaxe. J''attendais la description d''une cellule ou d''un "
"buggle mais j''ai eu : {0}"
-#: src/plm/universe/bugglequest/BuggleWorld.java:551
+#: src/plm/universe/bugglequest/BuggleWorld.java:552
#, java-format
msgid " The world''s name is {0}"
msgstr " Le nom du monde est {0}"
-#: src/plm/universe/bugglequest/BuggleWorld.java:555
+#: src/plm/universe/bugglequest/BuggleWorld.java:556
#, java-format
msgid " In ({0},{1})"
msgstr " En ({0},{1})"
-#: src/plm/universe/bugglequest/BuggleWorld.java:558
+#: src/plm/universe/bugglequest/BuggleWorld.java:559
#, java-format
msgid " Something is wrong about buggle ''{0}'':\n"
msgstr " Il y a quelque chose qui cloche avec la buggle «{0}»:\n"
@@ -1918,11 +2046,6 @@ msgstr "Couleur de la buggle"
msgid "go"
msgstr "aller"
-#: src/plm/universe/sort/SortingButtonPanel.java:70
-#, java-format
-msgid "swap({0},{1})"
-msgstr "echange({0},{1})"
-
#: src/plm/universe/sort/SortingButtonPanel.java:74
#, java-format
msgid "setValue({0},{1})"
@@ -2011,12 +2134,12 @@ msgstr "Je ne vois pas de différence (merci de rapporter cette anomalie)."
msgid "That's not a line."
msgstr "Ce n'est pas une ligne."
-#: src/plm/universe/turtles/TurtleWorld.java:235
+#: src/plm/universe/turtles/TurtleWorld.java:249
#, java-format
-msgid " There is only {0} shapes where {1} shapes were expected\n"
+msgid " There is {0} shapes, but {1} shapes were expected\n"
msgstr " Il n''y a que {0} formes là où {1} formes étaient attendues\n"
-#: src/plm/universe/turtles/TurtleWorld.java:238
+#: src/plm/universe/turtles/TurtleWorld.java:252
#, java-format
msgid " {0} (got {1} instead of {2})\n"
msgstr " {0} (trouvé {1} au lieu de {2})\n"
diff --git a/lib/l10n-engine/plm.pot b/lib/l10n-engine/plm.pot
index 61a379d..6dcf49a 100644
--- a/lib/l10n-engine/plm.pot
+++ b/lib/l10n-engine/plm.pot
@@ -8,13 +8,13 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-24 01:33+0200\n"
+"POT-Creation-Date: 2013-11-13 15:44+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/lessons/maze/island/IslandMazeEntity.java:10
@@ -23,6 +23,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:12
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:12
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:12
+#: src/lessons/recursion/tree/TreeEntity.java:12
#: src/lessons/welcome/array/basics/Array1Entity.java:11
#: src/lessons/welcome/array/basics/Array2Entity.java:12
msgid ""
@@ -36,6 +37,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:17
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:17
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:17
+#: src/lessons/recursion/tree/TreeEntity.java:17
#: src/lessons/welcome/array/basics/Array1Entity.java:16
#: src/lessons/welcome/array/basics/Array2Entity.java:17
msgid ""
@@ -49,6 +51,7 @@ msgstr ""
#: src/lessons/maze/shortestpath/ShortestPathMazeEntity.java:22
#: src/lessons/maze/wallfindfollow/WallFindFollowMazeEntity.java:22
#: src/lessons/maze/wallfollower/WallFollowerMazeEntity.java:22
+#: src/lessons/recursion/tree/TreeEntity.java:22
#: src/lessons/welcome/array/basics/Array1Entity.java:21
#: src/lessons/welcome/array/basics/Array2Entity.java:22
msgid ""
@@ -57,12 +60,14 @@ msgid ""
msgstr ""
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:68
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:163
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:73
#, java-format
msgid "move({0},{1})"
msgstr ""
#: src/lessons/recursion/hanoi/universe/HanoiMovePanel.java:71
+#: src/lessons/recursion/hanoi/universe/HanoiWorldView.java:167
#: src/lessons/sort/baseball/universe/BaseballMovePanel.java:77
msgid "Invalid move"
msgstr ""
@@ -157,37 +162,81 @@ msgstr ""
msgid "Switch to state view"
msgstr ""
+#: src/lessons/sort/dutchflag/universe/DutchFlagEntity.java:25
+msgid "Flag sorter"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:102
+msgid "This world is not a dutch flag"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:106
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
+msgid "The two worlds are of differing size"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:111
+#, java-format
+msgid " Ray #{0} differs: color {1} is not color {2}\n"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:177
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:180
+#, java-format
+msgid "Cannot swap {0} and {1} because {2} is not between 0 and {3}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:197
+#, java-format
+msgid "Cannot get the color of line #{0} because it''s not between 0 and {1}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.java:232
+#, java-format
+msgid ""
+"It''s still not sorted!! PLEASE REPORT THIS BUG, along with the following "
+"information:\n"
+"Initial situation: {0}"
+msgstr ""
+
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java:145
+#: src/plm/universe/sort/SortingButtonPanel.java:70
+#, java-format
+msgid "swap({0},{1})"
+msgstr ""
+
#: src/lessons/sort/pancake/universe/PancakeFlipButtonPanel.java:66
#, java-format
msgid "flip({0})"
msgstr ""
#: src/lessons/sort/pancake/universe/PancakeWorld.java:116
-msgid "This is not a world of pancakes :-("
+msgid "This is not a world of pancakes"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:120
-msgid "The two worlds are of differing size"
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:125
+#, java-format
+msgid " Pancake #{0} differs: {1} vs. {2}\n"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:202
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:203
#, java-format
msgid "Asked to flip {0} pancakes, but you must flip at least one"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:204
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:205
#, java-format
msgid ""
"Asked to flip {0} pancakes, but there is only {1} pancakes on this stack"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:238
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:239
#, java-format
msgid ""
"Cannot get the radius of pancake #{0} because it''s not between 0 and {1}"
msgstr ""
-#: src/lessons/sort/pancake/universe/PancakeWorld.java:257
+#: src/lessons/sort/pancake/universe/PancakeWorld.java:258
#, java-format
msgid ""
"Cannot get the orientation of pancake #{0} because it''s not between 0 and "
@@ -501,8 +550,8 @@ msgstr ""
#: src/plm/core/model/LessonRunner.java:97
#: src/plm/core/model/LessonRunner.java:103
-#: src/plm/core/model/LessonRunner.java:112
-#: src/plm/core/model/LessonRunner.java:118
+#: src/plm/core/model/LessonRunner.java:113
+#: src/plm/core/model/LessonRunner.java:119
msgid "Exercice passed \\o/"
msgstr ""
@@ -518,7 +567,7 @@ msgid ""
"Which exercise will you do now?"
msgstr ""
-#: src/plm/core/model/LessonRunner.java:117
+#: src/plm/core/model/LessonRunner.java:118
msgid ""
"Congratulations, you passed this exercise.\n"
"Which exercise will you do now?"
@@ -689,15 +738,60 @@ msgstr ""
msgid "Abording on user request"
msgstr ""
-#: src/plm/core/ui/AboutLessonDialog.java:24
+#: src/plm/core/ui/AboutLessonDialog.java:19
msgid "About lesson - "
msgstr ""
-#: src/plm/core/ui/AboutPLMDialog.java:34
-msgid "About PLM dialogTitle"
+#: src/plm/core/ui/AboutPLMDialog.java:36 src/plm/core/ui/MainFrame.java:417
+#: src/plm/core/ui/MainFrame.java:753
+msgid "About PLM"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:53
+#, java-format
+msgid ""
+"<html><h3 style=\"color:#666666;margin:0px;padding:0px;\">version {0} "
+"<span style=\"font-size:8px; color:#AAAAAA;margin:0px;padding:0px;\">({1})</"
+"span></h3><br/>© 2008-2011 Contributors. All rights reserved.<br/><ul "
+"style=\"margin-left:20px;\"><li>Original idea: <i>L. Turbak (Wellesley "
+"College)</i></li><li>Design and code: <i>M. Quinson and G. Oster</i></"
+"li><li>Tests: <i>Telecom Nancy students (all classes since ''11)</i></li></"
+"ul><br/>Your code is saved to {2}<br/></html>"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:74
+msgid "About"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:97
+msgid "Changes"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:103
+msgid ""
+"<h2>PLM is proudly Free Software</h2><p>Copyright (c) 2008-2013.<br/> The "
+"PLM Team: Martin Quinson, Gérald Oster and others.<br/> (see the git logs "
+"for the exact authorship of each file).</p> <p>The PLM software was written "
+"internally by the team. This software is distributed under the GNU general "
+"public license version 3 (GPLv3).</p> <p>The pedagogical material "
+"distributed with the PLM is covered both by the GPLv3 license (mainly for "
+"the included code) and by the CC-BY-SA license (mainly for the other media "
+"files). But the exact boundary here between the source code and the media is "
+"left as an exercise to the reader, so this material is distributed under "
+"both licenses for sake of simplicity.</p><p>The GPLv3 license can be found "
+"in the archive under the name LICENSE-GPL-3. The CC-BY-SA license can be "
+"found online: http://creativecommons.org/licenses/by-sa/3.0/</p><p>The whole "
+"artwork is free content, licenced under CC-BY-SA, GPL, LGPL and/or CC0-"
+"public domain. Some parts were done by us, other parts were borowed from "
+"free collections. The specific license and origin of each files is listed in "
+"the COPYING file distributed with the archive.</p>"
+msgstr ""
+
+#: src/plm/core/ui/AboutPLMDialog.java:129
+msgid "Copying"
msgstr ""
-#: src/plm/core/ui/AboutPLMDialog.java:71
+#: src/plm/core/ui/AboutPLMDialog.java:135
#: src/plm/core/ui/ExerciseFailedDialog.java:38
msgid "Close"
msgstr ""
@@ -708,6 +802,10 @@ msgstr ""
msgid "About world - {0}"
msgstr ""
+#: src/plm/core/ui/ChooseLectureDialog.java:76
+msgid "Choose your next exercise"
+msgstr ""
+
#: src/plm/core/ui/ChooseLessonDialog.java:40
msgid "Choose your lesson"
msgstr ""
@@ -728,12 +826,12 @@ msgid ""
msgstr ""
#: src/plm/core/ui/ChooseLessonDialog.java:132
-#: src/plm/core/ui/MainFrame.java:168
+#: src/plm/core/ui/MainFrame.java:215
msgid "PLM lesson files"
msgstr ""
#: src/plm/core/ui/ChooseLessonDialog.java:141
-#: src/plm/core/ui/MainFrame.java:177
+#: src/plm/core/ui/MainFrame.java:224
msgid "Error"
msgstr ""
@@ -855,7 +953,7 @@ msgid ""
"(such as your version of PLM and Java) will <br/>automatically be added to "
"your feedback. None of these automatic information <br/>are personal and you "
"still have to identify yourself if you want to.</p><p>Alternatively, you can "
-"use the <a href='http://github.com/oster/JLM/issues'>github interface</a> "
+"use the <a href='http://github.com/oster/PLM/issues'>github interface</a> "
"for feedback.</p></html>"
msgstr ""
@@ -891,140 +989,159 @@ msgstr ""
#. === FILE menu ===
#. for now: leave the calls to i18n.tr: that way one is sure to get all the localized strings...
#. Menus
-#: src/plm/core/ui/MainFrame.java:157 src/plm/core/ui/MainFrame.java:675
+#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:722
msgid "File"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:159
+#: src/plm/core/ui/MainFrame.java:164
msgid "File related functions"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:162 src/plm/core/ui/MainFrame.java:676
+#: src/plm/core/ui/MainFrame.java:166 src/plm/core/ui/MainFrame.java:723
+msgid "Save a picture"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:172
+msgid "PNG Image Files"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:180
+#, java-format
+msgid "Do you want to overwrite {0}?"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:181
+#, java-format
+msgid "{0} exists"
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:200
+#, java-format
+msgid "Image saved into {0}."
+msgstr ""
+
+#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:724
msgid "Load lesson"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:184 src/plm/core/ui/MainFrame.java:677
+#: src/plm/core/ui/MainFrame.java:231 src/plm/core/ui/MainFrame.java:725
msgid "Switch lesson"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:196 src/plm/core/ui/MainFrame.java:444
-#: src/plm/core/ui/MainFrame.java:672 src/plm/core/ui/MainFrame.java:678
+#: src/plm/core/ui/MainFrame.java:243 src/plm/core/ui/MainFrame.java:491
+#: src/plm/core/ui/MainFrame.java:719 src/plm/core/ui/MainFrame.java:726
msgid "Switch exercise"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:209 src/plm/core/ui/MainFrame.java:680
+#: src/plm/core/ui/MainFrame.java:256 src/plm/core/ui/MainFrame.java:728
msgid "Teacher Console"
msgstr ""
#. Menu item to change the current Course
-#: src/plm/core/ui/MainFrame.java:228 src/plm/core/ui/MainFrame.java:681
+#: src/plm/core/ui/MainFrame.java:275 src/plm/core/ui/MainFrame.java:729
msgid "Choose your course"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:247 src/plm/core/ui/MainFrame.java:682
+#: src/plm/core/ui/MainFrame.java:294 src/plm/core/ui/MainFrame.java:730
msgid "Quit"
msgstr ""
#. === Edit menu ===
-#: src/plm/core/ui/MainFrame.java:255 src/plm/core/ui/MainFrame.java:684
+#: src/plm/core/ui/MainFrame.java:302 src/plm/core/ui/MainFrame.java:732
msgid "Session"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:260 src/plm/core/ui/MainFrame.java:686
+#: src/plm/core/ui/MainFrame.java:307 src/plm/core/ui/MainFrame.java:734
msgid "Revert Exercise"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:263 src/plm/core/ui/MainFrame.java:687
+#: src/plm/core/ui/MainFrame.java:310 src/plm/core/ui/MainFrame.java:735
msgid "Export Session Cache"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:266 src/plm/core/ui/MainFrame.java:688
+#: src/plm/core/ui/MainFrame.java:313 src/plm/core/ui/MainFrame.java:736
msgid "Import Session Cache"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:271 src/plm/core/ui/MainFrame.java:689
+#: src/plm/core/ui/MainFrame.java:318 src/plm/core/ui/MainFrame.java:737
msgid "Export Session Cache to Cloud"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:274 src/plm/core/ui/MainFrame.java:690
+#: src/plm/core/ui/MainFrame.java:321 src/plm/core/ui/MainFrame.java:738
msgid "Import Session Cache from Cloud"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:280 src/plm/core/ui/MainFrame.java:692
+#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:740
msgid "Debug mode"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:291 src/plm/core/ui/MainFrame.java:693
+#: src/plm/core/ui/MainFrame.java:338 src/plm/core/ui/MainFrame.java:741
msgid "Creative mode"
msgstr ""
#. === Language menu ===
-#: src/plm/core/ui/MainFrame.java:304 src/plm/core/ui/MainFrame.java:696
+#: src/plm/core/ui/MainFrame.java:351 src/plm/core/ui/MainFrame.java:744
msgid "Language"
msgstr ""
#. === Programming language changing ===
-#: src/plm/core/ui/MainFrame.java:309 src/plm/core/ui/MainFrame.java:697
+#: src/plm/core/ui/MainFrame.java:356 src/plm/core/ui/MainFrame.java:745
msgid "Human"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:323 src/plm/core/ui/MainFrame.java:698
+#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:746
msgid "Computer"
msgstr ""
#. === Help menu ===
-#: src/plm/core/ui/MainFrame.java:327 src/plm/core/ui/MainFrame.java:700
+#: src/plm/core/ui/MainFrame.java:374 src/plm/core/ui/MainFrame.java:748
msgid "Help"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:331 src/plm/core/ui/MainFrame.java:701
+#: src/plm/core/ui/MainFrame.java:378 src/plm/core/ui/MainFrame.java:749
msgid "Provide feedback"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:341 src/plm/core/ui/MainFrame.java:702
+#: src/plm/core/ui/MainFrame.java:388 src/plm/core/ui/MainFrame.java:750
msgid "About this lesson"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:354 src/plm/core/ui/MainFrame.java:703
+#: src/plm/core/ui/MainFrame.java:401 src/plm/core/ui/MainFrame.java:751
msgid "About this world"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:370 src/plm/core/ui/MainFrame.java:705
-msgid "About PLM"
-msgstr ""
-
#. Buttons
-#: src/plm/core/ui/MainFrame.java:403 src/plm/core/ui/MainFrame.java:666
+#: src/plm/core/ui/MainFrame.java:450 src/plm/core/ui/MainFrame.java:713
msgid "Run"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:407 src/plm/core/ui/MainFrame.java:507
-#: src/plm/core/ui/MainFrame.java:667
+#: src/plm/core/ui/MainFrame.java:454 src/plm/core/ui/MainFrame.java:554
+#: src/plm/core/ui/MainFrame.java:714
msgid "Step"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:412 src/plm/core/ui/MainFrame.java:668
+#: src/plm/core/ui/MainFrame.java:459 src/plm/core/ui/MainFrame.java:715
msgid "Stop"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:418 src/plm/core/ui/MainFrame.java:669
+#: src/plm/core/ui/MainFrame.java:465 src/plm/core/ui/MainFrame.java:716
msgid "Reset"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:424 src/plm/core/ui/MainFrame.java:670
+#: src/plm/core/ui/MainFrame.java:471 src/plm/core/ui/MainFrame.java:717
msgid "Demo"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:430 src/plm/core/ui/MainFrame.java:671
+#: src/plm/core/ui/MainFrame.java:477 src/plm/core/ui/MainFrame.java:718
#: src/plm/core/ui/action/HelpMe.java:37
msgid "Call for Help"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:492
+#: src/plm/core/ui/MainFrame.java:539
msgid "Next"
msgstr ""
-#: src/plm/core/ui/MainFrame.java:685
+#: src/plm/core/ui/MainFrame.java:733
msgid "Lesson related functions"
msgstr ""
@@ -1066,6 +1183,14 @@ msgstr ""
msgid "Loading "
msgstr ""
+#: src/plm/core/ui/TipsDialog.java:20
+msgid "Tips"
+msgstr ""
+
+#: src/plm/core/ui/TipsDialog.java:21
+msgid "(no tips to display)"
+msgstr ""
+
#: src/plm/core/ui/action/ExportCloudSession.java:78
#: src/plm/core/ui/action/ImportCloudSession.java:53
#, java-format
@@ -1229,7 +1354,7 @@ msgstr ""
msgid ""
"You chose a translated mission text for edition ({0}).\n"
"This is wrong. The translations should be handled with po4a in PLM.\n"
-"Please refer to https://github.com/oster/JLM/wiki/Working-with-the-"
+"Please refer to https://github.com/oster/PLM/wiki/Working-with-the-"
"translations for more information.\n"
"\n"
"Proceed anyway?"
@@ -1543,17 +1668,17 @@ msgid ""
"Parse error. I was expecting a cell or a buggle description but got: {0}"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:551
+#: src/plm/universe/bugglequest/BuggleWorld.java:552
#, java-format
msgid " The world''s name is {0}"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:555
+#: src/plm/universe/bugglequest/BuggleWorld.java:556
#, java-format
msgid " In ({0},{1})"
msgstr ""
-#: src/plm/universe/bugglequest/BuggleWorld.java:558
+#: src/plm/universe/bugglequest/BuggleWorld.java:559
#, java-format
msgid " Something is wrong about buggle ''{0}'':\n"
msgstr ""
@@ -1688,11 +1813,6 @@ msgstr ""
msgid "go"
msgstr ""
-#: src/plm/universe/sort/SortingButtonPanel.java:70
-#, java-format
-msgid "swap({0},{1})"
-msgstr ""
-
#: src/plm/universe/sort/SortingButtonPanel.java:74
#, java-format
msgid "setValue({0},{1})"
@@ -1777,12 +1897,12 @@ msgstr ""
msgid "That's not a line."
msgstr ""
-#: src/plm/universe/turtles/TurtleWorld.java:235
+#: src/plm/universe/turtles/TurtleWorld.java:249
#, java-format
-msgid " There is only {0} shapes where {1} shapes were expected\n"
+msgid " There is {0} shapes, but {1} shapes were expected\n"
msgstr ""
-#: src/plm/universe/turtles/TurtleWorld.java:238
+#: src/plm/universe/turtles/TurtleWorld.java:252
#, java-format
msgid " {0} (got {1} instead of {2})\n"
msgstr ""
diff --git a/lib/l10n/fr.po b/lib/l10n/fr.po
index 3e90c26..debeb6d 100644
--- a/lib/l10n/fr.po
+++ b/lib/l10n/fr.po
@@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PLM mission texts\n"
-"POT-Creation-Date: 2013-09-30 12:10+0300\n"
-"PO-Revision-Date: 2013-09-30 12:11+0200\n"
+"POT-Creation-Date: 2013-10-18 20:50+0300\n"
+"PO-Revision-Date: 2013-10-18 21:16+0200\n"
"Last-Translator: Martin Quinson\n"
"Language-Team: none\n"
"Language: French\n"
@@ -449,8 +449,8 @@ msgstr "[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]"
#. type: Content of: outside any tag (error?)
#: src/plm/universe/sort/SortingWorld.html:30
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:24
#: src/lessons/sort/pancake/universe/PancakeWorld.html:21
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:27
msgid ""
"Returns whether the current world is selected in the graphical interface."
msgstr "Renvoi si le monde actuel est sélectionné dans l'interface graphique."
@@ -639,49 +639,82 @@ msgstr "Dessine un cercle du rayon demandé et centré sur la tortue."
#. type: Content of: <pre>
#: src/plm/universe/turtles/TurtleWorld.html:36
#, no-wrap
+msgid "[!java]void [/!]hide()"
+msgstr "[!java]void [/!]cache()"
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:37
+msgid "Hides the turtle."
+msgstr "Cache la tortue."
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:39
+#, no-wrap
+msgid "[!java]void [/!]show()"
+msgstr "[!java]void [/!]montre()"
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:40
+msgid "Shows the turtle back."
+msgstr "Montre la tortue."
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:42
+#, no-wrap
+msgid "[!java]boolean [/!]isVisible()[!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estVisible()[!scala]:Boolean[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:43
+msgid "Returns whether the turtle is currently visible."
+msgstr "Renvoie vrai si la tortue est actuellement visible."
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:45
+#, no-wrap
msgid "[!java]void [/!]clear()"
msgstr "[!java]void [/!]efface()"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:37
+#: src/plm/universe/turtles/TurtleWorld.html:46
msgid "Removes any trail on the sheet."
msgstr "Efface toutes les traces de la feuille."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:39
+#: src/plm/universe/turtles/TurtleWorld.html:48
#, no-wrap
msgid "[!java]double [/!]getHeading()[!scala]:Double[/!]"
msgstr "[!java]double [/!]getCap()[!scala]:Double[/!]"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:40
+#: src/plm/universe/turtles/TurtleWorld.html:49
msgid "Returns the current heading of the turtle (in degrees)."
msgstr "Retourne le cap actuel de la tortue (en degrés)."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:42
+#: src/plm/universe/turtles/TurtleWorld.html:51
#, no-wrap
msgid "[!java]void [/!]setHeading([!java]double [/!]angle[!scala]:Double[/!])"
msgstr "[!java]void [/!]setCap([!java]double [/!]angle[!scala]:Double[/!])"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:43
+#: src/plm/universe/turtles/TurtleWorld.html:52
msgid "Sets a new heading to the turtle (in degrees)."
msgstr "Change le cap de la tortue à l'angle indiqué (en degrés)."
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:45
+#: src/plm/universe/turtles/TurtleWorld.html:54
msgid "Functions about the pen"
msgstr "Fonctions à propos du stylo"
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:47
+#: src/plm/universe/turtles/TurtleWorld.html:56
#, no-wrap
msgid "[!java]void [/!]penUp()"
msgstr "[!java]void [/!]leveCrayon()"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:48
+#: src/plm/universe/turtles/TurtleWorld.html:57
msgid ""
"Moves the pen up (turtles have pens, not brushes as buggles). The turtle "
"will not leave any trace during its subsequent moves."
@@ -691,13 +724,13 @@ msgstr ""
"déplacements suivants."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:51
+#: src/plm/universe/turtles/TurtleWorld.html:60
#, no-wrap
msgid "[!java]void [/!]penDown()"
msgstr "[!java]void [/!]baisseCrayon()"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:52
+#: src/plm/universe/turtles/TurtleWorld.html:61
msgid ""
"Moves the pen down. The turtle will leave a trace during its subsequent "
"moves."
@@ -706,96 +739,96 @@ msgstr ""
"déplacements."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:54
+#: src/plm/universe/turtles/TurtleWorld.html:63
#, no-wrap
msgid "[!java]boolean [/!]isPenDown()[!scala]:Boolean[/!]"
msgstr "[!java]boolean [/!]estCrayonBaisse()[!scala]:Boolean[/!]"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:55
+#: src/plm/universe/turtles/TurtleWorld.html:64
msgid "Returns the current pen position as a boolean."
msgstr "Retourne si le stylo est actuellement baissé ou non."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:57
+#: src/plm/universe/turtles/TurtleWorld.html:66
#, no-wrap
msgid "[!java]Color [/!]getColor()[!scala]:Color[/!]"
msgstr "[!java]Color [/!]getCouleur()[!scala]:Color[/!]"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:58
+#: src/plm/universe/turtles/TurtleWorld.html:67
msgid "Returns the current pen color."
msgstr "Retourne la couleur actuelle du stylo."
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:60
+#: src/plm/universe/turtles/TurtleWorld.html:69
#, no-wrap
msgid "[!java]void [/!]setColor([!java]Color [/!]color[!scala]:Color[/!])"
msgstr "[!java]void [/!]setCouleur([!java]Color [/!]couleur[!scala]:Color[/!])"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:61
+#: src/plm/universe/turtles/TurtleWorld.html:70
msgid "Changes the pen color."
msgstr "Modifier la couleur du stylo."
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:63
+#: src/plm/universe/turtles/TurtleWorld.html:72
msgid "Other functions"
msgstr "Autres fonctions"
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:65
+#: src/plm/universe/turtles/TurtleWorld.html:74
#: src/plm/universe/bugglequest/BuggleWorld.html:35
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:23
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:26
#, no-wrap
msgid "[!java]boolean [/!]isSelected()[!scala]:Boolean[/!]"
msgstr "[!java]boolean [/!]estChoisie()[!scala]:Boolean[/!]"
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:66
+#: src/plm/universe/turtles/TurtleWorld.html:75
msgid ""
"Returns whether the current turtle is selected in the graphical interface."
msgstr ""
"Renvoie si la tortue actuelle est sélectionnée dans l'interface graphique."
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:68
+#: src/plm/universe/turtles/TurtleWorld.html:77
#: src/plm/universe/bugglequest/BuggleWorld.html:65
msgid "Valid colors"
msgstr "Couleurs valides"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:70
+#: src/plm/universe/turtles/TurtleWorld.html:79
#: src/plm/universe/bugglequest/BuggleWorld.html:67
msgid "Name"
msgstr "Nom"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:70
+#: src/plm/universe/turtles/TurtleWorld.html:79
#: src/plm/universe/bugglequest/BuggleWorld.html:67
msgid "Color"
msgstr "Couleur"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:71
+#: src/plm/universe/turtles/TurtleWorld.html:80
#: src/plm/universe/bugglequest/BuggleWorld.html:68
msgid "Color.black"
msgstr "Color.black"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:71
-#: src/plm/universe/turtles/TurtleWorld.html:72
-#: src/plm/universe/turtles/TurtleWorld.html:73
-#: src/plm/universe/turtles/TurtleWorld.html:74
-#: src/plm/universe/turtles/TurtleWorld.html:75
-#: src/plm/universe/turtles/TurtleWorld.html:76
-#: src/plm/universe/turtles/TurtleWorld.html:77
-#: src/plm/universe/turtles/TurtleWorld.html:78
-#: src/plm/universe/turtles/TurtleWorld.html:79
#: src/plm/universe/turtles/TurtleWorld.html:80
#: src/plm/universe/turtles/TurtleWorld.html:81
#: src/plm/universe/turtles/TurtleWorld.html:82
#: src/plm/universe/turtles/TurtleWorld.html:83
+#: src/plm/universe/turtles/TurtleWorld.html:84
+#: src/plm/universe/turtles/TurtleWorld.html:85
+#: src/plm/universe/turtles/TurtleWorld.html:86
+#: src/plm/universe/turtles/TurtleWorld.html:87
+#: src/plm/universe/turtles/TurtleWorld.html:88
+#: src/plm/universe/turtles/TurtleWorld.html:89
+#: src/plm/universe/turtles/TurtleWorld.html:90
+#: src/plm/universe/turtles/TurtleWorld.html:91
+#: src/plm/universe/turtles/TurtleWorld.html:92
#: src/plm/universe/bugglequest/BuggleWorld.html:56
#: src/plm/universe/bugglequest/BuggleWorld.html:68
#: src/plm/universe/bugglequest/BuggleWorld.html:69
@@ -818,73 +851,73 @@ msgid " "
msgstr " "
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:72
+#: src/plm/universe/turtles/TurtleWorld.html:81
#: src/plm/universe/bugglequest/BuggleWorld.html:69
msgid "Color.blue"
msgstr "Color.blue"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:73
+#: src/plm/universe/turtles/TurtleWorld.html:82
#: src/plm/universe/bugglequest/BuggleWorld.html:70
msgid "Color.cyan"
msgstr "Color.cyan"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:74
+#: src/plm/universe/turtles/TurtleWorld.html:83
#: src/plm/universe/bugglequest/BuggleWorld.html:71
msgid "Color.darkGray"
msgstr "Color.darkGray"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:75
+#: src/plm/universe/turtles/TurtleWorld.html:84
#: src/plm/universe/bugglequest/BuggleWorld.html:72
msgid "Color.gray"
msgstr "Color.gray"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:76
+#: src/plm/universe/turtles/TurtleWorld.html:85
#: src/plm/universe/bugglequest/BuggleWorld.html:73
msgid "Color.green"
msgstr "Color.green"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:77
+#: src/plm/universe/turtles/TurtleWorld.html:86
#: src/plm/universe/bugglequest/BuggleWorld.html:74
msgid "Color.lightGray"
msgstr "Color.lightGray"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:78
+#: src/plm/universe/turtles/TurtleWorld.html:87
#: src/plm/universe/bugglequest/BuggleWorld.html:75
msgid "Color.magenta"
msgstr "Color.magenta"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:79
+#: src/plm/universe/turtles/TurtleWorld.html:88
#: src/plm/universe/bugglequest/BuggleWorld.html:76
msgid "Color.orange"
msgstr "Color.orange"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:80
+#: src/plm/universe/turtles/TurtleWorld.html:89
#: src/plm/universe/bugglequest/BuggleWorld.html:77
msgid "Color.pink"
msgstr "Color.pink"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:81
+#: src/plm/universe/turtles/TurtleWorld.html:90
#: src/plm/universe/bugglequest/BuggleWorld.html:78
msgid "Color.red"
msgstr "Color.red"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:82
+#: src/plm/universe/turtles/TurtleWorld.html:91
#: src/plm/universe/bugglequest/BuggleWorld.html:79
msgid "Color.white"
msgstr "Color.white"
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:83
+#: src/plm/universe/turtles/TurtleWorld.html:92
#: src/plm/universe/bugglequest/BuggleWorld.html:80
msgid "Color.yellow"
msgstr "Color.yellow"
@@ -1323,6 +1356,58 @@ msgstr ""
"une exception."
#. type: Content of: <h1>
+#: src/plm/universe/bat/BatWorld.html:1
+msgid "BatWorld"
+msgstr "BatWorld"
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:3
+msgid ""
+"This world is a simplistic testing environment largely inspired from the "
+"http://codingbat.com invented by Nick Parlente."
+msgstr ""
+"Ce monde contient un environnement simpliste de tests largement inspiré de "
+"http://codingbat.com inventé par Nick Parlente."
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:6
+msgid ""
+"The typical exercises are very short ones, aiming at improving the tactical "
+"programming abilities of the students. That is to say that you will be "
+"presented a quite long list of very little exercises about rather simple "
+"things. The idea is to train you on these issues until they become automatic "
+"to you."
+msgstr ""
+"Les exercices classiques sont très courts, et visent à améliorer les "
+"abilités de stratégie de programmation des étudiants. C'est pour vous "
+"prévenir que vous allez faire face à une très longue liste de très petits "
+"exercices à propos de choses très simples. L'idée est de vous entrainer sur "
+"ces problèmes jusqu'à ce que cela devienne automatique."
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:12
+msgid ""
+"In contrary to the other worlds, the BatWorld does not provide any fancy "
+"abstraction nor visualization. You have to fill a function, which gets "
+"called for a bunch of parameter sets, and that's it."
+msgstr ""
+"Contrairement aux autres mondes, le BatWorld ne fournit pas ni de belle "
+"abstractions ni de belles visualisaitons. Vous aurez à remplier une "
+"fonction, qui sera appelée avec un tas d'ensembles de différentes "
+"paramètres, et c'est tout."
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:16
+msgid ""
+"For more information, you should refer to the CodingBat.com documentation, "
+"which contains for example a very useful documentation on boolean operators: "
+"http://codingbat.com/doc/ifboolean.html"
+msgstr ""
+"Pour plus d'informations, vous devriez consulter la documentation de "
+"CodingBat.com qui contient par exemple une documentation très utile sur les "
+"opérateurs booléens : http://codingbat.com/doc/ifboolean.html"
+
+#. type: Content of: <h1>
#: src/lessons/backtracking/Main.html:1
msgid "Backtracking lesson"
msgstr "Leçon sur le \"backtracking\""
@@ -6954,13 +7039,15 @@ msgstr ""
"exercice est inspiré, pour d'avantages de détails."
#. type: Content of: <h3>
-#: src/lessons/turmites/Main.html:21 src/lessons/sort/pancake/Main.html:29
+#: src/lessons/turmites/Main.html:21 src/lessons/sort/dutchflag/Main.html:8
+#: src/lessons/sort/pancake/Main.html:29
#: src/lessons/sort/baseball/Main.html:27 src/lessons/turtleart/Main.html:11
msgid "What can I do to improve this PLM universe?"
msgstr "Que puis-je faire pour améliorer cet univers de PLM?"
#. type: Content of: <p>
-#: src/lessons/turmites/Main.html:23 src/lessons/sort/pancake/Main.html:31
+#: src/lessons/turmites/Main.html:23 src/lessons/sort/dutchflag/Main.html:10
+#: src/lessons/sort/pancake/Main.html:31
#: src/lessons/sort/baseball/Main.html:29 src/lessons/turtleart/Main.html:13
msgid ""
"As usual, there are several things that could be done in the code of this "
@@ -8703,5554 +8790,5981 @@ msgstr ""
"terminé sa tâche."
#. type: Content of: <h1>
-#: src/lessons/recursion/Main.html:1
-msgid "Recursive algorithms"
-msgstr "Algorithmes récursifs"
+#: src/lessons/sort/dutchflag/Main.html:1
+#: src/lessons/sort/dutchflag/short_desc.html:1
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:1
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:1
+msgid "The Dutch Flag Problem"
+msgstr "Le problème du drapeau hollandais"
+
+#. type: Content of: <p>
+#: src/lessons/sort/dutchflag/Main.html:3
+msgid ""
+"This problem was first proposed by E.W Dijkstra in 1976 (in the chapter 14 "
+"of his book \"A Discipline of Programming\"). It is a very classical "
+"variation of the sorting algorithms since then. It is sometimes useful in "
+"real life, but it became famous for its pedagogical properties: its "
+"complexity is not trivial, but not complex either. It can easily be "
+"formally proven, but it's not absolutely trivial either."
+msgstr ""
+"Ce problème a été proposé pour la première fois par E.W.Dijkstra en 1976 "
+"(dans le chapitre 14 de son livre «A discipline of Programming»). C'est une "
+"variation très étudiée du tri par insertion depuis. Ce tri est parfois utile "
+"dans la vraie vie, mais il est surtout célèbre pour ses vertus "
+"pédagogiques : calculer sa complexité n'est ni trop simple ni trop dur, "
+"démontrer sa correction est très accessible sans être complètement trivial."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/Main.html:2
-msgid "This lesson allows to experiment with recursive algorithms."
-msgstr "Cette leçon vous permet d'expérimenter avec des algorithmes récursifs."
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:12
+msgid "A temporal view could be welcomed."
+msgstr "Une vue temporelle serait bienvenue."
-#. type: Content of: <p>
-#: src/lessons/recursion/Main.html:4
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:13
msgid ""
-"If you need more recursive algorithms, an exercise on recursive sorting "
-"algorithms (in particular QuickSort and MergeSort) is planned in the future "
-"within the sorting lesson."
+"Other exercises, for example with 2 colors only or with more than 3 colors, "
+"could generalize the proposed approach."
msgstr ""
-"Si vous cherchez d'autres algorithmes récursifs, un exercice sur les tris "
-"récursifs (en particulier QuickSort et MergeSort) est prévu à l'avenir dans "
-"la leçon sur les tris."
+"D'autres exercices, par exemple avec seulement deux couleurs ou avec plus de "
+"3 couleurs, pourraient généraliser l'approche."
-#. type: Content of: <h3>
-#: src/lessons/recursion/short_desc.html:1
-msgid "Bases of recursion"
-msgstr "Les bases de la récursion"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:14
+msgid "This problem could be solved recursively."
+msgstr "Ce problème peut être résolu récursivement."
#. type: Content of: <p>
-#: src/lessons/recursion/short_desc.html:2
+#: src/lessons/sort/dutchflag/short_desc.html:3
msgid ""
-"Discover the recursive way of thinking by drawing trees and other figures "
-"with the Logo turtle."
+"This is a classical sorting problem, constituting a variation over the "
+"insertion sort."
msgstr ""
-"Découvrez la récursion en dessinant des arbres et d'autres figures avec la "
-"tortue Logo."
-
-#. type: Content of: <h2>
-#: src/lessons/recursion/square/FourSquare.html:1
-msgid "The small cousines of Buggles"
-msgstr "Les petites cousines des Buggles"
+"C'est un problème classique, qui constitue une variation du tri par "
+"insertion."
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:3
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:3
msgid ""
-"Today, we will meet the small cousines of the buggles: the turtles. In fact, "
-"turtles are much olders than the buggles. They were invented in the 70's by "
-"a scientific from MIT called Seymour Papert to help teaching programming, "
-"and the buggles are a variation on the idea invented by Lyn Turbak from "
-"Wellesley College later."
+"Your work is to sort all the colors of the Dutch flag, and the only provided "
+"primitive is to exchange two given lines. In addition, you should not "
+"create any additional variables (but a few indices)."
msgstr ""
-"Aujourd'hui, nous allons faire la connaissance des petites cousines des "
-"buggles : les tortues. En fait, les tortues sont bien plus vieilles que les "
-"buggles. Elles ont été inventées dans les années 70 par un scientifique du "
-"MIT nommé Seymour Papert pour aider à l'enseignement la programmation, et "
-"les buggles sont une variation sur le thème inventée par Lyn Turbak du "
-"Wellesley College plus tard."
+"Votre travail est de trier les couleurs du drapeau hollandais. La seule "
+"primitive à votre disposition permet d'échanger deux lignes données. De "
+"plus, vous ne devez pas créer de nouvelles variables (à l'exception de "
+"quelques indices)."
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:9
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:6
msgid ""
-"Turtles are thus a bit like buggles, but smaller. Just like buggles, you can "
-"order them to move forward, to turn, to move backward, etc. Just like "
-"buggles, they leave a line on their path when they move (but the line is "
-"much smaller)."
+"If you think carefully, this can be done in linear time, where you sort a "
+"line at each iteration of the loop. You may want to check again the <a href="
+"\"plm://lessons.sort.basic/insertion.AlgInsertionSort\">insertion sort</a>, "
+"of which the Dutch Flag sort is a variation. The main difference is that you "
+"have 3 insertion points, not only one..."
msgstr ""
-"Les tortues sont donc un peu comme les buggles, en plus petit. Comme les "
-"buggles, vous pouvez leur demander d'avancer, de tourner, de reculer, etc. "
-"Comme les buggles, elles laissent une trace sur leur passage quand elles "
-"avancent (simplement, le trait est bien plus fin)."
+"À la réflexion, on peut le faire en temps linéaire, en triant un élément à "
+"chaque étape de la boucle. Vous devriez peut-être réviser comment se passe "
+"le <a href=\"plm://lessons.sort.basic/insertion.AlgInsertionSort\">tri par "
+"insertion</a>, car le tri du drapeau hollandais est une variation sur le "
+"thème. La principale différence est que vous n'avez pas un seul point "
+"d'insertion, mais 3..."
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:14
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:10
+msgid "I need an hint to start"
+msgstr "J'ai besoin d'un indice pour commencer."
+
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:11
+msgid "Do a traversal over your data, saving 3 indices:"
+msgstr "Traversez vos données, en maintenant trois indices :"
+
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:13
msgid ""
-"The main difference is that where buggles can only move of right angles, "
-"turtles can move of any arbitrary angles specified by a real number (a "
-"double). This gives them much more liberty in their movings. The buggles can "
-"do several other tricks, like reading and writting messages, picking or "
-"dropping objects, and there is sometimes walls in their worlds (but all this "
-"is completely above the capacities of turtles)."
+"<code>afterBlue</code> is initialized to 0. Make sure that every cell below "
+"<code>afterBlue</code> is filled with blue elements."
msgstr ""
-"La principale différence est que là où les buggles ne peuvent tourner que de "
-"quarts de tour, les tortues peuvent tourner d'un angle quelconque précisé "
-"par un nombre réel (double). Cela leur donne bien plus de liberté dans leur "
-"mouvement. Les buggles savent faire plusieurs trucs qui échappent aux "
-"tortues, comme lire et écrire des messages sur le sol ou ramasser des "
-"objets, et il y a parfois des murs dans leur univers, mais tout cela dépasse "
-"complètement les tortues."
+"<code>apresBleu</code> est initialisé à 0. Assurez vous de n'avoir que des "
+"cellules bleues entre 0 et <code>apresBleu</code> à tout moment."
+
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:14
+msgid ""
+"<code>whiteRed</code> is initialized to size-1. Make sure that every cell "
+"after <code>whiteRed</code> is filled with red elements."
+msgstr ""
+"<code>blancRouge</code> est initialisé à taille-1. Assurez vous de n'avoir "
+"que des cellules rouges après <code>blancRouge</code>."
+
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:15
+msgid ""
+"<code>beforeWhite</code> is initialized to size-1. Make sure that every cell "
+"after <code>beforeWhite</code> and before <code>whiteRed</code> is filled "
+"with while elements."
+msgstr ""
+"<code>avantBlanc</code> est iniitialisé à taille-1. Assurez vous de n'avoir "
+"que des cellules blanches entre <code>avantBlanc</code> et <code>blancRouge</"
+"code>."
+
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:17
+msgid ""
+"Note that the unsorted cells are always between <code>afterBlue</code> and "
+"<code>beforeWhite</code>."
+msgstr ""
+"Remarques que les cellules non triées sont toujours entre <code>apresBleu</"
+"code> et <code>avantBlanc</code>."
+
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:19
+msgid ""
+"At each step of your traversal, check the color of the cell at "
+"<code>afterBlue</code> and do the required exchanges. The loop ending "
+"condition is when <code>afterBlue</code> becomes larger than "
+"<code>beforeWhite</code>."
+msgstr ""
+"À chaque étape de votre traversée, regardez la couleur de la case pointée "
+"par <code>apresBleu</code> et effectuez les échanges qui s'imposent. La "
+"boucle s'arrête quand <code>apresBleu</code> devient plus grand que "
+"<code>avantBlanc</code>."
+
+#. type: Content of: <h2>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:3
+msgid "Provided values"
+msgstr "Valeurs fournies"
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:21
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:5
msgid ""
-"From a practical point of view, most of the methods you knew about buggles "
-"still work with turtles, with some minor adaptations. In particular, the "
-"<code>forward()</code> method takes the amount of steps to do not as an "
-"integer, but as a [!python]point number[/!][!java|scala]double[/!] (see "
-"\"About this world\" for more details)."
+"The colors are represented through the following constants: BLUE, WHITE and "
+"RED. You can use them directly in your code."
msgstr ""
-"D'un point de vue pratique, la plupart des méthodes que vous connaissez à "
-"propos des buggles fonctionnent également avec les tortues, à quelques "
-"variantes près. En particulier, la méthode <code>avance</code> prend en "
-"argument le nombre de pas donné comme un [!python]nombre à virgule[/!][!"
-"scala|java]double[/!] (voir «Aide / À propos de ce monde» dans le menu pour "
-"plus de détails)."
+"Les couleurs sont représentées par les constantes suivantes : BLEU, BLANC et "
+"ROUGE. Vous pouvez les utiliser directement dans votre code."
-#. type: Content of: <h3>
-#: src/lessons/recursion/square/FourSquare.html:28
-msgid "Doubles? But what is it?"
-msgstr "Des doubles ? Mais qu'est ce que c'est ?"
+#. type: Content of: <h2>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:8
+msgid "Provided functions"
+msgstr "Fonctions fournies"
+
+#. type: Content of: <p>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:10
+msgid "This world is very simple, with only 5 provided functions."
+msgstr "Cet univers est très simple, avec seulement cinq fonctions fournies."
+
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:12
+#, no-wrap
+msgid "[!java]void [/!]swap([!java]int [/!]x[!scala]:Int[/!], [!java]int [/!]y[!scala]:Int[/!])"
+msgstr "[!java]void [/!]echange([!java]int [/!]x[!scala]:Int[/!], [!java]int [/!]y[!scala]:Int[/!])"
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/square/FourSquare.html:29
-msgid "It's simply a point number. Example:"
-msgstr "C'est simplement un nombre à virgule. Exemple:"
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:13
+msgid "Swap the lines number <code>x</code> and <code>y</code>."
+msgstr "Échange les lignes numéros <code>x</code> et <code>y</code>."
#. type: Content of: <pre>
-#: src/lessons/recursion/square/FourSquare.html:31
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:15
#, no-wrap
-msgid ""
-"double x = 3.72;\n"
-"x + 1.234 // Value = 4.954\n"
-"x + 2. // Value = 5.72 (2. means 2.0)\n"
-"x + 2 // [!java]Value = 5.72 (2 automatically converted to 2.0)[/!][!scala]Type error (+ operator don't mix Double and Int); manual conversion mandatory[/!]\n"
-"x * 2. // Value = 7.44 \n"
-"x / 2. // Value = 1.86 \n"
-"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Value = 1 (“casting to int”, converted to integer by truncating)\n"
-"Math.round(x) // Value = 2 (1.86 rounded to nearest integer)\n"
-"Math.floor(x) // Value = 1 (1.86 rounded toward minus infinity)\n"
-"Math.floor(-5.12) // Value = -6 (rounded toward minus infinity)\n"
-"Math.ceiling(x) // Value = 2 (1.86 rounded toward plus infinity)\n"
-"Math.ceiling(-5.12) // Value = -5 (rounded toward plus infinity)\n"
-"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 (“casted to double”, converted to double)\n"
-msgstr ""
-"double x = 3.72;\n"
-"x + 1.234 // Valeur = 4.954\n"
-"x + 2. // Valeur = 5.72 (2. signifie 2.0)\n"
-"x + 2 // [!java]Valeur = 5.72 (2 converti en 2.0 automatiquement)[/!][!scala]Erreur de typage (l'opérateur + operator ne mélange pas les Double avec les Int). Il faut convertir explicitement[/!]\n"
-"x * 2. // Valeur = 7.44\n"
-"x / 2. // Valeur = 1.86 (2 converti en 2.0 automatiquement)\n"
-"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Valeur = 1 (“transtypage en int”, converti en entier en tronquant)\n"
-"Math.round(x) // Valeur = 2 (1.86 arrondi à l'entier le plus proche)\n"
-"Math.floor(x) // Valeur = 1 (1.86 arrondi en direction de moins l'infini)\n"
-"Math.floor(-5.12) // Vale = -6 (Arrondi en direction de moins l'infini)\n"
-"Math.ceiling(x) // Value = 2 (1.86 arrondi en direction de plus l'infini)\n"
-"Math.ceiling(-5.12) // Value = -5 (Arrondi en direction de plus l'infini)\n"
-"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 (“transtypage en double”, converti en double)\n"
+msgid "[!java]int [/!]getSize() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getTaille() [!scala]:Int[/!]"
-#. type: Content of: <p><p><p><h2>
-#: src/lessons/recursion/square/FourSquare.html:47
-#: src/lessons/recursion/hanoi/HanoiBoard.html:20
-#: src/lessons/welcome/array/basics/Array1.html:229
-msgid "Goal of this exercise"
-msgstr "Objectif de l'exercice"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:16
+msgid "Returns the amount of lines on this flag."
+msgstr "Retourne le nombre de lignes sur ce drapeau."
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:48
-msgid ""
-"Even if this is the first exercise on the recursivity lesson, the code you "
-"have to write is not recursive. The goal is to get familiar with the turtle "
-"world before getting on serious matter."
-msgstr ""
-"Bien que ce soit le premier exercice de la leçon sur la récursivité, le code "
-"que vous devez écrire n'est pas récursif. L'objectif est de se familiariser "
-"avec le monde des tortues avant d'attaquer les choses sérieuses."
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:18
+#, no-wrap
+msgid "[!java]int [/!]getColor([!java]int [/!]line[!scala]:Int[/!]) [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getCouleur([!java]int [/!]line[!scala]:Int[/!]) [!scala]:Int[/!]"
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:52
-msgid ""
-"You must reproduce a simple geometrical painting constituted of four 100 "
-"steps long squares (see the objective world for more details). It is "
-"obviously a good idea to write a method to draw a square, and then use it in "
-"your code."
-msgstr ""
-"Vous devez reproduire une forme géométrique simple faite de quatre carrés de "
-"longueur 100 de coté (voir le monde objectif pour plus de détails). C'est "
-"sans doute une bonne idée d'écrire une méthode pour faire un carré, et de la "
-"réutiliser lors de l'écriture de votre code."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:19
+msgid "Returns the color of the given line."
+msgstr "Retourne la couleur d'une ligne donnée."
-#. type: Content of: <h2>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:1
-msgid "Fractal of polygons"
-msgstr "Fractales de polygones"
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:21
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:30
+#, no-wrap
+msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estTrie() [!scala]:Boolean[/!]"
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:3
-msgid ""
-"The fractal we will now draw is formed of a polygon, with little polygons on "
-"each corner. The prototype of the method drawing it is the following:"
-msgstr ""
-"La fractale que nous allons dessiner maintenant est formée d'un polygone "
-"auquel sont ajoutés des petits polygones sur chaque angle. Le prototype de "
-"la fonction le traçant est le suivant:"
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:22
+msgid "Returns whether the flag is sorted."
+msgstr "Renvoie si le drapeau est correctement trié."
#. type: Content of: <pre>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:5
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:24
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:36
#, no-wrap
-msgid "[!java]void [/!]polygonFractal ([!java]int [/!]levels[!scala]:Int[/!], [!java]int [/!]sides[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
-msgstr "[!java]void [/!]polygonFractal ([!java]int [/!]niveaux[!scala]:Int[/!], [!java]int [/!]cotés[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!], [!java]double [/!]multiplicateur[!scala]:Double[/!])"
+msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:25
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:37
+msgid "Returns whether the current world is selected in the interface."
+msgstr "Renvoi si le monde actuel est sélectionné dans l'interface graphique."
+
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:1
+msgid "PancakeWorld"
+msgstr "Monde des crêpes"
#. type: Content of: <p>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:7
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:25
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:44
-msgid ""
-"Have a look at each world's objective view to understand how to write the "
-"function."
-msgstr ""
-"Consultez les objectifs de chaque monde pour comprendre comment écrire la "
-"fonction."
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:3
+msgid "This universe is very simple, with only five functions provided."
+msgstr "Cet univers est très simple, avec seulement cinq fonctions fournies."
-#. type: Content of: <h2>
-#: src/lessons/recursion/koch/Koch.html:1
-msgid "Snow flake"
-msgstr "Flocons de neige"
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:5
+#, no-wrap
+msgid "[!java]int [/!]getStackSize() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getTaillePile() [!scala]:Int[/!]"
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/koch/Koch.html:3
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:6
msgid ""
-"We will now draw snow flakes using the Koch fractal. A fractal is a "
-"geometric pattern repeated at every scale."
+"Returns the size of the stack, that is the amount of pancakes it contains."
msgstr ""
-"Nous allons maintenant dessiner des flocons de neige en utilisant la "
-"fractale de Koch. Une fractale est un dessin géométrique dont le motif se "
-"reproduit à n'importe quelle échelle."
+"Renvoie la taille du tas de crêpes, c'est à dire le nombre de crêpes qui le "
+"compose."
-#. type: Content of: <p>
-#: src/lessons/recursion/koch/Koch.html:6
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:8
+#, no-wrap
+msgid "[!java]int [/!]getPancakeRadius([!java]int [/!]rank[!scala]:Int[/!]) [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getRayonCrepe([!java]int [/!]rang[!scala]:Int[/!]) [!scala]:Int[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:9
msgid ""
-"The general form is a triangle, with each side given by several recursive "
-"calls. Your work is only to write the code of the <code>snowSide</code> "
-"method so that it draws one side of the triangle. To make it easier, each "
-"sides are represented in a specific color. Just draw the red things (without "
-"changing your pen color), and the other colors will be drawn automatically."
+"Returns the radius of the pancake passed as argument, with the rank of the "
+"top-most pancake being 0."
msgstr ""
-"La forme générale est une sorte de triangle, dont chaque coté est généré par "
-"des appels récursifs.\n"
-"Vous ne devez dessiner qu'un coté de ce triangle dans la fonction "
-"<code>snowSide</code>. \n"
-"Pour simplifier les choses, chaque coté a une couleur particulière. "
-"Contentez vous de dessiner les choses en rouge (sans changer votre couleur), "
-"et les autres couleurs seront dessinées automatiquement."
+"Renvoie le rayon de la crêpe passée en argument, sachant que le rang de la "
+"crêpe du haut est 0."
-#. type: Content of: <p>
-#: src/lessons/recursion/koch/Koch.html:12
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:11
+#, no-wrap
+msgid "[!java]boolean [/!]isPancakeUpsideDown([!java]int [/!]rank[!scala]:Int[/!]) [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estCrepeRetournee([!java]int [/!]rang[!scala]:Int[/!]) [!scala]:Boolean[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:12
msgid ""
-"Observe the drawing in each world's objective to understand the pattern's "
-"logic, and then reproduce it. You must write the <code>snowSide()</code> "
-"method, which is recursive but <b>do not call snowFlake from snowSide</b>, "
-"or you will get very strange unexpected behaviors."
+"Returns whether the pancake passed as argument upside-down, that is, if its "
+"burned side is on top. As usual, the top-most pancake is of rank 0."
msgstr ""
-"Observez le dessin dans chaque monde objectif pour comprendre la logique de "
-"ce motif afin de la reproduire. Vous devez écrire la fonction snowSide, qui "
-"est récursive. Mais <b>n'appelez pas snowFlake depuis snowSide</b>, car "
-"sinon le résultat sera vraiment étrange et inattendu."
+"Renvoie ssi la crêpe passée en paramètre (la crêpe du haut étant de rang 0) "
+"est à l'envers, c'est-à-dire si sa face brulée est en haut."
-#. type: Content of: <h2>
-#: src/lessons/recursion/tree/Tree.html:1
-msgid "Trees"
-msgstr "Arbres"
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:14
+#, no-wrap
+msgid "[!java]void [/!]flip([!java]int [/!]amount[!scala]:Int[/!])"
+msgstr "[!java]void [/!]retourne([!java]int [/!]quantité[!scala]:Int[/!])"
-#. type: Content of: <p>
-#: src/lessons/recursion/tree/Tree.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:15
msgid ""
-"We will now draw trees. For that, we will write a method using double "
-"recursion following this prototype"
+"Flips the <code>amount</code> first pancakes composing the stack, from the "
+"top of it."
msgstr ""
-"Nous allons maintenant dessiner des arbres. Pour cela, nous allons écrire "
-"une fonction doublement récursive de prototype"
+"Retourne les <code>quantité</code> premières crêpes de la pile, en partant "
+"du sommet de celle-ci."
#. type: Content of: <pre>
-#: src/lessons/recursion/tree/Tree.html:5
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:17
#, no-wrap
-msgid "[!java]void [/!]tree([!java]int [/!]steps[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
-msgstr "[!java]void [/!]tree([!java]int [/!]nbPas[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], [!java]double [/!]multiplicateur[!scala]:Double[/!])"
+msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estTriee() [!scala]:Boolean[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:18
+msgid "Returns whether the pancake stack is correctly sorted."
+msgstr "Renvoie si la pile de crêpes est correctement triée."
+
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:20
+#, no-wrap
+msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]"
+
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/Main.html:1
+#: src/lessons/sort/pancake/BasicPancake.html:1
+msgid "Pancake Sorting"
+msgstr "Trier des crêpes"
#. type: Content of: <p>
-#: src/lessons/recursion/tree/Tree.html:7
+#: src/lessons/sort/pancake/Main.html:3
msgid ""
-"To draw a tree of four levels, you have to draw a trunk of the given length, "
-"turn right of the given angle, draw a tree of level 3, turn left twice of "
-"the given angle, draw another tree of level 3, and come back to your initial "
-"location. Don't forget to come back to the initial location!"
+"This activity is inspired by a problem first introduced in 1975 by Harry "
+"Dweighter in the American Mathematical Monthly. The question is not only to "
+"sort the pancakes, but to determine <code>f(n)</code> the <i>minimal</i> "
+"amount of flips mandated to sort any stack of size <code>n</code>."
msgstr ""
-"Pour dessiner un arbre à quatre étages, il faut dessiner un tronc de la "
-"taille indiquée, tourner à droite de l'angle indiqué, faire un arbre à 3 "
-"étages, tourner à gauche de deux fois l'angle indiqué, faire un autre arbre "
-"à 3 étages, puis revenir à sa position initiale. N'oubliez pas de revenir à "
-"la position initiale !"
+"Cette activité est inspirée d'un problème introduit pour la première fois en "
+"1975 par Harry Dweighter dans le journal de mathématique «American "
+"Mathematical Monthly». La question n'est pas tant de trier les crêpes que de "
+"déterminer <code>f(n)</code>, le nombre <i>minimal</i> de retournements "
+"nécessaires pour trier n'importe quelle pile de taille <code>n</code>. "
-#. type: Content of: <p><p><p>
-#: src/lessons/recursion/tree/Tree.html:12
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/Main.html:7
msgid ""
-"If a tree's trunk is of length 'len', the trunk of the next level tree will "
-"be of length 'len*shrink'."
+"This problem is now famous because Bill Gates authored (with C. "
+"Papadimitriou) his only scientific publication in 1979 on this topic, "
+"providing a faster algorithm and proving that <code>17n/16 ≤ f(n) ≤ (5n"
+"+5)/3</code>. This was the only publication of Bill Gates before he "
+"invented Windows and became rich."
msgstr ""
-"Si le tronc d'un arbre mesure length à l'étage N, il mesure shrink*length à "
-"l'étage N+1."
+"Ce problème est maintenant célèbre car Bill Gates a publié son seul article "
+"scientifique sur ce sujet (avec C. Papadimitriou). Ils ont proposé un "
+"algorithme plus rapide et démontré ainsi que <code>17n/16 ≤ f(n) ≤ (5n+5)</"
+"code>. Ce fut la seule publication de Bill Gates avant qu'il n'invente "
+"Windows et devienne riche. "
-#. type: Content of: <p><p><p><p><p>
-#: src/lessons/recursion/tree/Tree.html:15
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/Main.html:11
msgid ""
-"As you can see, each recursion level is represented by a distinctive color. "
-"For that, you have to call the <code>current(step)</code>, passing the "
-"current recursion level as a parameter. This will pick the right color for "
-"you. Don't erase your great colors when you move back to your initial "
-"location."
+"Then, David X. Cohen, the inventor of the Futurama comics with many "
+"mathematical references, introduced the variant with burnt pancakes and "
+"studied its complexity with Manuel Blum in 1993."
msgstr ""
-"Comme vous pouvez le voir, chaque étage de la récursion est représenté par "
-"une couleur distinctive. Pour cela, appelez la fonction <code>current(step)</"
-"code> en lui passant en paramètre l'étage actuel de la récursion. Elle se "
-"chargera de choisir la couleur adéquate. N'effacez pas vos couleurs quand "
-"vous retournez à votre position initiale."
-
-#. type: Content of: <p><p><p><p><p>
-#: src/lessons/recursion/tree/Tree.html:19
-msgid ""
-"If you get your function wrong, this can easily become hairly to debug as "
-"your errors will appear at each level of the recursion, completely changing "
-"the drawing. For debugging purpose, you can use the <code>subtree()</code> "
-"that will draw a correct subtree. This function is then very similar to the "
-"one you are trying to write. The only difference is that <code>subtree()</"
-"code> only draws in black. So, you can use it instead of a recursive call to "
-"debug your code, but you have to change for a proper recursive call to your "
-"own code (once it works) to get the colors right, and pass the exercise."
-msgstr ""
-"Si vous vous trompez dans votre fonction, il peut facilement devenir très "
-"compliqué de debugger votre code. Vos erreurs se produisant à tous les "
-"étages de la récursion, le dessin peut vite devenir illisible. Pour vous "
-"aider à debugger, vous pouvez utiliser la fonction <code>subtree()</code> "
-"qui dessine un sous-arbre correct. Cette fonction est très (très) semblable "
-"par ailleurs à la fonction que vous tentez d'écrire. La seule différence est "
-"que <code>subtree()</code> ne dessine qu'en noir. Vous pouvez donc "
-"l'utiliser à la place de vos appels récursifs pendant le debug, mais vous "
-"devez changer pour des appels récursifs à votre propre code (quand il "
-"marche) pour avoir les couleurs justes, et donc pour passer l'exercice. "
-
-#. type: Content of: <h2>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:1
-msgid "Sierpinski's Triangle"
-msgstr "Triangle de Sierpinski"
+"Par la suite, David X. Cohen, l'inventeur du dessin animé Futurama aux "
+"nombreuses références mathématiques, introduit en 1993 la variante des "
+"crêpes brulées et étudie sa complexité avec Manuel Blum."
#. type: Content of: <p>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:3
+#: src/lessons/sort/pancake/Main.html:14
msgid ""
-"The fractal we will now draw is formed of a big triangle inside which "
-"several smaller triangles are embedded. The prototype of the function to "
-"draw it is the following:"
+"An article of 2012 (by L. Bulteau, G. Fertin and I. Rusu) proved that "
+"determining the minimal amount of flips to sort the stack is a NP-complete "
+"problem. Naturally, the stack sorting problem is not NP-complete since it "
+"can be solved in 2n-3 steps with the naive algorithm and (5n+5)/3 steps with "
+"the Gates algorithm. That's determining the minimal amount of steps that is "
+"NP."
msgstr ""
-"La fractale que nous allons dessiner maintenant est formée d'un triangle "
-"dans lequel sont imbriqués des triangles plus petits. Le prototype de la "
-"fonction le traçant est le suivant :"
-
-#. type: Content of: <pre>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:6
-#, no-wrap
-msgid "[!java]void [/!]sierpinski([!java]int [/!]level[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!])"
-msgstr "[!java]void [/!]sierpinski([!java]int [/!]niveau[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!])"
+"Un article de 2013 (par L. Bulteau, G. Fertin and I. Rusu) a prouvé que ce "
+"problème est NP-Complet, c'est à dire qu'il n'existe pas d'algorithme "
+"efficace pour déterminer le nombre minimal de retournements pour toute "
+"taille de pile. Naturellement, le problème du tri de la pile n'est pas NP-"
+"complet en lui-même puisqu'on peut le résoudre en 2n-3 étapes avec "
+"l'algorithme naïf et (5n+5)/3 étapes avec l'algorithme de Gates. C'est la "
+"détermination du nombre minimal de coups qui est NP."
#. type: Content of: <p>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:8
-msgid ""
-"Have a look at each world's objective view to understand how to write the "
-"function. To draw one side of the triangle, draw a smaller recursive "
-"triangle (halve the length) and move forward by the requested length. "
-"Globally, you have to draw 3 such sides and turn by 120 between each side."
+#: src/lessons/sort/pancake/Main.html:19
+msgid "Further information can be found on the wikipedia page, as usual."
msgstr ""
-"Consultez les objectifs des différents mondes pour comprendre le code que "
-"vous devez écrire. Pour dessiner un coté du triangle, vous devez dessiner un "
-"triangle récursif plus petit (avec la moitié de la taille) et avancer de la "
-"longueur demandée. Au total, vous devez dessiner 3 cotés de la sorte en "
-"tournant de 120 entre chaque."
-
-#. type: Content of: <h2>
-#: src/lessons/recursion/spiral/Spiral.html:1
-msgid "Spirals"
-msgstr "Spirales"
+"Pour plus d'information, référez vous à la page anglophone de wikipedia "
+"(http://en.wikipedia.org/wiki/Pancake_sorting) ou à cette page, très bien "
+"faite: http://eljjdx.canalblog.com/archives/2013/02/03/26309722.html"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/spiral/Spiral.html:3
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/Main.html:22
msgid ""
-"We will now draw our first recursive function with the turtle. The goal is "
-"to draw different kind of spirals with the same function, which prototype is "
-"the following:"
+"This activity is also integrated to CSIRL (my repository of <i>free</i> "
+"unplugged activities to introduce computer science, available at http://www."
+"loria.fr/~quinson/Mediation/SMN/), and it may be interesting to run the "
+"unplugged activities before implementing these algorithms in PLM."
msgstr ""
-"Nous allons maintenant écrire notre première fonction récursive avec les "
-"tortues. L'objectif est de dessiner des spirales de différentes formes avec "
-"la même fonction, dont le prototype est le suivant:"
-
-#. type: Content of: <pre>
-#: src/lessons/recursion/spiral/Spiral.html:6
-#, no-wrap
-msgid "[!java]void [/!]spiral([!java]int [/!]steps[!scala]:Int[/!], [!java]int [/!]angle[!scala]:Int[/!], [!java]int [/!]length[!scala]:Int[/!], [!java]int [/!]increment[!scala]:Int[/!])"
-msgstr "[!java]void [/!]spiral([!java]int [/!]nbPas[!scala]:Int[/!], [!java]int [/!]angle[!scala]:Int[/!], [!java]int [/!]longueur[!scala]:Int[/!], [!java]int [/!]increment[!scala]:Int[/!])"
+"Cette activité est également intégrée à SMN (mon dépot d'activités "
+"débranchées <i>libres</i> pour introduire la science informatique, "
+"disponible à l'adresse http://www.loria.fr/~quinson/Mediation/SMN/), et il "
+"peut être intéressant de faire les activités débranchées avant d'implémenter "
+"ces algorithmes dans PLM."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/spiral/Spiral.html:8
-msgid ""
-"To help you understanding how to write it, here is an example of how the "
-"parameters change during one specific call:"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/Main.html:33
+msgid "A temporal view similar to the sorting universe could be helpful"
msgstr ""
-"Pour vous aider à comprendre comment l'écrire, voici un exemple de la suite "
-"des différentes valeurs prises par les paramètres dans un cas:"
+"Une vue temporelle comme celle de l'univers des tris pourraît être pratique."
-#. type: Content of: <pre>
-#: src/lessons/recursion/spiral/Spiral.html:11
-#, no-wrap
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/Main.html:34
msgid ""
-"spiral(5, 90, 0, 3);\n"
-" forward(0);\n"
-" left(90);\n"
-" spiral(4,90,3,3);\n"
-" forward(3);\n"
-" left(90);\n"
-" spiral(3,90,6,3);\n"
-" forward(6);\n"
-" left(90);\n"
-" spiral(2,90,9,3);\n"
-" forward(9);\n"
-" left(90);\n"
-" spiral(1,90,12,3);\n"
-" forward(12);\n"
-" left(90);\n"
-" spiral(0,90,12,3);\n"
+"Other exercises, for example on the Cohen's algorithm, or on the other ones."
msgstr ""
-"spiral(5, 90, 0, 3);\n"
-" avance(0);\n"
-" gauche(90);\n"
-" spiral(4,90,3,3);\n"
-" avance(3);\n"
-" gauche(90);\n"
-" spiral(3,90,6,3);\n"
-" avance(6);\n"
-" gauche(90);\n"
-" spiral(2,90,9,3);\n"
-" avance(9);\n"
-" gauche(90);\n"
-" spiral(1,90,12,3);\n"
-" avance(12);\n"
-" gauche(90);\n"
-" spiral(0,90,12,3);\n"
+"D'autres exercices, par exemple sur l'algorithme de Cohen ou sur d'autres."
-#. type: Content of: <h2>
-#: src/lessons/recursion/spiral/SpiralUse.html:1
-msgid "Drawing spirals"
-msgstr "Faire des spirales"
+#. type: Content of: <h3>
+#: src/lessons/sort/pancake/short_desc.html:1
+msgid "The pancake problem"
+msgstr "Le crépier psychorigide"
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:3
-msgid ""
-"This exercise is not really an exercise in that sense that you just have to "
-"click on the Execute button to get the reward: All the needed code is "
-"already provided. Instead, you can here explore the possibilities of the "
-"code you just wrote by changing the parameters of the call to the "
-"<code>spiral</code> function. You can move on to the next exercise if you "
-"are short on time, and come back later to play around."
-msgstr ""
-"Cet exercice est un peu particulier, car vous n'avez rien à faire pour le "
-"passer. Tout le code nécessaire pour le passer est fourni, et il suffit de "
-"cliquer sur le bouton «Exécuter». Il est là pour vous permettre d'explorer "
-"les possibilités du code que vous venez d'écrire en changeant les paramètres "
-"de l'appel à la fonction <code>spiral</code>. Vous pouvez passer à "
-"l'exercice suivant si le temps vous manque, puis revenir jouer ici plus tard."
+#: src/lessons/sort/pancake/short_desc.html:3
+msgid "Help the poor psychorigid pancakes' chef to sort its pancake stack!"
+msgstr "Aidez le pauvre crépier psychorigide à trier sa pile de crêpes !"
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:9
+#: src/lessons/sort/pancake/short_desc.html:5
msgid ""
-"Here are some of the figures that you can produce with your <code>Spiral</"
-"code> function, provided that you come with the right parameters. You can "
-"switch to the creative mode (from the Session menu) to disable the world "
-"comparison when you explore with these spirals."
+"This funny problem leads to algorithms that are somewhat more challenging to "
+"implement. You are supposed to master the bases of programming and some "
+"sorting algorithms to take this lesson."
msgstr ""
-"Voici quelques figures que l'on peut produire avec votre fonction "
-"<code>spiral</code> en lui passant les bons paramètres. Passez en mode "
-"créatif (dans le menu session) pour désactiver la correction de votre code "
-"quand vous explorez ces spirales."
+"Ce problème amusant débouche sur des algorithmes un peu plus compliqués à "
+"implémenter. Vous devez maîtriser les bases de la programmation ainsi que "
+"quelques algorithmes de tri avant de tenter cette leçon."
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:18
+#: src/lessons/sort/pancake/BasicPancake.html:3
msgid ""
-"If you discover a cool figure, don't forget to send your parameters (menu "
-"Help/feedback) so that we can add it to the list!"
+"The pancake sorting problem this is a simple puzzle where you have a set of "
+"pancakes, each of differing size. The chef cooking the pancake is a bit "
+"psychorigid: he hates when the pancakes are not correctly sorted on the "
+"plate. He loves when they are correctly ordered, with the small ones over "
+"the larger ones. As every pancake maker, he masters the pancake flipping "
+"with his spatula. He can flip the pancake on top of the stack, or even "
+"several pancakes at once. The thing is that he has only one plate and the "
+"table is too dirty to place pancakes on it, even temporary. The only allowed "
+"operation is to flip some pancakes that are on top of the stack."
msgstr ""
-"Si vous découvrez une figure sympa n'oubliez pas de nous envoyer vos "
-"paramètres (menu Aide/envoyer une anomalie) pour que nous puissions "
-"l'ajouter à la liste!"
-
-#. type: Content of: <h2>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:1
-msgid "Dragon curve (1)"
-msgstr "Courbe du Dragon (1)"
-
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:3
-msgid "The dragon curve is a classical example of recursive method."
-msgstr "Un exemple classique de la méthode récursive est la courbe du Dragon."
-
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:5
-msgid "The definition of this curve is the following:"
-msgstr "La définition de cette courbe est la suivante :"
+"Le problème du tri des crêpes est un puzzle simple où vous avez une pile de\n"
+"crêpes, toutes de taille différente. Le crêpier étant légèrement "
+"psychorigide,\n"
+"il déteste quand ses crêpes ne sont pas bien ordonnées dans l'assiette. Il "
+"ne se\n"
+"sent bien que quand elles sont bien rangées, avec les petites au dessus des\n"
+"grandes. Comme tous les crêpiers, il est passé maître dans l'art du "
+"retournement\n"
+"de crêpes à la spatule. Il peut retourner une crêpe au sommet de la pile, "
+"ou\n"
+"même plusieurs à la fois. Le truc est qu'il n'a qu'une seule assiette et que "
+"la\n"
+"table est trop sale pour poser des crêpes dessus, même temporairement. La "
+"seule\n"
+"opération autorisée est alors de retourner un certain nombre de crêpes au "
+"sommet\n"
+"de la pile."
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:6
+#: src/lessons/sort/pancake/BasicPancake.html:12
msgid ""
-"the dragon curve of order 1 is a vector between to arbitrary points P and Q,"
+"Your work is to help this poor guy sorting his stack by flipping the "
+"pancakes. Each pancake is defined by its radius and rank within the stack, "
+"where the bottom pancake is at rank 0, and the one above at rank 1."
msgstr ""
-"la courbe du Dragon d'ordre 1 est un vecteur entre deux points quelconques P "
-"et Q,"
+"Vous devez aider ce pauvre homme à trier sa pile en retournant des\n"
+"crêpes. Chaque crêpe est définie par son rayon et son rang dans la pile. La "
+"pile\n"
+"la plus basse est de rang 0, et celle placée au dessus d'elle est de rang 1."
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:7
+#: src/lessons/sort/pancake/BasicPancake.html:16
msgid ""
-"the dragon curve of order n is the dragon curve of order n-1 between P and "
-"R, followed by the same curve of order n-1 between R and Q (reverse side), "
-"where PRQ is an isoscele triangle with angle R being a right angle, and R "
-"being at the right of the PQ vector. Thus, if P and Q coordinates are (x, "
-"y) and (z, t), the coordinate (u, v) of R are given by:"
+"Note that you can play physically with pieces of paper or wood at first to "
+"get the grasp on this problem. This is even one of the activities that I use "
+"in my CS-IRL (computer science in real life) project to introduce the "
+"concept of algorithm to absolute beginners that wonder about our science. "
+"More information at http://www.loria.fr/~quinson/Mediation/SMN/ (in French)."
msgstr ""
-"la courbe du Dragon d'ordre n est la courbe du Dragon d'ordre n-1 entre P et "
-"R suivie de la même courbe d'ordre n-1 entre R et Q (à l'envers), où PRQ est "
-"le triangle isocèle rectangle en R, et R est à droite du vecteur PQ. Donc, "
-"si P et Q sont les points de coordonnées (x, y) et (z,t), les coordonnées "
-"(u, v) de R sont"
+"Il est conseillé de commencer par jouer physiquement avec des bouts de "
+"papier ou\n"
+"de carton pour bien comprendre le problème. C'est même l'une des activités "
+"que\n"
+"j'utilise dans mon projet SMN (Sciences Manuelles du Numérique) pour "
+"introduire\n"
+"le concept d'algorithme aux débutants curieux de notre science. Pour plus\n"
+"d'information, allez visiter le site du projet: http://www.loria.fr/~quinson/"
+"Mediation/SMN/ "
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:13
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:26
-#, no-wrap
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:22
+msgid "I don't get it. I need some help."
+msgstr "Je suis perdu, j'ai besoin d'aide."
+
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:23
msgid ""
-"u = (x + z)/2 + (t - y)/2\n"
-"v = (y + t)/2 - (z - x)/2\n"
+"You should try to first move the largest pancake to the bottom, and then the "
+"largest but one pancake on top of it, and then the one just smaller on top, "
+"and so on."
msgstr ""
-"u = (x + z)/2 + (t - y)/2\n"
-"v = (y + t)/2 - (z - x)/2\n"
+"Vous devez tout d'abord parvenir à placer la plus grande crêpe en bas de la "
+"pile et ensuite placer celle juste plus petite au dessus, puis celle plus "
+"petite et ainsi de suite."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:17
-msgid "The prototype of the method drawing the curve is the following:"
-msgstr "Le prototype de la méthode traçant la courbe est le suivant :"
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:27
+msgid "The first tip was not enough. I need another one."
+msgstr "Ce premier indice n'était pas suffisant, j'ai besoin de plus d'aide."
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:18
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:22
-#, no-wrap
-msgid "[!java]void [/!]dragon([!java]int [/!]order[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
-msgstr "[!java]void [/!]dragon([!java]int [/!]ordre[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:28
+msgid ""
+"So first, you need to move the largest pancake at the bottom of the stack."
+msgstr ""
+"Il vous faut donc amener la plus grande des crêpes tout en bas de la pile."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:21
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:29
msgid ""
-"You should use the method <code>setPos(x,y)</code> to put your turtle at "
-"coordinates (x,y) and the method <code>moveTo(z,t)</code> to draw a line "
-"between the turtle position and the point(z,t)."
+"Can you imagine a situation in which you can easily bring this damn large "
+"pancake to the bottom?"
msgstr ""
-"Vous utiliserez la méthode <code>setPos(x,y)</code> pour déplacer votre "
-"tortue aux coordonnées (x,y) et la méthode <code>allerVers(z,t)</code> pour "
-"tracer un trait depuis le point où la tortue est positionnée vers le point "
-"de coordonnées (z,t)"
+"Est ce que vous pouvez imaginer une situation où il est facile d'emener "
+"cette satanée grande crêpe tout en bas ?"
-#. type: Content of: <h2>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:1
-msgid "The dragon curve (2)"
-msgstr "Courbe du Dragon (2)"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:30
+msgid "How could you reach this situation from the current one?"
+msgstr ""
+"Et comment pourriez vous parvenir à cette situation à partir de la situation "
+"courante?"
+
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/BurnedPancake.html:1
+msgid "Burned Pancakes"
+msgstr "Crêpes brulées"
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:3
+#: src/lessons/sort/pancake/BurnedPancake.html:3
msgid ""
-"Previous solution induce that the turtle teleports to other location, or at "
-"the very least, that it moves its pen up during the drawing. Indeed, the end "
-"of the drawing of the first recursive call does not match the begining of "
-"the second recursive call. That is why we had to use the method "
-"<code>setPos()</code>"
+"Hard blow for the chef! The pancakes got burnt on one side! There is no way "
+"he can deliver a stack of pancakes with visibly burnt pancakes! You've got "
+"to help him ensuring that no pancake is upside-down while sorting his stack."
msgstr ""
-"La solution précédente nécessite que la tortue se téléporte, autrement dit, "
-"qu'il est parfois nécessaire de lever le crayon pour tracer la courbe. En "
-"effet, entre la destination du trait tracé par le premier appel récursif ne "
-"correspond pas à la source du trait qui doit être tracé par le second appel "
-"récursif. C'est pourquoi il était nécessaire d'utiliser la méthode "
-"<code>setPos()</code>"
+"Coup dur pour le crèpier! Les crêpes ont brulé sur une face! Il est "
+"strictement impossible qu'il serve une pile de crêpes où l'on voit la face "
+"brulée! Vous devez absolument l'aider à s'assurer qu'aucune face visible ne "
+"soit brulée tandis qu'il trie sa pile."
+
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/GatesPancake.html:1
+msgid "Faster Pancake Sorting"
+msgstr "Tri rapide de crêpes"
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:9
+#: src/lessons/sort/pancake/GatesPancake.html:3
msgid ""
-"In this lesson, you will write a recursive method allowing to draw the "
-"dragon curve without taking the pen up. For that, we need another recursive "
-"method drawing the mirror side of the curve."
+"Unlike others sorting problem, the expensive operation is not the comparison "
+"of values, but the flipping of pancakes. In this exercise, we will explore "
+"another algorithm that attempt to reduce the amount of stack flipping. The "
+"funny side is that this algorithm was first introduced by Bill Gates, before "
+"invented Windows."
msgstr ""
-"Dans cette leçon, vous allez donc réaliser une méthode récursive qui permet "
-"de tracer la courbe du dragon sans lever le crayon. Pour ce faire, vous "
-"définirez une seconde méthode récursive qui trace la courbe à l'envers."
+"Contrairement aux problèmes classiques de tri, l'opération coûteuse à "
+"économiser n'est pas la comparaison des valeurs, mais le retournement des "
+"crêpes. Dans cet exercice, nous allons explorer un autre algorithme "
+"permettant de réduire le nombre de retournements nécessaires pour trier la "
+"pile. Fait amusant, cet algorithme a été proposé pour la première fois par "
+"Bill Gates, avant qu'il n'invente Windows."
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:13
+#: src/lessons/sort/pancake/GatesPancake.html:8
msgid ""
-"The method <code>dragon()</code> is then recursively defined using itself "
-"and <code>dragonReverse()</code>. Likewise, the method "
-"<code>dragonReverse()</code> is defined recursively using itself and "
-"<code>dragon()</code>. This is thus an example of <i>mutual recursion</i>."
+"The basic idea is to grow sequences of sorted pancakes, not necessarily "
+"starting from the bottom. We say that a sequence of ordered pancakes "
+"constitute a <b>bloc</b> while a pancake that is not part of a bloc is said "
+"to be <b>free</b>. The algorithm then considers the topmost pancake (of "
+"radius <code>t</code>) and search for the <code>t+1</code> or <code>t-1</"
+"code> pancakes (the considered neighbor is noted <code>t+o</code>). Eight "
+"cases may happen:"
msgstr ""
-"La méthode <code>dragon()</code> sera définie récursivement en fonction des "
-"méthodes <code>dragon()</code> et <code>dragonInverse()</code>. De même, la "
-"méthode <code>dragonInverse()</code> sera définie récursivement en terme de "
-"<code>dragon()</code> et de <code>dragonInverse()</code>. Voici un bien bel "
-"exemple de <i>récursivité croisée</i>."
+"L'idée de base est de faire grandir des séquences de crêpes triées, pas "
+"forcément en commençant du bas de la pile. On dira qu'un ensemble de crêpes "
+"dans l'ordre constitue un <b>block</b> tandis qu'une crêpe qui n'est pas "
+"dans un bloc est dite <b>libre</b>. L'algorithme considère la crêpe tout en "
+"haut de la pile, dont la taille est notée <code>t</code>, et cherche les "
+"deux crêpes de taille <code>t-1</code> et <code>t+1</code> (le voisin ainsi "
+"considéré est noté <code>t+o</code>). Huit cas sont possibles alors :"
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:20
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:15
msgid ""
-"The prototype of the <code>dragon()</code> method remains unchanged from "
-"previous exercise:"
+"<b>Case a</b>: Both <code>t</code> and <code>t+o</code> are free. They are "
+"then merged in one flip."
msgstr ""
-"Le prototype de la méthode <code>dragon()</code> reste le même que "
-"précédemment :"
+"<b>Cas a</b>: <code>t</code> et <code>t+o</code> sont tous les deux libres. "
+"Ils sont alors fusionnés en un retournement."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:24
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:19
msgid ""
-"The new point's coordinate (u, v) introduced by the <code>dragon()</code> "
-"are:"
+"<b>Case b</b>: <code>t</code> is free, and <code>t+o</code> is the first of "
+"a block. They are merged in one flip."
msgstr ""
-"Les coordonnées (u, v) du nouveau point introduit par la méthode "
-"<code>dragon()</code> seront :"
+"<b>Cas b</b>: <code>t</code> est libre, et <code>t+o</code> est le premier "
+"élément d'un bloc. Ils sont fusionnés en un bloc."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:30
-msgid "The prototype of the method <code>dragonReverse</code> is similar:"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:24
+msgid ""
+"<b>Case c</b>: <code>t</code> is free but both <code>t-1</code> and <code>t"
+"+1</code> are the last elements of blocks. Both blocs and <code>t</code> "
+"are merged all together in 4 flips. Beware, if either <code>t-1</code> or "
+"<code>t+1</code> does not exist (because <code>t</code> is 0 or max), only "
+"two flips are mandated."
msgstr ""
-"Le prototype de la méthode <code>dragonInverse()</code> est identique : :"
-
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:31
-#, no-wrap
-msgid "[!java]void [/!]dragonReverse([!java]int [/!]order[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
-msgstr "[!java]void [/!]dragonReverse([!java]int [/!]ordre[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
+"<b>Cas c</b>: <code>t</code> est libre, mais <code>t-1</code> et <code>t+1</"
+"code> sont tous les deux les derniers éléments de blocs. Ces deux blocs "
+"ainsi que <code>t</code> sont tous fusionnés en 4 retournements. Prenez "
+"garde, si <code>t-1</code> ou <code>t+1</code> n'existe pas (parce que "
+"<code>t</code> est 0 ou max), seulement deux de ces retournements sont "
+"nécessaires."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:33
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:32
msgid ""
-"The new point's coordinate (u, v) introduced by the <code>dragonReverse()</"
-"code> are:"
+"<b>Case d</b>: <code>t</code> is in a block but <code>t+o</code> is free. "
+"They are merged in one flip."
msgstr ""
-"Les coordonnées (u, v) du nouveau point introduit par la méthode "
-"<code>dragonInverse()</code> seront :"
+"<b>Cas d</b>: <code>t</code> est dans un bloc, mais <code>t+o</code> est "
+"libre. Ils sont fusionnés en un retournement."
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:35
-#, no-wrap
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:37
msgid ""
-"u = (x + z)/2 - (t - y)/2\n"
-"v = (y + t)/2 + (z - x)/2\n"
+"<b>Case e</b>: <code>t</code> is in a block and <code>t+o</code> is the "
+"first element of a block. They are merged in one flip."
msgstr ""
-"u = (x + z)/2 - (t - y)/2\n"
-"v = (y + t)/2 + (z - x)/2\n"
+"<b>Cas e</b>: <code>t</code> est dans un bloc, et <code>t+o</code> est le "
+"premier élément d'un bloc. Ils sont fusionnés en un retournement."
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:39
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:41
msgid ""
-"To make the work of each method recursiv more visible, the line painted by "
-"the <code>dragon()</code> must be red (<code>Color.red</code>) while the "
-"line painted by the <code>dragonReverse()</code> must be blue (<code>Color."
-"blue</code>)."
+"<b>Case f</b>: <code>t</code> is in a block and <code>t+o</code> is the last "
+"element of another block. They are merged in 3 flips as follows."
msgstr ""
-"Afin de rendre, plus visible le travail de chacune des deux méthodes "
-"récursives, le trait tracé par la méthode <code>dragon()</code> devra être "
-"rouge (<code>Color.red</code>) et le trait tracé par la méthode "
-"<code>dragonInverse</code> devra être bleu (<code>Color.blue</code>)."
-
-#. type: Content of: <h3>
-#: src/lessons/recursion/hanoi/Main.html:1
-#: src/lessons/recursion/hanoi/short_desc.html:1
-msgid "Hanoi towers"
-msgstr "Les tours de Hanoï"
+"<b>Cas f</b>: <code>t</code> est dans un bloc, et <code>t+o</code> est le "
+"dernier élément d'un autre bloc. Ils sont fusionnés en trois retournements "
+"comme suit."
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/Main.html:2
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:45
msgid ""
-"Here comes the super classical exercise on recursion. It's not very "
-"developped here, I'm not sure of what I could add to this lesson. If you "
-"have any idea, please submit them."
+"<b>Case g</b>: <code>t</code> is in a block of length k+1 (the last element "
+"is <code>t+ko</code>), <code>t+(k+1)o</code> is either free or the last "
+"element of another block. Both blocks are merged in 2 flips:"
msgstr ""
-"Voici l'exercice ultra classique sur la récursivité. Il n'est pas très "
-"développé ici, mais je ne sais pas vraiment quoi rajouter pour prolonger le "
-"plaisir. Si vous avez des idées, n'hésitez pas à nous en faire part."
+"<b>Cas g</b>: <code>t</code> est dans un bloc de taille k+1 (le dernier "
+"élément est <code>t+ko</code>), <code>t+(k+1)o</code> est soit libre soit le "
+"dernier élément d'un autre bloc. Les deux blocs sont fusionnés en deux "
+"retournements:"
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/short_desc.html:2
-msgid "Here comes the super classical exercise on recursion."
-msgstr "Voici l'exercice ultra classique de récursivité."
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:48
+msgid ""
+"<b>Case h</b>: <code>t</code> is in a block of length k+1 (the last element "
+"is <code>t+ko</code>), <code>t+(k+1)o</code> is the first element of another "
+"block (the difference with case g is that <code>t+(k+1)o</code> is now the "
+"<i>first</i> element of its block). Both blocks are merged in 2 flips:"
+msgstr ""
+"<b>Cas h</b>: <code>t</code> est dans un bloc de taille k+1 (le dernier "
+"élément est <code>t+ko</code>), <code>t+(k+1)o</code> est le premier élément "
+"d'un autre bloc (la différence avec le cas g est que <code>t+(k+1)o</code> "
+"est maintenant le <i>premier</i> élément de son bloc). Les deux blocs sont "
+"fusionnés en deux retournements:"
+
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:54
+msgid ""
+"<b>Case i</b>: <code>t</code> is in a block of length <code>n</code> (this "
+"block contains all pancakes). If <code>t</code> is not 1, the whole stack "
+"is fliped. The algorithm then stops."
+msgstr ""
+"<b>Cas i</b>: <code>t</code> est dans un bloc de taille <code>n</code>, qui "
+"contient donc toutes les crêpes. Si <code>t</code> n'est pas 1, toute la "
+"pile est retournée. Ensuite, l'algorithme s'arrête."
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/short_desc.html:4
+#: src/lessons/sort/pancake/GatesPancake.html:57
msgid ""
-"This is an application exercise of recursion, that you should master to take "
-"this lesson."
+"Each iteration increases the size of the blocks, so the algorithm eventually "
+"halts in all cases. A finer analysis would show that it takes at most "
+"<code>(5n+5)/3</code> steps to sort the stack. That's better than the naïve "
+"algorithm, that requires 2n-3 steps."
msgstr ""
-"C'est un exercice d'application de la récursivité, que vous devez maîtriser "
-"avant de tenter cette leçon."
+"Chaque itération augmente la taille des blocs, donc la terminaison de "
+"l'algorithme est certaine. Une analyse plus fine montre qu'il prend au plus "
+"<code>(5n+5)/3</code> étapes pour trier la pile. C'est mieux que "
+"l'algorithme naïf, qui nécessite <code>2n-3</code> étapes pour cela."
#. type: Content of: <h2>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:1
-msgid "Tower of Hanoi"
-msgstr "Les tours de Hanoï"
+#: src/lessons/sort/pancake/GatesPancake.html:60
+msgid "Your turn"
+msgstr "À vous de jouer"
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:3
+#: src/lessons/sort/pancake/GatesPancake.html:61
msgid ""
-"The Tower of Hanoi or Towers of Hanoi, also called the Tower of Brahma or "
-"Towers of Brahma, is a mathematical game or puzzle. It consists of three "
-"pegs, and a number of disks of different sizes which can slide onto any peg. "
-"The puzzle starts with the disks in a neat stack in ascending order of size "
-"on one peg, the smallest at the top, thus forming a pyramid."
+"You now have almost enough information to implement this algorithm on your "
+"own. We just have to remove the last remaining ambiguities to ensure that "
+"you implement exactly the same algorithm that the correction. If several "
+"cases apply to your situation, then you should use the first given one. For "
+"example, if both cases a and b apply (e.g., with <code>t-1</code> on case "
+"<b>a</b> and <code>t+1</code> on case <b>b</b>), then you should apply the "
+"flips of case <b>a</b>. If a given case applies for both <code>t+1</code> "
+"and <code>t-1</code>, then you should apply it to <code>t+1</code>."
msgstr ""
-"La tour de Hanoï, ou les tours de Hanoï, aussi appelé la Tour de Brahma ou "
-"les tours de Brahma, est un jeu ou puzzle mathématique. Il consiste en trois "
-"tours, et un nombre de disques de différentes tailles qui peuvent glisser "
-"sur n'importe quelle tour. Le puzzle commence avec tous les disques en une "
-"belle pile selon l'ordre croissant de la taille, le plus petit en haut, sur "
-"une tour, formant donc une pyramide. L'objectif du puzzle est de déplacer la "
-"pile entière jusqu'à une autre tour, en respectant les règles suivantes :"
+"Vous avez maintenant quasi assez d'informations pour implémenter cet "
+"algorithme par vous-même. Il faut juste lever les dernières ambiguïtés pour "
+"que vous implémentiez exactement le même algorithme que la correction. Si "
+"plusieurs cas s'appliquent à la situation courante, appliquez le premier. "
+"Par exemple, si les cas a et b s'appliquent (avec <code>t-1</code> pour le "
+"cas a et <code>t+1</code> pour le cas b), vous devez appliquer les "
+"instructions du cas <b>a</b>. Si un cas donné s'applique à la fois pour "
+"<code>t+1</code> et <code>t-1</code>, appliquez le pour <code>t+1</code>."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/HanoiBoard.html:9
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/GatesPancake.html:67
msgid ""
-"The objective of the puzzle is to move the entire stack to another peg, "
-"obeying the following rules:"
+"Note that it is somehow harder than the other exercises we did so far, so "
+"don't be surprised if you need more time to achieve this. But do not give "
+"hope, you can do it!"
msgstr ""
-"Le but de ce puzzle est de déplacer tous les disques de la pile vers un "
-"autre piquet en respectant les règles suivantes :"
+"Cet exercice est plus difficile que ceux que nous avons fait jusque là, et "
+"il ne serait pas choquant que vous ayez besoin d'un peu plus de temps que "
+"les autres pour le résoudre. Mais n'abandonnez pas, vous pouvez le faire !"
-#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:11
-msgid "Only one disk may be moved at a time."
-msgstr "Seul un disque peut être bougé à la fois."
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:70
+msgid "Well, I need some help to start."
+msgstr "Heu, j'ai besoin d'un peu d'aide pour commencer."
-#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:13
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:71
msgid ""
-"Each move consists of taking the upper disk from one of the pegs and sliding "
-"it onto another peg, on top of the other disks that may already be present "
-"on that peg."
+"First write some helper functions such as <code>isFirst()</code> or "
+"<code>isFree()</code>. This will simplify your main algorithm afterward, "
+"that can be written very similarly to the explication above with a bunch of "
+"if conditions. Factorizing code this way often helps making your code more "
+"readable."
msgstr ""
-"Chaque mouvement consiste à prendre le disque supérieur de l'une des tours "
-"et à le déposer sur une autre tour, au sommet des autres disques qui peuvent "
-"déjà être présents sur cette tour."
+"Commencez par écrire des fonctions d'aide, comme <code>estLibre()</code> ou "
+"<code>estPremier()</code>. Cela simplifiera l'écriture de votre algorithme, "
+"qui peut être écrit sous une forme très similaire à l'énoncé si vous faites "
+"les bonnes fonctions d'aide. Factoriser ainsi votre code aide très souvent à "
+"améliorer la lisibilité du code."
-#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:17
-msgid "No disk may be placed on top of a smaller disk."
-msgstr "Aucun disque ne peut être placé au dessus d'un disque plus petit."
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:78
+msgid "My code keeps failing and I don't know how to debug it."
+msgstr "Mon code ne fonctionne pas, et je ne sais pas comment le débugger"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/HanoiBoard.html:22
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:79
msgid ""
-"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
-"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
-"[/!]other[!scala]:Int[/!], [!java]int [/!]height[!scala]:Int[/!])</code>"
+"To debug one world after the other and avoid that the messages of all worlds "
+"get intermixed, you can write your debug function only if the method "
+"<code>isSelected()</code> returns true. It will be so only for the entity "
+"that is currently selected in the graphical interface, that is probably the "
+"world you are currently debugging. This will help breaking the difficulty in "
+"parts by debugging the situation on after the other."
msgstr ""
-"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
-"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
-"[/!]autre[!scala]:Int[/!], [!java]int [/!]hauteur[!scala]:Int[/!])</code>"
+"Pour débugger un monde après l'autre, il est préférable d'éviter que les "
+"affichages de tous les mondes se mélangent. Le plus simple pour cela est "
+"d'utiliser la méthode <code>isSelected()</code> qui ne renvoi vrai que si le "
+"monde courant est celui sélectionné dans l'interface. Cela aidera à réduire "
+"la complexité en résolvant les problèmes les uns après les autres."
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:25
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:85
msgid ""
-"This method will recursively solve the presented problem. The first "
-"parameter named <code>src</code> is the index of the initial tower, the "
-"second parameter <code>dst</code> is the index of the expected final tower, "
-"the third parameter <code>other</code> is the index of the unused peg while "
-"the fourth parameter <code>height</code> is the height of the tower."
+"In particular, it may help to print textually the state of the world each "
+"time you enter the main loop."
msgstr ""
-"Cette méthode résout récursivement le problème. \n"
-"Le premier paramètre (nommé <code>src</code>) est l'index de la pile "
-"initiale.\n"
-"Le second paramètre (nommé <code>dst</code>) est l'index du piquet vers "
-"lequel la pile dont être déplacée.\n"
-"Le troisième paramètre (nommé <code>other</code>) est l'index du piquet "
-"inutilisé, tandis que le quatrième paramètre (nommé <code>hauteur</code>) "
-"est la taille de la pile à déplacer."
+"En particulier, afficher l'état du monde sous forme textuelle à chaque fois "
+"que vous rentrez dans la boucle principale peut aider. "
+
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/Main.html:1
+msgid "The Rainbow Baseball Game"
+msgstr "Le jeu du baseball multicolore"
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:31
+#: src/lessons/sort/baseball/Main.html:3
msgid ""
-"A key to solving this puzzle is to recognize that it can be solved by "
-"breaking the problem down into a collection of smaller problems and further "
-"breaking those problems down into even smaller problems until a solution is "
-"reached."
+"This activity is inspired from the orange game, from the \"Computer Science "
+"Unplugged\" activities repository. It was however heavily since then, first "
+"for the CSIRL (my repository of <i>free</i> unplugged activities to "
+"introduce computer science, available at http://www.loria.fr/~quinson/"
+"Mediation/SMN/) and now for PLM."
msgstr ""
-"La clé pour résoudre de puzzle est de reconnaitre qu'il peut être résolu en "
-"cassant le problème en un ensemble de problèmes de plus petites tailles et "
-"de continuer cette réduction de la taille du problème jusqu'à atteindre une "
-"solution."
-
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:35
-msgid "I don't get it, please give me some extra indications"
-msgstr "Je suis perdu, je voudrais plus d'indications"
-
-#. type: Content of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:36
-msgid "Here is the pseudo-code of the solution:"
-msgstr "Voici le pseudo-code de la solution :"
+"Cette activité est inspirée du jeu de l'orange dans le recueil d'activités "
+"«Computer Science Unplugged». Elle a cependant été profondément réarrangée "
+"depuis, d'abord pour SMN (mon recueil d'activités <i>libres</i> pour "
+"introduire la science informatique, disponible depuis http://www.loria.fr/"
+"~quinson/Mediation/SMN/), et maintenant pour PLM."
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:38
-msgid "label the pegs A, B, C (these labels may move at different steps)"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/Main.html:7
+msgid ""
+"In the literature, the generalized form of this problem is known as the "
+"pebble motion problem (the bases can be connected by any kind of graph, and "
+"the affinity of pebbles with bases may be different). Another variant of "
+"this problem is the well known 15-puzzle, with one player per base, and a "
+"two dimensional square grid. Much more information about these problems can "
+"be found on wikipedia, as usual."
msgstr ""
-"Etiquetons les tours A, B, C ( ces étiquettes peuvent changer à différentes "
-"étapes )"
-
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:39
-msgid "let n be the total number of discs (the height of the initial tower)"
-msgstr "Soit n le nombre total de disques ( la hauteur de la tour initiale )"
+"Dans la littérature scientifique, la forme généralisée de ce problème se "
+"nomme «le problème du déplacement des galets» (Pebble motion problem). Les "
+"bases peuvent être connectées par un graphe quelconque, et les affinités "
+"entre les galets et les bases peuvent être différentes. La plus connue des "
+"variantes de ce problème est le jeu du taquin, avec un seul joueur par base "
+"et une grille carrée à deux dimensions. On trouve énormément d'informations "
+"sur ces problèmes sur les pages wikipédia anglophones, comme d'habitude."
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:40
-msgid "number the discs from 1 (smallest, topmost) to n (largest, bottommost)"
+#. type: Content of: <h3>
+#: src/lessons/sort/baseball/Main.html:12
+msgid ""
+"How do you know that the naive algorithm won't loop on that initial "
+"situation?"
msgstr ""
-"Numérotez les disques de 1 ( le plus petit, le plus en haut ) à n ( le plus "
-"large, le plus en bas )"
-
-#. type: Content of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:43
-msgid "To move n discs from peg A to peg C:"
-msgstr "Pour déplacer n disques du poteau A au poteau C : "
-
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:45
-msgid "move n−1 discs from A to B. This leaves disc number n alone on peg A"
-msgstr ""
-"déplacer n-1 disques de A vers B. Cela laisse le disque numéro n seul sur le "
-"poteau A"
-
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:46
-msgid "move disc number n from A to C"
-msgstr "déplacer le disque numéro n de A vers C"
-
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:47
-msgid "move n−1 discs from B to C so they sit on disc number n"
-msgstr ""
-"deplacer n-1 disques de B vers C afin qu'ils reposent sur le disque numéro n"
-
-#. type: Content of: <h1>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:1
-msgid "HanoiWorld"
-msgstr "Le monde des tours de Hanoï"
+"Comment pouvez vous être sûr que l'algorithme naïf ne boucle pas sur cette "
+"situation initiale? "
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:4
+#: src/lessons/sort/baseball/Main.html:14
msgid ""
-"This world implements the ultra-classical Hanoi problem. You are asked to "
-"move the disk pile from the stick where they are to the target stick (given "
-"as second parameter in the world's name -- number 1 for the default world). "
-"There is some extra constraint: you can only move one disk at a time, and "
-"you cannot move a big disk over a smaller one."
+"Well, we simply tested all possible situations to see when this algorithm "
+"loops and when it finds the correct solution. We found that it works for all "
+"situations where no player is at home (there is 84 such situations for 4 "
+"bases, once you take the symmetries into account). It obviously works for "
+"some situations that do not respect this criteria (such as all situations it "
+"encounters from one of those 84 boards to the final state), but that's "
+"another story. Having such a criteria allows us to generate pseudo-random "
+"initial situations for the first exercise for which the algorithm we propose "
+"is guarenteed to work."
msgstr ""
-"Ce monde implémente le problème ultra classique de Hanoï. Il vous est "
-"demandé de déplacer une pile de disques du piquet où ils se trouvent vers un "
-"piquet cible (passé comme second paramètre dans le nom du monde -- numéro 1 "
-"pour le monde par défaut). Il y a quelques contraintes supplémentaires: il "
-"est interdit de déplacer plus d'un disque à la fois, ainsi que de placer un "
-"disque plus grand sur un disque plus petit."
+"Et bien, nous avons testé toutes les situations initiales possibles pour "
+"étudier les cas où l'algorithme boucle et ceux où l'algorithme termine "
+"correctement. Nous avons trouvé qu'il fonctionne pour toutes les situations "
+"où aucun joueur ne se trouve dans sa base (il y a 84 situations de ce genre "
+"pour 4 bases, si on élimine les symétries). Bien entendu, l'algorithme "
+"fonctionne correctement pour de nombreuses situations ne respectant pas ce "
+"critère (telles que toutes les situations rencontrées quand on commence de "
+"l'une de ces 84 situations), mais c'est une autre histoire. Avoir un tel "
+"critère nous permet de générer des situations initiales pour ce premier "
+"exercice de manière pseudo-aléatoire tout en étant sûrs que l'algorithme "
+"proposé se comportera correctement."
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:11
-msgid "Only 3 functions are provided:"
-msgstr "Seules trois fonctions sont fournies :"
-
-#. type: Content of: <pre>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:13
-#, no-wrap
-msgid "[!java]void [/!]move([!java]int [/!]src, [!java]int [/!]dst)"
-msgstr "[!java]void [/!]deplace([!java]int [/!]src, [!java]int [/!]dst)"
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:15
+#: src/lessons/sort/baseball/Main.html:21
msgid ""
-"Moves one disk from the stick <code>src</code> onto the stick <code>dst</"
-"code>. If you try to do an invalid move (like laying a disk over a smaller "
-"one), an IllegalArgumentException is thrown."
+"We also explored bigger instances of the problem, and unfortunately, we have "
+"no such criteria for them. With 5 bases, the algorithm wrongly loops for 24 "
+"of the 1824 possible boards where no player is home (that's 1.31%). With 6 "
+"bases, it fails on 1251 of the 58860 such boards (2.12%). With 7 bases, it "
+"fails for 84444 out of 2633940 (that's 3.2%). I am still looking for a "
+"criteria ensuring that the algorithm won't loop. If you discover one, please "
+"report it. Ideally, it would be simple to enforce manually so that we can "
+"use it during our unplugged activities."
msgstr ""
-"Elle déplace un disque d'un piquet <code>src</code> vers le piquet "
-"<code>dst</code>. Si vous demandez un déplacement invalide (comme le "
-"placement d'un disque sur un disque plus petit), une exception "
-"IllegalArgumentException est levée."
+"Nous avons également exploré des instances plus grande de ce problème, et "
+"malheureusement, nous ne connaissons pas de critère sûr dans ce cas. Avec 5 "
+"bases, l'algorithme part en boucle infinie pour 24 des 1824 plateaux "
+"possibles où aucun joueur n'est à la maison (cela représente 1,31%). Avec 6 "
+"bases, il boucle pour 1251 des 58860 plateaux respectant ce critère (2,12%). "
+"Avec 7 bases, il boucle dans 84444 cas sur 2633940 (càd 3,2%). Nous "
+"cherchons encore un critère permettant de garantir que l'algorithme ne "
+"bouclera pas. Si vous en découvrez un, merci de nous l'indiquer. Ce serait "
+"encore mieux s'il était possible de vérifier le critère de tête afin que les "
+"animateurs puissent s'en servir pendant les activités débranchées."
-#. type: Content of: <pre>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:19
-#, no-wrap
-msgid "[!java]int [/!]getSlotSize([!java]int [/!]slot)[!scala]:Int[/!]"
-msgstr "[!java]int [/!]getTaillePiquet([!java]int [/!]slot)[!scala]:Int[/!]"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/baseball/Main.html:31
+msgid ""
+"Other graphical representations could be proposed, such as a linear one (for "
+"the existing exercises) or other ones (such as a grid or a tree, if an "
+"exercise on this kind of graph proves interesting)."
+msgstr ""
+"D'autres représentations graphiques pourraient être proposées, comme une "
+"représentation linéaire (pour les exercices proposés) ou d'autres comme une "
+"grille ou un arbre, si un exercice sur ce type de graphe s'avère intéressant."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:20
+#. type: Content of: <ul><li>
+#: src/lessons/sort/baseball/Main.html:33
msgid ""
-"Returns the amount of disks placed on the specified slot. This is mainly "
-"used to initialize the recursion and set the amount of recursive call to "
-"execute."
+"Other exercises on other algorithms on this variant, or on other variants "
+"such as the 15-puzzle."
msgstr ""
-"Retourne le nombre de disques placés sur un piquet donné. Cette fonction est "
-"surtout utile pour initialiser la récursion et déterminer le nombre d'appels "
-"récursifs à réaliser."
+"D'autres exercices à propos d'autres algorithmes pour cette variante du "
+"problème, ou bien d'autres variantes comme le jeu du taquin."
#. type: Content of: <h3>
-#: src/lessons/maze/Main.html:1 src/lessons/maze/short_desc.html:1
-msgid "Labyrinths"
-msgstr "Labyrinthes"
+#: src/lessons/sort/baseball/short_desc.html:1
+msgid "Rainbow baseball"
+msgstr "Baseball multicolore"
#. type: Content of: <p>
-#: src/lessons/maze/Main.html:3 src/lessons/maze/short_desc.html:3
+#: src/lessons/sort/baseball/short_desc.html:3
msgid ""
-"This lesson proposes several exercises about labyrinths in the buggle world."
+"This is another funny variation on the sorting problem, adapting the main "
+"sorting algorithms on an unusual context."
msgstr ""
-"Cette leçon propose divers exercices à propos des labyrinthes dans le monde "
-"des buggles."
+"Il s'agit d'un autre problème amusant autour des algorithmes de tri, "
+"adaptant les principaux algorithmes de tri à un contexte inhabituel."
-#. type: Content of: <h2>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:1
-msgid "The crazy mouse"
-msgstr "La souris folle"
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:1
+msgid "Rainbow Baseball"
+msgstr "Baseball multicolore"
#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:3
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:2
msgid ""
-"The day of your buggle starts badly. Out of luck, it got trapped into a "
-"maze. Help it finding its path out of there."
+"The colors are represented by integers, between <code>0</code> and "
+"<code>amount of bases -1</code>. The hole is represented by the special "
+"value <code>-1</code>. The color of each base is its rank. So base <code>1</"
+"code> is of color <code>1</code>. In the graphical interface, the base "
+"<code>0</code> is the dark blue one while the base <code>1</code> is the "
+"fuscia one."
msgstr ""
-"La journée de votre buggle commence mal. Elle n'a pas eu de chance. Elle est "
-"tombée dans un piège. Aidez-la à sortir de ce labyrinthe."
+"Les couleurs sont représentées comme des entiers, entre <code>0</code> et "
+"<code>nombre de bases - 1</code>. Le trou est représenté par la valeur "
+"spéciale <code>-1</code>. La couleur de chaque base est son rang, ce qui "
+"fait que la base <code>1</code> est de couleur <code>1</code>. Dans "
+"l'interface graphique, la base <code>0</code> est la bleue foncée tandis que "
+"la base <code>1</code> est celle fuscia."
#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:8
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:8
msgid ""
-"The exit is represented by a baggle and you need to pick this baggle in "
-"order to exit the maze."
+"Once every players on the field are in their home base, the hole should be "
+"in the last base, that is of rank <code>getBasesAmount()-1</code>."
msgstr ""
-"La sortie est représentée par un baggle et vous devez le ramasser afin de "
-"vous échapper du labyrinthe."
+"Une fois que tous les joueurs du terrain sont chez eux, le trou se trouve "
+"dans la dernière base, celle de rang <code>getNombreBases()-1</code>."
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:13
-msgid ""
-"Since the maze is so small, we can write the dumbest possible algorithm to "
-"do so. It relies on randomness and proves quite inefficient."
-msgstr ""
-"Nous allons profiter du fait que le labyrinthe ne soit pas trop grand pour "
-"écrire l'algorithme le plus bête possible. Cet algorithme repose sur le "
-"hasard et est très inefficace."
+#. type: Content of: <h2>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:11
+msgid "Functions to retrieve the world's dimensions"
+msgstr "Fonctions pour découvrir les dimensions du monde"
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:18
-msgid ""
-"While the buggle didn't find the path to the escape, it must proceed the "
-"following way: pick a random integer between 0 and 2 by using the provided "
-"<code>random3()</code> method and make one of the following actions: moving "
-"forward if possible, turn left or turn right."
-msgstr ""
-"Tant que notre buggle n'a pas trouvé la sortie, elle doit progresser de la "
-"façon suivante : choisir un entier entre 0 et 2 au hasard à l'aide de "
-"la méthode <code>random3()</code> fournie et prendre l'une des décisions "
-"suivantes selon l'entier choisi : avancer si elle le peut, tourner à "
-"droite ou bien tourner à gauche."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:13
+#, no-wrap
+msgid "[!java]int [/!]getBasesAmount() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getNombreBases() [!scala]:Int[/!]"
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:24
-msgid ""
-"You don't believe that it could work? Well, give it a try, you will see... "
-"Don't forget to pick up the baggle once you've reached it."
-msgstr ""
-"Vous ne croyez pas qu'une méthode aussi stupide puisse fonctionner ? Et "
-"bien, essayez, vous verrez bien.\n"
-"N'oubliez pas de ramasser le biscuit quand vous l'avez trouvé."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:14
+msgid "Returns the amount of bases on this field."
+msgstr "Retourne le nombre de bases dans le terrain."
+
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:16
+#, no-wrap
+msgid "[!java]int [/!]getPositionsAmount() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getNombrePositions() [!scala]:Int[/!]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:17
+msgid "Returns the amount of player's positions per base on this field."
+msgstr "Retourne le nombre de positions disponibles par base."
#. type: Content of: <h2>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:1
-msgid "Following the walls"
-msgstr "Longer les murs"
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:19
+msgid "Functions to retrieve the world's state"
+msgstr "Fonctions pour découvrir l'état du monde"
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:3
-msgid ""
-"This time, the maze is a bit more complicated. Random won't be enough, we "
-"ough to be smart!"
-msgstr ""
-"Cette fois-ci le labyrinthe est beaucoup plus compliqué. Le hasard ne sera "
-"pas suffisant, il va falloir être intelligent !"
-
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:6
-msgid ""
-"The good news is that this maze is simpler that it seems at the first "
-"glance: every wall are connected to each other. To get out of this kind of "
-"maze, the buggle only have to follow a wall (the one on its left or the one "
-"on its right, it doesn't matter). While keeping a paw on the wall, the "
-"buggle must move forward until it finds the maze exit and this biscuit it "
-"loves so much."
-msgstr ""
-"Heureusement, ce labyrinthe est plus simple qu'il n'y paraît: tous les murs "
-"sont connectés les uns aux autres. Pour sortir de ce genre de labyrinthe, il "
-"suffit à votre buggle de longer un mur (celui à sa droite, ou celui à sa "
-"gauche: c'est sans importance). Tout en gardant sa patte posée sur ce mur, "
-"votre buggle doit avancer jusqu'à ce qu'elle trouve la sortie du labyrinthe "
-"et ce biscuit qu'il apprécie tant."
-
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:13
-msgid ""
-"This works here because there is no island of isolated walls, so our buggle "
-"cannot loop around for ever without encountering its baggle."
-msgstr ""
-"Cet algorithme fonctionne ici car il n'y a pas d'île de murs isolés, ce qui "
-"fait que la buggle ne peut pas boucler autour des murs sans rencontrer le "
-"biscuit qu'elle cherche."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:21
+#, no-wrap
+msgid "[!java]int [/!]getHoleBase() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getTrouBase() [!scala]:Int[/!]"
#. type: Content of: outside any tag (error?)
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:17
-msgid ""
-"The goal of this exercise is to write an algorithm allowing the buggle to "
-"get out of this maze."
-msgstr ""
-"<a name=\"Objectifs\"> L'objectif de cet exercice est d'écrire un algorithme "
-"permettant à votre buggle de sortir du labyrinthe."
-
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:20
-msgid ""
-"As said earlier, it does not matter whether you decide to follow the left "
-"wall or the right one. Simply, the demo follows the left one, so you should "
-"do the same in your solution to ease the comparison of your solution and the "
-"demo."
-msgstr ""
-"Comme dit précédement, le mur choisi n'a pas d'importance. Simplement, la "
-"démo suit le mur gauche, et il serait donc avisé d'en faire de même pour "
-"simplifier la comparaison de votre solution et de la démo."
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:22
+msgid "Returns the base in which the hole is located."
+msgstr "Retourne l'index de la base où se trouve le trou."
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:25
-msgid ""
-"Write a method <code>keepHandOnSideWall()</code> which lets the buggle move "
-"one step forward while keeping the paw on the wall of the selected side. You "
-"must ensure that the buggle always keep the paw on the wall, but also that "
-"it won't crash into a wall. You can check the tip for more info on this, but "
-"only do so if you're stuck. Try to do it without the tip first."
-msgstr ""
-"Écrivez une méthode <code>keepHandOnSideWall()</code> qui fait avancer votre "
-"buggle d'une case tout en gardant la patte sur le mur du côté choisi. Vous "
-"devez vous assurer que votre buggle garde toujours la patte sur le mur et "
-"également qu'elle ne risque pas de percuter un mur. Vous pouvez regarder "
-"l'indice (hint) si vous êtes coincé, mais vous devriez d'abord essayer de le "
-"faire par vous-même."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:24
+#, no-wrap
+msgid "[!java]int [/!]getHolePosition() [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getTrouPosition() [!scala]:Int[/!]"
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:32
-msgid ""
-"Then, write the whole algorithm to traverse the maze step by step (using "
-"<code>keepHandOnSideWall()</code>) until it finds the biscuit and the exit. "
-"Don't forget to pick the baggle up once you've found it."
-msgstr ""
-"Enfin, écrivez l'algorithme complet qui parcourt le labyrinthe pas à pas "
-"jusqu'à trouver le biscuit et la sortie. N'oubliez pas de prendre le baggle."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:25
+msgid "Returns the hole position within its base"
+msgstr "Retourne la position du trou dans sa base."
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:37
-msgid "I'm lost, please give me some extra indications"
-msgstr "Je suis perdu, je voudrais plus d'indications"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:27
+#, no-wrap
+msgid "[!java]int [/!]getPlayerColor([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
+msgstr "[!java]int [/!]getCouleurJoueur([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
-#. type: Content of: <div><p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:38
-msgid ""
-"When your buggle has a wall on the left, there is three situations to "
-"consider, depending on the surrounding walls. The following table depicts "
-"each initial situation, and where you should let your buggle end after one "
-"step."
-msgstr ""
-"Quand votre buggle a un mur à sa gauche, il faut considérer trois situations "
-"possibles, qui dépendent des murs alentours. Le tableau suivant représente "
-"graphiquement chaque situation initiale, et où vous devez placer votre "
-"buggle à la fin de l'étape."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:28
+msgid "Returns the color of the player at a given location."
+msgstr "Retourne la couleur d'un joueur donné à partir de sa position."
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:45
-msgid "Case 1"
-msgstr "Cas 1"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:31
+msgid "Returns whether all players of the field are at home."
+msgstr "Retourne si tous les joueurs présents sur le terrain sont chez eux."
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:46
-msgid "Case 2"
-msgstr "Cas 2"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:33
+#, no-wrap
+msgid "[!java]boolean [/!]isBaseSorted([!java]int [/!]base) [!scala]:Boolean[/!]"
+msgstr "[!java]boolean [/!]estBaseTriee([!java]int [/!]base) [!scala]:Boolean[/!]"
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:47
-msgid "Case 3"
-msgstr "Cas 3"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:34
+msgid "Returns whether all players of a given base are at home."
+msgstr "Retourne si tous les joueurs d'une base donnée sont chez eux."
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:49
-msgid "Initial situation"
-msgstr "Situation initiale"
+#. type: Content of: <h2>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:38
+msgid "Functions to change the world"
+msgstr "Fonctions pour changer le monde"
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:54
-msgid "Where is the next step"
-msgstr "Étape suivante"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:40
+#, no-wrap
+msgid "[!java]void [/!]move([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!])"
+msgstr "[!java]void [/!]deplace([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!])"
-#. type: Content of: <div><p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:60
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:41
msgid ""
-"If you do a <code>right()</code> in any case at the end of your function, "
-"it's possible to write it in 3 lines with a <code>while</code> loop."
+"Moves a given player into the hole. This throws an IllegalArgumentException "
+"if the specified player is not near the hole (at most one base away)."
msgstr ""
-"Si vous faites un <code>right()</code> dans tous les cas à la fin de votre "
-"fonction, il est possible de l'écrire en trois lignes avec une boucle "
-"<code>while</code>."
+"Déplace un joueur dans le trou. Une exception IllegalArgumentException est "
+"levée si le joueur indiqué n'est pas suffisamment près du trou. Il peut être "
+"au plus à une base du trou."
-#. type: Content of: <h2>
-#: src/lessons/maze/pledge/PledgeMaze.html:1
-msgid "Pledge algorithm"
-msgstr "Algorithme de Pledge"
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/NaiveBaseball.html:1
+msgid "Naive Rainbow Baseball"
+msgstr "Baseball multicolore naïf"
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:3
+#: src/lessons/sort/baseball/NaiveBaseball.html:3
msgid ""
-"Once again, you thought that your algorithm were good enough to escape the "
-"maze, and once again, you buggle is now in a maze where your previous "
-"algorithm fails. Just give it a try: copy/paste your code and hit the \"Run"
-"\" button and see your creation fail. The trap is shaped like an upper case "
-"\"G\". The buggle enters the trap and follows the inner border. At some "
-"point, it finds the north direction free, run into that direction, and falls "
-"again in the trap."
+"Today, the buggles decided to play a baseball game, but they are rather out "
+"of luck, actually. First, kinda forgot the rules, and ... well ... they "
+"cannot find the ball and bats again. So they decided to \"adapt a bit\" the "
+"rules. As the are no ball, the buggles can only running around the field, "
+"what they do happily: for a while, all attending buggle run at full speed in "
+"all directions around the field."
msgstr ""
-"Une fois de plus, vous pensiez que votre algorithme vous permettait de vous "
-"échapper des labyrinthes, et une fois de plus, votre buggle est prise dans "
-"un labyrinthe mettant votre algorithme en défaut. Essayez de copier votre "
-"code et de l'exécuter pour voir : votre création précédente échoue "
-"lamentablement. Le piège a la forme d'un «G» majuscule : la buggle entre "
-"dans le piège, suit le bord interne. Au bout d'un moment, la direction nord "
-"est libre et votre buggle se met donc à courir dans cette direction. Pour "
-"retomber dans le piège..."
+"Aujourd'hui, les buggles ont décidé de faire une partie de baseball, mais il "
+"faut avouer que ce n'est pas très bien engagé : elles ne se souviennent plus "
+"très bien des règles, et ... euh ... elles ont perdu les battes et les "
+"balles. Elles ont donc décidé «d'adapter un peu» les règles. Comme il n'y a "
+"plus de balle, la seule chose qu'elles peuvent faire est de courir sur le "
+"terrain. C'est d'ailleurs ce qu'elles ont fait pendant un moment : toutes "
+"les buggles présentes se sont mises à courir en tous sens sur le terrain."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:13
+#: src/lessons/sort/baseball/NaiveBaseball.html:9
msgid ""
-"The Pledge's algorithm (named after Jon Pledge of Exeter) can solve this "
-"maze."
+"But after a few collisions, they decide to invent new rules to organize a "
+"bit the game: They make one team per base and two players per team. One of "
+"the teams has only one player so that its base has an empty location. Then, "
+"the players are dispatched randomly around the bases, and the game for them "
+"is to reach their home base. The whole game stops when all players are "
+"home. There is no winning team: either all players win, or they all lose. "
+"Actually, this game is very different from the original baseball. The only "
+"rule that remains is that you can only run around the field, from one base "
+"to the next one, without crossing middle of the field."
msgstr ""
-"L'algorithme de Pledge (nommé d'après Jon Pledge d'Exeter) peut sortir de ce "
-"labyrinthe."
+"Mais après quelques collisions plus ou moins douloureuses, elles décident "
+"d'inventer de nouvelles règles pour organiser la partie. Elles décident de "
+"faire une équipe par base sur le terrain et deux joueurs par équipes. L'une "
+"des équipes n'a qu'un seul joueur pour que l'une des bases ait un "
+"emplacement vide. Ensuite, les joueurs se répartissent aléatoirement sur les "
+"bases, et le jeu est de faire en sorte que chaque joueur retourne sur sa "
+"base. La partie s'arrềte quand tous les joueurs sont chez eux. Il n'y a pas "
+"d'équipe gagnante : soit tous les joueurs remportent la partie, soit ils la "
+"perdent tous. Oui, c'est vrai, ce jeu est très différent du baseball "
+"habituel. La seule règle qui reste est qu'il faut courir autour du terrain, "
+"de base en base, sans jamais passer au centre du terrain."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:16
+#: src/lessons/sort/baseball/NaiveBaseball.html:17
msgid ""
-"This algorithm is a modification of the previous one thought to avoid "
-"obstacles. It randomly picks a heading and let the buggle move in that "
-"direction. When it encounters an obstacle, a paw (for example the left one) "
-"is kept on the wall following the obstacle while counting the turns. When "
-"the buggle is back to its original heading and when the sum of the turns is "
-"0, the buggle leaves the obstacle and continues keeping its original heading."
+"Now, they are asking you to help them deciding who and when should move so "
+"that each player returns to its base. Only one buggle can move at each "
+"round, from its position to the empty spot. The maximal distance that a "
+"buggle can cover in one round is of one base."
msgstr ""
-"Cet algorithme est une version modifiée l'algorithme précédent conçu pour "
-"éviter les obstacles. Il nécessite de choisir de manière arbitraire une "
-"direction vers laquelle la buggle se dirigera. Quand un obstacle est "
-"rencontré, une patte (disons la patte de gauche) est gardée le long des "
-"obstacles tandis que les virages sont comptabilisés. Quand la buggle est "
-"face à nouveau à la direction originale, et que la somme des virages est "
-"égale à 0, la buggle quitte l'obstacle et continue de se déplacer dans sa "
-"direction d'origine."
+"Maintenant, les buggles ont besoin de vous pour décider qui doit bouger à "
+"quel moment de façon à ce que chacune rejoigne sa base. Une seule buggle "
+"peut bouger à chaque tour, de sa position jusqu'à l'emplacement vide. De "
+"plus, la distance maximale qu'une buggle peut parcourir en un tour est de "
+"une seule base."
-# type: Content of: <p><p>
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:24
+#: src/lessons/sort/baseball/NaiveBaseball.html:21
msgid ""
-"Note that the use of \"total turning\" rather than just the \"current "
-"direction\" allows the algorithm to avoid G-shapped traps. If one proceeds "
-"left into the trap, one gets turned around a full 360 degrees by the walls. "
-"As we said before, the naive \"current direction\" algorithm gets into a "
-"limit cycle as it leaves the lower rightmost wall heading left and runs into "
-"the curved section on the left again."
-msgstr ""
-"Notez que l'utilisation de la \"somme des virages\" à la place de la "
-"\"direction courante\" permet à l'algorithme d'éviter les pièges tel que les "
-"formes en \"G\" majuscule. Si l'on rentre par la gauche dans le piège, on "
-"tourne de 360 degrés autour des murs. Un algorithme qui se contenterait "
-"naivement de se retrouver dans la même direction qu'à l'origine rentre dans "
-"un cycle infini puisque qu'il quite le mur le plus à droite en étant dirigé "
-"vers la gauche, et entre à nouveau dans la section incurvée."
+"So, at each round, the empty spot is on one base (say <code>B</code>), and "
+"you should decide which buggle enters that empty spot. There is four "
+"candidates (two from base <code>B-1</code> and two from base <code>B+1</"
+"code>). Actually, there is a fifth candidate since the buggle that is on the "
+"same base than the empty spot can change its position, but that's not really "
+"helping."
+msgstr ""
+"Ainsi, à chaque tour, l'emplacement vide se trouve sur une base (disons "
+"<code>B</code>), et vous devez décider quelle buggle occupera cette place. "
+"Il y a quatre candidates : deux de la base <code>B-1<code>, et deux de la "
+"base <code>B+1</code>. En fait, il y a une cinquième candidate puisque la "
+"buggle qui se trouve sur la même base que le trou peut aller l'occuper, mais "
+"ça ne fait pas vraiment avancer le problème."
+
+#. type: Content of: <h3>
+#: src/lessons/sort/baseball/NaiveBaseball.html:26
+msgid "The Naïve algorithm"
+msgstr "Algorithme naïf"
-# type: Content of: <p><p>
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:31
+#: src/lessons/sort/baseball/NaiveBaseball.html:28
msgid ""
-"The Pledge's algorithm does not leave the rightmost wall due to the total "
-"turning not being zero at that point. It follows the wall all the way "
-"around, finally leaving it heading left on the bottom outside"
+"In this exercise, we will first explore a very simple algorithm. To decide "
+"which of the four candidate buggles should enter the empty spot, we first "
+"restrict ourselves and decide that buggles can only turn clockwise. Then, "
+"from the two remaining candidates, we pick the one that has the largest "
+"distance to cover to reach its base (turning clockwise). Click on the demo "
+"button: this works rather well in practice."
msgstr ""
-"L'algorithme de Pledge ne quitte pas le mur en bas à droite puisque la somme "
-"des virages ne vaut pas zéro à ce moment. Il continue de suivre le mur "
-"jusqu'à avoir complétement fait le tour, et le quitte en regardant à gauche "
-"une fois parvenu sous l'obstacle."
+"Dans cet exercice, nous allons explorer un premier algorithme très simple. "
+"Pour décider laquelle des quatre candidates doit aller occuper l'emplacement "
+"vide, nous commençons par nous restreindre à tourner dans le sens des "
+"aiguilles d'une montre. Ensuite, parmi les deux candidates restantes, nous "
+"prenons celle qui a encore le plus de chemin à parcourir jusqu'à sa base "
+"(dans le sens des aiguilles d'une montre). Essayez la démonstration : cela "
+"marche plutôt bien en pratique."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:38
+#: src/lessons/sort/baseball/NaiveBaseball.html:34
msgid ""
-"<a name=\"Objective\"/>You now have to modify your solution to implement the "
-"Pledge algorithm to escape this maze."
+"It's hard to find a simpler algorithm for this problem: While it's not "
+"sorted, search for the base containing the candidate buggles: if the hole is "
+"in base <code>B</code>, it's the base <code>B+1</code>, modulo the amount of "
+"bases. Then, compute the distance that each buggle of that base still has to "
+"run to reach its base (0 if it's already home). Once you found the buggle "
+"that should enter the empty spot, just use the <code>move</code> method on "
+"it, and iterate."
msgstr ""
-"<a name=\"Objectifs\"> L'objectif de cet exercice est d'écrire une "
-"implémentation de l'algorithme de Pledge qui permettra à votre buggle de "
-"sortir du labyrinthe."
+"Il est difficile d'imaginer un algorithme plus simple pour ce problème : "
+"tant que ce n'est pas trié, chercher la base contenant les candidates. Si le "
+"trou est sur la base <code>B</code>, il s'agit de la base <code>B+1</code> "
+"(modulo le nombre de bases). Ensuite, il faut calculer la distance que "
+"chacune des buggles de cette base doit encore parcourir (0 si elle est déjà "
+"chez elle). Une fois que vous avez sélectionné l'heureuse élue, utilisez la "
+"méthode <code>deplace</code> pour la faire bouger, avant de passer à "
+"l'itération suivante."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:41
+#: src/lessons/sort/baseball/NaiveBaseball.html:40
msgid ""
-"Change your <code>keepHandOnSideWall()</code> method to count the amount of "
-"turns done by the buggle (+1 when it turns left, and -1 when it turns "
-"right). This counting may require the addition of an <code>angleSum</code> "
-"integer value in your program."
+"The main difficulty should be to get the few equations right: determining "
+"the base next to the hole should be easy, but determining the distance that "
+"a player has to cover may reveal a bit more challenging. Don't hesitate to "
+"draw pictures on a paper to cover all possible cases. It should not be that "
+"difficult either: there is not that many cases after all."
msgstr ""
-"Reprenez la méthode <code>keepHandOnSideWall()</code> de l'exercice "
-"précédent. Modifiez cette méthode pour compter les virages pris par votre "
-"buggle (+1 lorsqu'il a tourné à gauche par rapport à son origine, -1 "
-"lorsqu'il a tourné à droite). Pour comptabiliser vous aurez besoin d'ajouter "
-"une variable <code>sommeAngle</code> de type entière à votre programme."
+"La principale difficulté est peut-être d'écrire les quelques équations "
+"nécessaires sans se tromper. Trouver quelle est la base après le trou "
+"devrait être assez facile, mais calculer la distance que chaque joueur doit "
+"encore parcourir peut s'avérer plus problématique. N'hésitez pas à faire des "
+"dessins pour vérifier que votre équation marche dans tous les cas, il n'y a "
+"pas tant de cas possibles que cela après tout."
+
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/SelectBaseball.html:1
+msgid "Selection Baseball"
+msgstr "Baseball par selection"
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:46
+#: src/lessons/sort/baseball/SelectBaseball.html:3
msgid ""
-"Write a boolean method <code>isDirectionFree(dir)</code> indicating if the "
-"provided direction is free, ie, if you can move in that direction (Note that "
-"the demo uses the NORTH direction for that). You can retrieve the current "
-"direction of the buggle using the method <code>getDirection()</code>. You "
-"can change your direction (without moving) using <code>setDirection(dir)</"
-"code>. Don't forget to store the previous direction of your buggle (in a "
-"dedicated variable) before checking if your favorite direction is free in "
-"order to restore your state afterward."
+"The previous algorithm is very pleasant: it's rather simple and rather fast "
+"to implement, but unfortunately, it is also rather wrong! In some cases, it "
+"never stops, which is obviously bad. If you don't believe it, just copy "
+"paste your previous code, and hit the run button. The first world of this "
+"exercise is one of these unfortunate situations that drives our previous "
+"algorithm crazy."
msgstr ""
-"Écrivez une méthode booléenne <code>isDirectionFree(dir)</code> indiquant si "
-"la direction fournie en paramètre est libre, c'est-à-dire si vous pouvez "
-"vous déplacer dans cette direction. Notez que la démo utilise la direction "
-"NORD pour cela. Vous pouvez retrouver la direction courante de la buggle en "
-"utilisant la méthode <code>Direction getDirection()</code>. Vous pouvez "
-"diriger (sans se déplacer) votre buggle dans une direction en utilisant la "
-"méthode <code>setDirection(dir)</code>. Pensez à mémoriser (dans une "
-"variable dédiée) la direction courante de votre buggle avant de vérifier si "
-"votre buggle peut se diriger vers sa direction de prédilection pour pouvoir "
-"restaurer l'état après coup."
+"L'algorithme précédent est très plaisant : il est plutôt simple, assez "
+"rapide à implémenter, mais malheureusement, il est également carrément faux. "
+"Dans certains cas, il ne s'arrête jamais, ce qui n'est pas très bon. Si vous "
+"ne le croyez pas, copie/collez votre code et appuyez sur le bouton "
+"«Exécuter». Le premier monde de cet exercice est l'un de ces cas malheureux "
+"où notre algorithme devient fou."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:55
+#: src/lessons/sort/baseball/SelectBaseball.html:9
msgid ""
-"You may have to change the rest of your code also, but these changes should "
-"remain limited."
+"So we have to find another algorithm, preferably one that works in all cases."
msgstr ""
-"Vous pouvez être amenés à modifier également le reste de votre code, mais "
-"ces changements devraient rester limités."
+"Il nous faut donc trouver un autre algorithme. De préférence un qui marche "
+"dans tous les cas."
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:58
+#: src/lessons/sort/baseball/SelectBaseball.html:11
msgid ""
-"Don't forget that if you have a method modifying a global variable (such as "
-"angleSum), you should ensure that it declares this variable as global. "
-"Without it, the method creates a new variable of the same name, and the "
-"global never gets modified."
+"For that, the best solution is to start from a well known algorithm instead "
+"of trying to invent a new one from scratch as we just did. When you think a "
+"bit about this problem, this can is very similar to a sorting problem: Just "
+"make sure that the players are sorted by their colors and you're set. And "
+"while we are at it, let's generalize the game to allow more that 4 bases."
msgstr ""
-"N'oubliez pas que si l'une de vos méthodes modifie une variable globale "
-"(telle que sommeAngles), vous devez vous assurer qu'elle définie cette "
-"globale correctement. Sinon, la méthode crée une nouvelle variable locale de "
-"même nom, et la globale n'est jamais modifiée."
+"Pour cela, la meilleure solution est d'adapter un algorithme connu au lieu "
+"de tenter de partir de zéro comme nous venons de faire. Quand on réfléchi un "
+"peu à ce problème, on reconnaît un certain air de famille avec le problème "
+"du tri : il suffit de <b>trier</b> les joueurs en fonction de leur couleur "
+"pour le résoudre. Et tant que nous y sommes, nous pouvons généraliser un peu "
+"le problème en utilisant plus de quatre bases."
-#. type: Content of: <div><pre>
-#: src/lessons/maze/pledge/PledgeMaze.html:62
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/SelectBaseball.html:17
msgid ""
-"def myMethod():\n"
-" global angleSum\n"
-" ...\n"
-" angleSum = angleSum + 1\n"
+"Let's adapt the selection sort to our situation. The big lines of the "
+"algorithm is then \"for each base, select the players that should occupy "
+"this base and make sure that they come to their position\". This way, we "
+"will grow an sorted area where all players are already sorted (and never "
+"changed) while the unsorted area shrinks."
msgstr ""
-"def myMethod():\n"
-" global sommeAngle\n"
-" ...\n"
-" sommeAngle = sommeAngle + 1\n"
-
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/pledge/PledgeMaze.html:68
-msgid "Show an additional tip"
-msgstr "Montrer un indice supplémentaire"
+"Adaptons le tri par sélection à notre situation. Les grandes lignes de cet "
+"algorithme sont les suivantes : «pour chaque base, trouver dans la zone pas "
+"encore triée les joueurs qui doivent occuper cette base, puis les y placer». "
+"De la sorte, on va faire grandir une zone triée qu'on ne modifie plus "
+"jamais, tout en faisant réduire la taille de la zone pas encore triée."
-#. type: Content of: <div>
-#: src/lessons/maze/pledge/PledgeMaze.html:69
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/SelectBaseball.html:23
msgid ""
-"You should set your direction to your favorite one (NORTH is advised). Then, "
-"you should write the algorithm main loop. In other words, while your buggle "
-"did not find its biscuit, you have to move forward until next obstacle in "
-"the favorite direction. Then, put a paw on a wall (using "
-"(<code>keepHandOnSideWall()</code>) while the sum of turns is not null and "
-"the favorite direction is not free. Do that until you find your baggle."
+"Selecting the player should be no problem; Do not hesitate to define some "
+"methods such as <code>findPlayer()</code> or <code>findPlayerBase()</code>. "
+"This will ensure that your code remains understandable."
msgstr ""
-"Vous devez changer votre cap vers votre direction favorite (probablement le "
-"nord -- Direction.NORD). Il vous faut ensuite écrire la boucle principale de "
-"votre algorithme. Tant que votre buggle n'a pas trouvé son biscuit, il faut "
-"avancer jusqu'à un obstacle dans la direction de prédilection. Quand un "
-"obstacle est rencontré, il faut garder la patte sur un mur (en utilisant "
-"<code>keepHandOnSideWall()</code>) tant que la somme des virages n'est pas "
-"nulle et que la direction de prédilection n'est pas libre. Faites cela "
-"jusqu'à trouver votre biscuit."
-
-#. type: Content of: <h2>
-#: src/lessons/maze/island/IslandMaze.html:1
-msgid "Lost between islands"
-msgstr "Perdu dans les îles"
+"Choisir les joueurs à déplacer ne devrait pas poser de problème. N'hésitez "
+"pas à définir quelques fonctions comme <code>trouveJoueur</code> ou "
+"<code>trouveBaseJoueur()</code>. Cela améliorera la lisibilité de votre "
+"code, ce qui est toujours une bonne chose."
#. type: Content of: <p>
-#: src/lessons/maze/island/IslandMaze.html:3
+#: src/lessons/sort/baseball/SelectBaseball.html:27
msgid ""
-"You thought that your algorithm was enough to escape mazes? Well, not every "
-"mazes..."
+"The most problematic aspect is to move the selected players into position. "
+"For that, you have to move the hole to the position where the player is, and "
+"then move both the player and the hole to the base that is next to the "
+"player's goal (probably in a loop), and finally put the player in the right "
+"position of its target base."
msgstr ""
-"Vous pensiez que votre algorithme était suffisant pour échapper de tous les "
-"labyrinthes ? Et bien, pas tous les labyrinthes..."
+"L'aspect le plus problématique est de déplacer les joueurs sélectionnés "
+"jusqu'à leur position. Pour cela, il vous faut déplacer le trou jusqu'à la "
+"base où se trouve le joueur, puis bouger ensuite le trou et le joueur de "
+"base en base jusqu'à celle avant la cible (au moyen d'une boucle). Enfin, on "
+"peut mettre le joueur dans la bonne case de sa base de prédilection."
#. type: Content of: <p>
-#: src/lessons/maze/island/IslandMaze.html:7
+#: src/lessons/sort/baseball/SelectBaseball.html:32
msgid ""
-"The <i>wall follower algorithm</i> we used so far only works if the entry "
-"and the exit are placed near to walls connected to the external wall. But if "
-"the buggle begins in the middle of the maze, it may exist wall sections "
-"disconnected from the external wall."
+"As often in programming, the devil is in the details: there is a bunch of "
+"corner cases that you should detect and deal with correctly, such as the "
+"cases where the player is already in the base (but not in the position that "
+"you would like), or when the hole is on the right of the player (probably "
+"when you sort the first base). But you will find and hunt these while "
+"debugging your code."
msgstr ""
-"L'algorithme de suivi de mur que nous avons utilisé jusqu'à présent "
-"fonctionne seulement si l'entrée et la sortie sont placées à côté de murs "
-"connectés à un mur externe. Mais si la buggle commence au milieu du "
-"labyrinthe, il peut exister des pans de mur déconnectés du mur externe."
+"Comme souvent en programmation, le diable est dans les détails, et il y a un "
+"certain nombre de cas particuliers à détecter et à gérer correctement, comme "
+"quand le joueur est déjà dans sa base de prédilection (mais pas dans la "
+"bonne position), ou quand le trou se trouve en fait à droite du joueur "
+"(probablement quand vous triez la première base). Mais vous allez trouver et "
+"résoudre ces problèmes quand vous débugguerez votre code."
-#. type: Content of: <p><p>
-#: src/lessons/maze/island/IslandMaze.html:12
-msgid ""
-"That is why the previous strategy would let the buggle round around for "
-"ever. Indeed, the maze you should now escape from contains islands, and the "
-"buggle does not start along one of the external walls. Just give it a try if "
-"you want: copy your code over, push the run button and see your previous "
-"solution failing miserabily."
-msgstr ""
-"Dans cette situation, notre précédente stratégie ferait notre buggle tourner "
-"en rond pour toujours sur l'un de ces îlots. En effet, le labyrinthe dont "
-"vous devez vous échapper maintenant contient des îles, et la buggle ne "
-"commence pas sur un des murs externes. Vous pouvez essayer si vous voulez : "
-"Copie/collez votre code et appuyez sur le bouton 'Exécuter' pour admirez "
-"votre solution précédente échouer lamentablement."
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/InsertBaseball.html:1
+msgid "Insertion Baseball"
+msgstr "Baseball par insertion"
-#. type: Content of: <p><p>
-#: src/lessons/maze/island/IslandMaze.html:18
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:3
msgid ""
-"The method of following a wall is still good and allow to escape very "
-"efficiently some sections of the maze, so we do not want to remove it "
-"entierely. Instead, we want to stop following the wall under some "
-"conditions. Notice that the baggle lays near to the external border of the "
-"maze. So, we want to reach the border and then follow that wall. We need for "
-"example to search for the north wall before following it to the baggle."
+"The good point of adapting the selection sort to the baseball problem is "
+"that we know that it works (provided that our adaptation is correct). That's "
+"much better than the first naive algorithm, that was unable to converge to "
+"the solution in some situations. But actually, the selection sort is not "
+"perfect either as it requires a lot of swaps: we have to bring the hole to "
+"the selected player and then both the player and hole in position, and more. "
+"We can do better."
msgstr ""
-"Cette méthode de suivre un mur est toujours efficace est permet d'échapper "
-"de manière assez efficace à certaines parties du labyrinthe, on ne va donc "
-"pas la supprimer entièrement. À la place, nous allons cesser de suivre le "
-"mur sous certaines conditions. Notez que le baggle repose près d'un mur "
-"externe du labyrinthe. Donc nous voulons atteindre un mur externe et ensuite "
-"le suivre. Nous avons par exemple de rechercher le mur nord avant de le "
-"suivre jusqu'au baggle."
+"Le coté positif d'adapter le tri par sélection à notre problème est que nous "
+"savons que cela fonctionne (à condition que notre adaptation soit correcte). "
+"C'est bien mieux que notre premier algorithme naïf, qui était incapable de "
+"converger vers la solution dans certains cas. Cependant, le tri par "
+"sélection n'est pas parfait non plus, puisqu'il requiert beaucoup "
+"d'échanges : il faut amener le trou jusqu'au joueur sélectionné puis amener "
+"le joueur ET le trou vers la bonne base. On doit pouvoir faire mieux."
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:26
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:9
msgid ""
-"To find the north wall, you simply run to the north as long as it's "
-"possible, and when facing an obstacle, you avoid it (using previous method)."
+"For example, each player can run quite a long way from its initial position "
+"to its target solution. Instead, it may be more interesting to split the "
+"field in two parts: one on the left where all players are sorted relatively "
+"to each others, and one on the right where the players are still at their "
+"initial positions. Then, at each iteration, we take the player at the border "
+"between the sorted and unsorted areas (that is, the left-most player of the "
+"unsorted area) and move it to the left (within the sorted area) until it "
+"reaches its position (that is, until the position where it's bigger that its "
+"left neighbor). This would at least reduce the travel of players to the "
+"sorted area as we use the first one on the border."
msgstr ""
-"Pour trouver le mur nord, vous avez tout simplement à foncez vers le nord "
-"tant que c'est possible, et quand vous faites face à un obstacle, vous "
-"l'évitez (en utilisant la méthode précédente)."
-
-#. type: Attribute 'alt' of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:30
-msgid "I'm lost now, please give me some extra indications"
-msgstr "Je suis perdu, je voudrais plus d'indications"
+"Par exemple, chaque joueur peut avoir à parcourir un chemin relativement "
+"long pour arriver à sa position finale. Au lieu de cela, il serait peut-être "
+"intéressant de couper le terrain en deux parties : l'une à gauche où tous "
+"les joueurs sont triés relativement les uns aux autres, et une autre à "
+"droite où les joueurs n'ont pas encore bougé de leur position de départ. "
+"Ensuite, à chaque itération, on prend le joueur à la frontière entre les "
+"deux zones (c'est à dire, le joueur le plus à gauche de la zone non triée) "
+"et on le déplace vers la gauche jusqu'à sa position dans la zone triée "
+"(c'est à dire, jusqu'à ce qu'il soit plus grand que son voisin de gauche). "
+"Cela réduirait au moins la distance que les joueurs doivent parcourir pour "
+"rentrer dans la zone triée, puisqu'on prend systématiquement le joueur à la "
+"frontière."
-#. type: Content of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:31
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:18
msgid ""
-"Our new run() method will consist in two modes: our buggle will alternate "
-"between the \"north runner mode\" and the \"left follower mode\". You begin "
-"in \"north runner mode\", and switch to \"left follower\" when you have a "
-"wall at the north (do not forget to make sure you have a wall at your left "
-"before switching to \"left follower\" mode). You switch to \"north runner\" "
-"as soon as your buggle is facing north and is not in front of a wall during "
-"its trip around its left wall. The easiest way to write such a state machine "
-"is something like"
+"Actually, that's exactly what an insertion sort would do: maintain a sorted "
+"area on the left, and put iteratively the player on the border to its "
+"position within the sorted area. This is good, as we know that our algorithm "
+"is not inherently flawed since we adapt a well known one."
msgstr ""
-"Notre nouvelle méthode run() va consister en deux états: notre buggle va "
-"alterner entre le mode «coureur au nord» et le mode «suiveur à gauche». Vous "
-"commencerz dans le mode «coureur au nord», et vous passerez au mode «suiveur "
-"à gauche» quand il y aura un mur au nord (n'oubliez pas de vous assurez "
-"d'avoir un mur à votre gauche avant de changer de passer au mode «suiveur à "
-"gauche»). Vous repasserez au mode «coureur au nord» dès que votre buggle "
-"fera face au nord et qu'elle n'est pas face à un mur. La manière la plus "
-"simple d'écrire une telle machine à état est quelque chose de ce type:"
+"En fait, c'est exactement ce qu'un tri par insertion ferait: maintenir une "
+"zone triée à gauche, et y insérer à chaque itération l'élément qui se trouve "
+"à la frontière en le décalant vers la gauche jusqu'à sa position dans la "
+"zone triée. C'est une bonne chose, car cela veut dire que notre algorithme "
+"n'est pas fondamentalement faux, puisqu'il s'agit d'une adaptation d'un "
+"algorithme connu. "
-#. type: Content of: <p><p><div><pre>
-#: src/lessons/maze/island/IslandMaze.html:39
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:22
msgid ""
-"[!scala]var state=0;\n"
-"state match {\n"
-" case 0 => // North runner\n"
-" ...\n"
-" state = 1;\n"
-" case 1 => // Left follower\n"
-" ...\n"
-" state = 0;\n"
-" case _ => println(\"This case should not happen. Please fix me\")\n"
-"}[/!][!java]int state=0;\n"
-"switch (state) {\n"
-" case 0: // North runner\n"
-" ...\n"
-" state = 1;\n"
-" break;\n"
-" case 1: // Left follower\n"
-" ...\n"
-" state = 0;\n"
-" break;\n"
-"}[/!][!python]northRunner = True\n"
-"if northRunner:\n"
-" ...\n"
-" northRunner = False\n"
-"else: # left follower\n"
-" ...\n"
-" northRunner = True[/!]"
+"The easiest to adapt the insertion sort to the baseball problem is to "
+"consider all positions as adjacent and forget about bases. For that, we "
+"define the methods <code>getColor(pos)</code>, <code>move(pos)</code> and "
+"<code>getHole()</code> that all use a unique integer to designate a given "
+"position. These functions simply convert between the way to specify a "
+"position and then call the usual functions to interact with the world. If "
+"you have an <code>index</code> and want to convert it into a <code>base,pos</"
+"code>, then <code>base=index/2</code> and <code>pos=index%2</code>. To "
+"compute the reverse, <code>index=base*2+pos</code> (this works because "
+"<code>getPositionsAmount()</code> always returns 2)."
msgstr ""
-"[!scala]var etat=0;\n"
-"etat match {\n"
-" case 0 => // courir au nord\n"
-" ...\n"
-" etat = 1;\n"
-" case 1 => // suivre à gauche\n"
-" ...\n"
-" etat = 0;\n"
-" case _ => println(\"Ce cas ne devrait pas arriver. Corrigez ce problème svp.\")\n"
-"}[/!][!java]int etat=0;\n"
-"switch (etat) {\n"
-" case 0: // courir au nord\n"
-" ...\n"
-" etat = 1;\n"
-" break;\n"
-" case 1: // suivre à gauche\n"
-" ...\n"
-" etat = 0;\n"
-" break;\n"
-"}[/!][!python]coureurNord = True\n"
-"if coureurNord:\n"
-" ...\n"
-" coureurNord = False\n"
-"else: # suiveur à gauche\n"
-" ...\n"
-" coureurNord = True[/!]"
+"Le plus simple pour adapter le tri par insertion au problème du baseball est "
+"de considérer toutes les positions comme adjacentes sans tenir compte des "
+"différentes bases. Pour cela, il faut définir les méthodes "
+"<code>couleurJoueur(pos)</code>, <code>deplace(pos)</code> et "
+"<code>trouveTrou()</code> qui utilisent un seul entier pour désigner une "
+"position donnée et appellent les fonctions de base de cet univers pour faire "
+"leur travail. Pour convertir une position encodée sur un seul entier "
+"<code>index</code> en une position encodée sur deux entiers <code>base,pos</"
+"code>, il faut appliquer les formules suivantes: <code>base=index/2</code> "
+"et <code>pos=index%2</code>. Pour faire le calcul inverse, il faut utiliser "
+"<code>index=base*2+pos</code> (qui fonctionne car il y a deux positions par "
+"base)."
-#. type: Content of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:66
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:31
msgid ""
-"Don't forget the default case (matching _), or scala will issue an error "
-"since your matching would be incomplete.[/!]"
-msgstr ""
-"N'oubliez pas le cas par défaut (qui accepte _), ou scala vous donnera un "
-"message d'erreur en échange de votre filtrage incomplet."
-
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:69
-msgid "Don't forget to let the buggle pick the baggle at the end of your code."
+"For the algorithm itself, you should first move the hole to the position 1. "
+"The position 0 is considered to be the sorted area (of size 1 for now) while "
+"the area above 2 is the unsorted area. Then comes an iteration to sort each "
+"element of the unsorted area. Since this iteration is a bit complex, you "
+"should think of its loop invariant, that is, the condition that is true "
+"before and after the loop and which explains that the loop fulfills its "
+"goal. Here, the loop invariant is twofold: First, the hole is between the "
+"sorted area and the unsorted area, and then, the every elements of the "
+"sorted area are ... well sorted relatively to their neighbors."
msgstr ""
-"N'oubliez pas de faire ramasser le baggle par votre buggle à la fin de votre "
-"code."
+"Pour l'algorithme lui-même, vous devriez tout d'abord bouger le trou en "
+"position 1. On considère alors que la zone triée se limite pour l'instant à "
+"la position 0 (elle est alors de taille 1) tandis que la zone non triée "
+"commence à partir de la position 2. Ensuite, on fait une itération par "
+"élément à trier. Comme le corps de cet itération est un peu plus compliqué "
+"que ce que nous avons écrit jusque là, vous devriez réfléchir à l'invariant "
+"de cette boucle, c'est à dire à la condition qui est vraie avant et après un "
+"passage dans la boucle, et qui fait que la boucle fait son travail. Ici, "
+"l'invariant a deux parties : tout d'abord, l'emplacement vide se trouve "
+"entre les parties triées et non triées, et ensuite, la zone triée est ... "
+"triée, c'est à dire que tous les éléments de cette zone sont bien triés par "
+"rapport à leurs voisins."
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:72
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:39
msgid ""
-"You're up. That should be enough for you to figure out how to escape this "
-"maze, but if not, you can always request for the tip. But you do not need "
-"any more help, do you?"
+"Then, the loop body to sort an element should first descend the hole and the "
+"elements within the sorted area until the element is larger than the element "
+"before in the sorted area (2 moves per position to travel), and then move "
+"the hole back to its position between the sorted and unsorted areas (1 move "
+"per position)."
msgstr ""
-"Vous êtes prêts. Tout ceci devrait suffire pour vous permettre de trouver "
-"comment sortir de ce labyrinthe, mais si ce n'est pas le cas, vous pouvez "
-"toujours demander l'astuce. Mais vous n'avez plus besoin d'aide, n'est-ce "
-"pas ?"
-
-#. type: Content of: <h2>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:1
-msgid "Basic Shortest Path algorithm"
-msgstr "Algorithme basique de recherche du plus court chemin"
+"Ensuite, le corps de la boucle devrait trier un élément en descendant cet "
+"élément et le trou dans la zone triée jusqu'au point où l'élément est à sa "
+"place dans la zone triée (cela demande deux déplacements par case à "
+"parcourir), avant de remonter le trou à sa place à la frontière (un "
+"déplacement par case à parcourir)."
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:3
+#: src/lessons/sort/baseball/InsertBaseball.html:43
msgid ""
-"To conclude with this introductory lesson to maze solving algorithms, we "
-"will investigate another way to find the exit. The buggle in this lesson is "
-"a special buggle: he is a jedi. He can feel the Force. This means he is able "
-"to feel his environment."
+"Once you insert the last element within the sorted area, your whole set is "
+"sorted and you're done. I preserve the surprise of the border cases that "
+"will require some little adjustments to your algorithm to make it work "
+"properly :)"
msgstr ""
-"Pour conclure avec cette leçon d'introduction aux algorithmes de sortie de "
-"labyrinthe, nous allons étudier un autre moyen de trouver la sortie. La "
-"buggle de cette leçon est spécial : c'est un jedi. Il peut ressentir la "
-"Force. Cela signifie qu'elle peut ressentir son environnement."
+"Une fois que vous avez inséré le dernier élément dans la zone triée, tout "
+"votre ensemble est trié et vous avez fini. Je vous laisse la surprise des "
+"cas limites nécessitant de petits ajustements à votre algorithme pour lui "
+"permettre de fonctionner dans tous les cas :)"
+
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/BubbleBaseball.html:1
+msgid "Bubble Baseball"
+msgstr "Baseball à bulle"
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:7
+#: src/lessons/sort/baseball/BubbleBaseball.html:3
msgid ""
-"Without even leaving his position, he can retrieve information about the "
-"world he is leaving in, with the following functions:"
+"Crap, we adapted the insertion sort because our selection sort required too "
+"much moves to get the selected players to their position, but the insertion "
+"sort requires an inordinate amount of changes to get the border elements to "
+"their position within the sorted area without mixing the already sorted "
+"elements. At the end of the day, our selection variant was more efficient "
+"with at most <code>3*amountOfBase</code> moves to sort one element (1 to get "
+"the hole alongside with the player, and 2 to get the hole+player in "
+"position) while our insertion variant requires at most "
+"<code>3*amountOfPlayers</code> to sort one element (2 to descend the hole "
+"and player in position, 1 to get the hole back to its position). That's "
+"twice as bad as there is two players per base. It may be possible to improve "
+"the insertion sort by moving by more than one element when descending, but "
+"it seems uneasy (at least, while not mixing the already sorted elements) and "
+"it would probably only ensure that our insertion variant becomes as "
+"efficient as our selection variant, not dramatically better."
msgstr ""
-"Sans même changer de place, elle peut retrouver des informations sur le "
-"monde qui l'entoure, avec les instructions suivantes :"
+"Zut, nous avions adapté le tri par insertion parce que notre tri par "
+"sélection nécessitait trop de déplacements pour mener les joueurs "
+"sélectionnés à leur position, mais le tri par insertion impose une quantité "
+"déraisonnable de déplacements pour déplacer les joueurs de la frontière "
+"jusqu'à leur place dans la section triée. Au final, notre variante par "
+"sélection était plus efficace, avec au pire <code>3*nombre de bases</code> "
+"déplacement par élément à trier (1 pour apporter le trou jusqu'au joueur à "
+"bouger, et 2 pour amener le joueur et le trou jusqu'à leur position "
+"finale). De son coté, notre variante par insertion nécessite au pire "
+"<code>3*nombre de joueurs</code> déplacements pour trier un élément (2 pour "
+"descendre le joueur et le trou à leur place, et 1 pour remonter le trou). "
+"C'est deux fois pire puisqu'il y a deux joueurs par base. Il serait "
+"probablement possible d'améliorer un peu notre variante par insertion en "
+"descendant plus vite le trou et le joueur, mais cela semble assez difficile "
+"(il ne faut pas mélanger les éléments déjà triés pendant la descente), et "
+"cela ne permettrait que de rendre cette variante aussi efficace que celle "
+"par sélection, pas de faire vraiment mieux. "
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:9
-msgid "<code>getWorldWidth()</code> gives the width of its world."
-msgstr "<code>getMondeLargeur()</code> pour connaitre la largeur du monde"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:15
+msgid ""
+"If we cannot make the sort faster, we can make it easier. If you think about "
+"it, it seems rather natural to adapt the bubble sort to this problem: the "
+"hole becomes the bubble that moves up and down, sorting a bit the array "
+"during each traversal. The big lines are simply: \"while it's not sorted, "
+"move the hole down to base 0 (moving the biggest player of each base at each "
+"step) and then back to the maximal base (moving the smallest player of each "
+"base)\". After a while, <code>isSorted()</code> will return true and your "
+"algorithm will stop."
+msgstr ""
+"Si nous ne pouvons pas rendre ce tri plus rapide, au moins nous pouvons le "
+"faire plus simplement. Quand on y pense, il semble assez naturel d'adapter "
+"le tri à bulle à ce problème : le trou devient la bulle qui monte et qui "
+"descend, en sortant peu à peu le tableau. Les grandes lignes de l'algorithme "
+"sont très simples : «tant que ce n'est pas trier, déplacer le trou vers le "
+"bas puis vers le haut. À chaque pas, c'est le plus petit des deux joueurs de "
+"la base qui descend, et le plus grand des deux qui monte (en fonction du "
+"sens de déplacement).». Après un moment, <code>estTrie()</code> devient "
+"vrai, et votre algorithme s'arrête."
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:10
-msgid "<code>getWorldHeight()</code> gives the height of its world."
-msgstr "<code>getMondeHauteur()</code> pour connaitre la hauteur du monde."
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:21
+msgid ""
+"This is so easy that we introduce another variant of the problem, with more "
+"than two players per base. But actually, that shouldn't block you very "
+"long, should it?"
+msgstr ""
+"C'est tellement simple que nous pouvons nous payer le luxe d'une autre "
+"variante du problème, avec plus de deux joueurs par base. Mais cela ne va "
+"pas vous ralentir longtemps, n'est ce pas?"
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:11
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:24
msgid ""
-"<code>hasTopWall(x,y)</code> tells whether the cell (x,y) of this world has "
-"a wall on top."
+"Surprisingly, the bubble sort variant requires ways less moves than the "
+"other variants. This is astonishing because usually, the bubble sort "
+"performs much worse than the others sorts, but it comes from the very good "
+"match between its big lines and the baseball universe. It actually happens "
+"rather often that a pleasantly written algorithm performs very decently. But "
+"this is not an universal rule either, as demonstrated by the naive algorithm "
+"of the first exercise, that was nice, simple and wrong ;)"
msgstr ""
-"<code>aMurNord(x,y)</code> indique si la cellule (x,y) de ce monde est "
-"fermée par un mur en haut."
+"De manière étonnante, la variante à bulle semble nécessiter beaucoup moins "
+"de déplacements que les autres variantes. C'est assez surprenant car "
+"habituellement, le tri à bulle est la pire des variantes possibles, mais "
+"cela s'explique sans peine par les analogies entre cet algorithme et le "
+"problème du baseball multicolore. Il est relativement courant qu'un "
+"algorithme écrit simplement et naturellement se comporte bien en pratique. "
+"Il ne s'agit cependant pas d'une règle absolue, comme prouvé par "
+"l'algorithme simple et faux du premier exercice !"
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:12
+#. type: Content of: <h1>
+#: src/lessons/recursion/Main.html:1
+msgid "Recursive algorithms"
+msgstr "Algorithmes récursifs"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/Main.html:2
+msgid "This lesson allows to experiment with recursive algorithms."
+msgstr "Cette leçon vous permet d'expérimenter avec des algorithmes récursifs."
+
+#. type: Content of: <p>
+#: src/lessons/recursion/Main.html:4
msgid ""
-"<code>hasLeftWall(x,y)</code> tells whether the cell (x,y) of this world has "
-"a wall on the left."
+"If you need more recursive algorithms, an exercise on recursive sorting "
+"algorithms (in particular QuickSort and MergeSort) is planned in the future "
+"within the sorting lesson."
msgstr ""
-"<code>aMurOuest(x,y)</code> indique si la cellule (x,y) de ce monde est "
-"fermée par un mur à gauche."
+"Si vous cherchez d'autres algorithmes récursifs, un exercice sur les tris "
+"récursifs (en particulier QuickSort et MergeSort) est prévu à l'avenir dans "
+"la leçon sur les tris."
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:13
+#. type: Content of: <h3>
+#: src/lessons/recursion/Main.html:8
+msgid "What can I do to improve this lesson?"
+msgstr "Que puis-je faire pour améliorer cette leçon ?"
+
+#. type: Content of: <p>
+#: src/lessons/recursion/Main.html:10
msgid ""
-"<code>hasBaggle(x,y)</code> tells whether the cell (x,y) of this world has a "
-"baggle."
+"As usual, there are several things that could be done in this lesson to "
+"improve it further:"
msgstr ""
-"<code>aBiscuit(x,y)</code> indique si un baggle se trouve dans la cellule (x,"
-"y) de ce monde."
+"Comme souvent, plusieurs points pourraient être améliorés dans cette "
+"leçon :"
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:14
+#: src/lessons/recursion/Main.html:12
msgid ""
-"<code>setIndication(x,y,i)</code> adds the integer indication <code>i</code> "
-"to the cell (x,y)."
+"The Sierpinski triangle can be drawn using a simpler L-system. See http://"
+"jpvallon.free.fr/recursivite.html"
msgstr ""
-"<code>setIndication(x,y,i)</code> ajoute une indication entière <code>i</"
-"code> sur le sol de la cellule (x,y)."
+"Le triangle de Sierpinski peut être tracé de façon bien plus simple en "
+"utilisant un L-système. Voir http://jpvallon.free.fr/recursivite.html"
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:15
+#: src/lessons/recursion/Main.html:13
msgid ""
-"<code>getIndication(x,y,i)</code> retrieves the integer indication of the "
-"cell (x,y) (or 9999 if there is no indication)."
+"The arrowhead curve is also interesting: http://www.mathcurve.com/fractals/"
+"sierpinski/sierpinskitriangle.shtml"
msgstr ""
-"<code>getIndication(x,y,i)</code> retourne l'indication entière qui se "
-"trouve dans la cellule (x,y) (ou bien la valeur 9999 s'il n'y a pas "
-"d'indication à l'endroit indiqué)."
+"la courbe de Sierpinski est également intéressante: http://www.mathcurve.com/"
+"fractals/sierpinski/sierpinskitriangle.shtml"
-#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:18
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/Main.html:14
msgid ""
-"It has to be noted that it is not possible to build a wall on the bottom "
-"edge or on the right edge of a cell. Therefore when such wall exists, it "
-"means it was built on a sibling cells -- as a top (respectively left) wall "
-"on the cell that is located below (respectively at the right of) the current "
-"cell."
+"The dragon curve could be explained as a L-system: http://ecademy.agnesscott."
+"edu/~lriddle/ifs/heighway/heighway.htm"
msgstr ""
-"Il est bon de noter qu'il n'est pas possible de construire un mur sur le "
-"côté inférieur ou le coté droit d'une case. Néanmoins, quand de tels murs "
-"existent, cela signifie qu'il a été construit sur une case voisine -- comme "
-"mur supérieur (respectivement gauche) sur la case qui est située en dessous "
-"(respectivement sur à droite) de la case courante."
+"La courbe du dragon pourrait être expliquée comme un L-système. http://"
+"ecademy.agnesscott.edu/~lriddle/ifs/heighway/heighway.htm"
-#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:24
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/Main.html:15
msgid ""
-"Your buggle should first write the distance to the exit on each cell (or at "
-"least the useful ones)."
+"The dragon2 curve is called the twin dragon: http://ecademy.agnesscott.edu/"
+"~lriddle/ifs/heighway/twindragon.htm"
msgstr ""
-"Votre buggle devrait tout d'abord écrire sur chaque case importante la "
-"distance qui la sépare de la sortie."
+"La courbe du dragon2 s'appelle la courbe des dragons jumeaux: http://ecademy."
+"agnesscott.edu/~lriddle/ifs/heighway/twindragon.htm"
-#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:25
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/Main.html:16
msgid ""
-"For that, find the exit and write 0 there. Then, write 1 on every "
-"neighboring cells that is not separated from the exit with a wall. And then "
-"mark every cells from which you can reach the exit in 2 steps, and iterate "
-"for all cells until you mark the cell where the buggle is located."
+"The space filling curves could be added (Peano, Hildebert, etc). See: "
+"http://teachout1.net/village/fill.html"
msgstr ""
-"Pour cela, trouvez la sortie et écrivez 0 dessus. Ensuite, écrivez 1 sur "
-"toutes les cases adjacentes à la sortie qui n'en sont pas séparées par un "
-"mur. Ensuite, écrivez 2 sur toutes les cases à partir desquelles on peut "
-"atteindre une case marquée 1, puis faites de même pour toutes les cases "
-"jusqu'à numéroter la case où se trouve votre buggle."
+"Les courbes remplissant l'espace (Peano, Hildebert, etc) pourraient être "
+"ajoutées. http://teachout1.net/village/fill.html"
-#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:30
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/Main.html:18
msgid ""
-"Once the cells are marked, get your jedi buggle to follow the shortest "
-"path. Basically the buggle has only to walk on each case with the lesser "
-"distance from the exit. You can use the method "
-"<code>setDirection(direction)</code> to make your buggle look at the "
-"specific direction such as <code>Direction.NORTH</code> or <code>Direction."
-"EAST</code>."
+"We could do another exercise on embeeded polygons: http://www.inrialpes.fr/"
+"helix/people/genoud/ENSJAVA/tds/sujets/dessinsReccursifs/actionsrecursives."
+"html"
msgstr ""
-"Une fois que toutes les cases sont marquées, faites en sorte que votre "
-"buggle jedi trouve le plus court chemin en suivant les indications écrites "
-"au sol. Pour celà, il lui suffit à chaque pas d'aller sur la case de plus "
-"petite distance parmis celles accessibles. Vous pouvez utiliser la méthode "
-"<code>void setDirection(Direction d)</code> pour faire regarder votre buggle "
-"dans une direction spécifique comme <code>Direction.NORD</code>, "
-"<code>Direction.SUD</code>, <code>Direction.EST</code> ou <code>Direction."
-"OUEST</code>, qui correspondent respectivement au nord, sud, est et ouest."
-
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:35
-msgid "I'm lost now. Please give me some extra indications."
-msgstr "Je suis perdu, je voudrais plus d'indications"
-
-#. type: Content of: <div>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:36
-msgid "Use the Force, Luke!"
-msgstr "Utilises la Force Luke !"
+"Un exercice sur les polygones inscrits serait intéressant: http://www."
+"inrialpes.fr/helix/people/genoud/ENSJAVA/tds/sujets/dessinsReccursifs/"
+"actionsrecursives.html"
-#. type: Content of: <h2>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:1
-msgid "Finding the walls to follow"
-msgstr "Trouver les murs à longer"
+#. type: Content of: <h3>
+#: src/lessons/recursion/short_desc.html:1
+msgid "Bases of recursion"
+msgstr "Les bases de la récursion"
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:3
+#: src/lessons/recursion/short_desc.html:2
msgid ""
-"This is exactly the same maze than before, but the buggle does not start at "
-"the same location. In particular, it does not have any wall to its left at "
-"the beginning."
+"Discover the recursive way of thinking by drawing trees and other figures "
+"with the Logo turtle."
msgstr ""
-"C'est exactement le même labyrinthe que précédemment, mais la buggle ne "
-"commence plus au même emplacement. En particulier, elle n'a plus de mur à sa "
-"gauche dès le départ."
+"Découvrez la récursion en dessinant des arbres et d'autres figures avec la "
+"tortue Logo."
+
+#. type: Content of: <h2>
+#: src/lessons/recursion/square/FourSquare.html:1
+msgid "The small cousines of Buggles"
+msgstr "Les petites cousines des Buggles"
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:7
+#: src/lessons/recursion/square/FourSquare.html:3
msgid ""
-"As a result, the method you wrote for the previous exercise probably don't "
-"work for this one. If you use it here with no modification, your buggle "
-"probably start looping over the four free cells around its start position "
-"(if that's not the case, well, you didn't really stick to the mission on "
-"previous exercise. Feel lucky and proceed to the next :)"
+"Today, we will meet the small cousines of the buggles: the turtles. In fact, "
+"turtles are much olders than the buggles. They were invented in the 70's by "
+"a scientific from MIT called Seymour Papert to help teaching programming, "
+"and the buggles are a variation on the idea invented by Lyn Turbak from "
+"Wellesley College later."
msgstr ""
-"Ceci fait que la méthode écrite à l'exercice précédent ne fonctionne plus. "
-"Si vous l'utilisez ici sans modification, votre buggle va probablement "
-"commencer à tourner sur les quatres cases à côté de sa position de départ "
-"(si ça n'est pas le cas, et bien, vous n'avez pas réellement suivi la "
-"mission de l'exercice précédent. Sentez vous chanceux et passez à l'exercice "
-"suivant une fois que vous aurez lu ce texte)."
+"Aujourd'hui, nous allons faire la connaissance des petites cousines des "
+"buggles : les tortues. En fait, les tortues sont bien plus vieilles que les "
+"buggles. Elles ont été inventées dans les années 70 par un scientifique du "
+"MIT nommé Seymour Papert pour aider à l'enseignement la programmation, et "
+"les buggles sont une variation sur le thème inventée par Lyn Turbak du "
+"Wellesley College plus tard."
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:14
+#: src/lessons/recursion/square/FourSquare.html:9
msgid ""
-"This is because your <code>keepHandOnSideWall()</code> method has an "
-"implicit <b>pre-condition</b>: it works well if and only if the buggle has a "
-"wall to its left when you call it. Such pre-condition are very heavily used "
-"when programming. Specifying them explicitly helps understanding the code "
-"written by other, and they even allow sometimes to prove that the code works "
-"correctly."
+"Turtles are thus a bit like buggles, but smaller. Just like buggles, you can "
+"order them to move forward, to turn, to move backward, etc. Just like "
+"buggles, they leave a line on their path when they move (but the line is "
+"much smaller)."
msgstr ""
-"C'est parce que votre méthode <code>keepHandOnSideWall()</code> a une <b>pré-"
-"condition</b> implicite : la méthode marche bien si et seulement si la "
-"buggle a un mur sur sa gauche quand vous appelez cette méthode. De telles "
-"pré-conditions sont très utilisées en programmation. Les spécifier "
-"explicitement aide à comprendre le code écrit par d'autres personnes, et "
-"peuvent même parfois prouver que le code marche correctement."
+"Les tortues sont donc un peu comme les buggles, en plus petit. Comme les "
+"buggles, vous pouvez leur demander d'avancer, de tourner, de reculer, etc. "
+"Comme les buggles, elles laissent une trace sur leur passage quand elles "
+"avancent (simplement, le trait est bien plus fin)."
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:24
+#: src/lessons/recursion/square/FourSquare.html:14
msgid ""
-"Fixing the problem should be very easy. Simply make sure that the pre-"
-"condition of <code>keepHandOnSideWall()</code> is verified before calling "
-"it. For that, update your code to first look for a wall on its left before "
-"the big <code>while</code> loop."
+"The main difference is that where buggles can only move of right angles, "
+"turtles can move of any arbitrary angles specified by a real number (a "
+"double). This gives them much more liberty in their movings. The buggles can "
+"do several other tricks, like reading and writting messages, picking or "
+"dropping objects, and there is sometimes walls in their worlds (but all this "
+"is completely above the capacities of turtles)."
msgstr ""
-"Réparer le problème devrait être très facile. Assurez-vous simplement que la "
-"pré-condition de <code>keepHandOnSideWall()</code> est vérifiée avant de "
-"l'appeler. Pour ce faire, mettez à jour votre code pour tout d'abord "
-"rechercher à avoir un mur à sa gauche avant de rentrer dans la grande boucle "
-"<code>while</code>."
-
-#. type: Content of: <h3>
-#: src/plm/universe/lightbot/LightBotWorld.html:1
-#: src/lessons/lightbot/Main.html:1 src/lessons/lightbot/short_desc.html:1
-msgid "LightBot"
-msgstr "LightBot"
+"La principale différence est que là où les buggles ne peuvent tourner que de "
+"quarts de tour, les tortues peuvent tourner d'un angle quelconque précisé "
+"par un nombre réel (double). Cela leur donne bien plus de liberté dans leur "
+"mouvement. Les buggles savent faire plusieurs trucs qui échappent aux "
+"tortues, comme lire et écrire des messages sur le sol ou ramasser des "
+"objets, et il y a parfois des murs dans leur univers, mais tout cela dépasse "
+"complètement les tortues."
-#. type: Content of: outside any tag (error?)
-#: src/plm/universe/lightbot/LightBotWorld.html:3
+#. type: Content of: <p>
+#: src/lessons/recursion/square/FourSquare.html:21
msgid ""
-"This universe introduces a little programming puzzle which can somehow be "
-"used to introduce programmation to non-reading kids since it is programmed "
-"graphically. The goal of each board is to light up all the lights. Your "
-"robot understands the following orders:"
+"From a practical point of view, most of the methods you knew about buggles "
+"still work with turtles, with some minor adaptations. In particular, the "
+"<code>forward()</code> method takes the amount of steps to do not as an "
+"integer, but as a [!python]point number[/!][!java|scala]double[/!] (see "
+"\"About this world\" for more details)."
msgstr ""
-"Cet univers introduit un petit puzzle de programmation qui peut être utilisé "
-"pour introduire la programmation aux enfants ne sachant pas lire. En effet, "
-"il est programmé de manière graphique. L'objectif de chaque niveau est "
-"d'allumer toutes les lumières du plateau en utilisant le petit robot. Celui-"
-"ci comprend les ordres suivants :"
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:7
-msgid "<b>Order</b>"
-msgstr "<b>Ordre</b>"
+"D'un point de vue pratique, la plupart des méthodes que vous connaissez à "
+"propos des buggles fonctionnent également avec les tortues, à quelques "
+"variantes près. En particulier, la méthode <code>avance</code> prend en "
+"argument le nombre de pas donné comme un [!python]nombre à virgule[/!][!"
+"scala|java]double[/!] (voir «Aide / À propos de ce monde» dans le menu pour "
+"plus de détails)."
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:7
-msgid "<b>Meaning</b>"
-msgstr "<b>Signification</b>"
+#. type: Content of: <h3>
+#: src/lessons/recursion/square/FourSquare.html:28
+msgid "Doubles? But what is it?"
+msgstr "Des doubles ? Mais qu'est ce que c'est ?"
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:8
-msgid "<b>Move forward</b>"
-msgstr "<b>Avancer</b>"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/square/FourSquare.html:29
+msgid "It's simply a point number. Example:"
+msgstr "C'est simplement un nombre à virgule. Exemple:"
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:8
+#. type: Content of: <pre>
+#: src/lessons/recursion/square/FourSquare.html:31
+#, no-wrap
msgid ""
-"Cannot be done if the destination cell is of another height than source cell"
+"double x = 3.72;\n"
+"x + 1.234 // Value = 4.954\n"
+"x + 2. // Value = 5.72 (2. means 2.0)\n"
+"x + 2 // [!java]Value = 5.72 (2 automatically converted to 2.0)[/!][!scala]Type error (+ operator don't mix Double and Int); manual conversion mandatory[/!]\n"
+"x * 2. // Value = 7.44 \n"
+"x / 2. // Value = 1.86 \n"
+"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Value = 1 (“casting to int”, converted to integer by truncating)\n"
+"Math.round(x) // Value = 2 (1.86 rounded to nearest integer)\n"
+"Math.floor(x) // Value = 1 (1.86 rounded toward minus infinity)\n"
+"Math.floor(-5.12) // Value = -6 (rounded toward minus infinity)\n"
+"Math.ceiling(x) // Value = 2 (1.86 rounded toward plus infinity)\n"
+"Math.ceiling(-5.12) // Value = -5 (rounded toward plus infinity)\n"
+"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 (“casted to double”, converted to double)\n"
msgstr ""
-"Ne peut être utilisé que si la case d'arrivée est à la même altitude que la "
-"case de départ."
+"double x = 3.72;\n"
+"x + 1.234 // Valeur = 4.954\n"
+"x + 2. // Valeur = 5.72 (2. signifie 2.0)\n"
+"x + 2 // [!java]Valeur = 5.72 (2 converti en 2.0 automatiquement)[/!][!scala]Erreur de typage (l'opérateur + operator ne mélange pas les Double avec les Int). Il faut convertir explicitement[/!]\n"
+"x * 2. // Valeur = 7.44\n"
+"x / 2. // Valeur = 1.86 (2 converti en 2.0 automatiquement)\n"
+"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Valeur = 1 (“transtypage en int”, converti en entier en tronquant)\n"
+"Math.round(x) // Valeur = 2 (1.86 arrondi à l'entier le plus proche)\n"
+"Math.floor(x) // Valeur = 1 (1.86 arrondi en direction de moins l'infini)\n"
+"Math.floor(-5.12) // Vale = -6 (Arrondi en direction de moins l'infini)\n"
+"Math.ceiling(x) // Value = 2 (1.86 arrondi en direction de plus l'infini)\n"
+"Math.ceiling(-5.12) // Value = -5 (Arrondi en direction de plus l'infini)\n"
+"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 (“transtypage en double”, converti en double)\n"
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:9
-msgid "<b>Jump forward</b>"
-msgstr "<b>Sauter en avant</b>"
+#. type: Content of: <p><p><p><h2>
+#: src/lessons/recursion/square/FourSquare.html:47
+#: src/lessons/recursion/hanoi/HanoiBoard.html:20
+#: src/lessons/welcome/array/basics/Array1.html:229
+msgid "Goal of this exercise"
+msgstr "Objectif de l'exercice"
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:9
+#. type: Content of: <p>
+#: src/lessons/recursion/square/FourSquare.html:48
msgid ""
-"Can only be done if the destination cell is one step higher than source "
-"cell, or if destination is lower than source. Cannot be used for plain moves."
+"Even if this is the first exercise on the recursivity lesson, the code you "
+"have to write is not recursive. The goal is to get familiar with the turtle "
+"world before getting on serious matter."
msgstr ""
-"Ne peut être utilisé que si la case d'arrivée est un étage plus haute que la "
-"case de départ, ou si l'arrivée est plus basse que le départ. Il est "
-"impossible de sauter sur un terrain plat."
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:10
-msgid "<b>Turn left</b>."
-msgstr "<b>Tourner à gauche</b>."
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:11
-msgid "<b>Turn right</b>."
-msgstr "<b>Tourner à droite</b>."
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:12
-msgid "<b>Switch the light</b>."
-msgstr "<b>Allumer ou éteindre</b>"
+"Bien que ce soit le premier exercice de la leçon sur la récursivité, le code "
+"que vous devez écrire n'est pas récursif. L'objectif est de se familiariser "
+"avec le monde des tortues avant d'attaquer les choses sérieuses."
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:12
+#. type: Content of: <p>
+#: src/lessons/recursion/square/FourSquare.html:52
msgid ""
-"Turn it on if it was off, and off if it was on. No effect if the cell does "
-"not contain any light."
+"You must reproduce a simple geometrical painting constituted of four 100 "
+"steps long squares (see the objective world for more details). It is "
+"obviously a good idea to write a method to draw a square, and then use it in "
+"your code."
msgstr ""
-"Allumer l'ampoule si elle était éteinte, et éteindre si elle était allumée. "
-"Sans effet s'il n'y a pas d'ampoule dans la case courante."
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:13
-msgid "<b>Call function 1</b>."
-msgstr "<b>Appeller la fonction 1</b>."
+"Vous devez reproduire une forme géométrique simple faite de quatre carrés de "
+"longueur 100 de coté (voir le monde objectif pour plus de détails). C'est "
+"sans doute une bonne idée d'écrire une méthode pour faire un carré, et de la "
+"réutiliser lors de l'écriture de votre code."
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:14
-msgid "<b>Call function 2</b>."
-msgstr "<b>Appeller la fonction 2</b>."
+#. type: Content of: <h2>
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:1
+msgid "Fractal of polygons"
+msgstr "Fractales de polygones"
-#. type: Content of: <p>
-#: src/plm/universe/lightbot/LightBotWorld.html:17
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:3
msgid ""
-"Please note that this world is not completely suited to small kids since the "
-"main difficulty comes from the fact that your are highly limited in the "
-"amount of instructions you can give to your robot. Advanced levels thus "
-"require to write sound functions, and are often above the capacities of "
-"small kids."
+"The fractal we will now draw is formed of a polygon, with little polygons on "
+"each corner. The prototype of the method drawing it is the following:"
msgstr ""
-"Veuillez noter que ce jeu n'est pas vraiment adapté aux jeunes enfants "
-"puisque la principale difficulté vient de la limitation du nombre "
-"d'instructions utilisable dans chaque programme. Les niveaux avancés ne "
-"peuvent être résolus sans écrire des fonctions pour factoriser le code, ce "
-"qui est souvent au delà des capacités des jeunes enfants."
+"La fractale que nous allons dessiner maintenant est formée d'un polygone "
+"auquel sont ajoutés des petits polygones sur chaque angle. Le prototype de "
+"la fonction le traçant est le suivant:"
+
+#. type: Content of: <pre>
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:5
+#, no-wrap
+msgid "[!java]void [/!]polygonFractal ([!java]int [/!]levels[!scala]:Int[/!], [!java]int [/!]sides[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
+msgstr "[!java]void [/!]polygonFractal ([!java]int [/!]niveaux[!scala]:Int[/!], [!java]int [/!]cotés[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!], [!java]double [/!]multiplicateur[!scala]:Double[/!])"
#. type: Content of: <p>
-#: src/plm/universe/lightbot/LightBotWorld.html:19
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:7
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:25
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:44
msgid ""
-"This game is heavily inspirated from a flash game of the same name, which "
-"can for example be played on kongregate.com. It was written by Danny "
-"Yaroslavski (Coolio-Niato), the original idea being of Matt Chase."
+"Have a look at each world's objective view to understand how to write the "
+"function."
msgstr ""
-"Ce jeu est très largement inspiré d'un jeu en flash du même nom, que l'on "
-"peut par exemple trouver sur kongregate.com. Il a été écrit par Danny "
-"Yaroslavski (Coolio-Niato), d'après une idée originale de Matt Chase."
+"Consultez les objectifs de chaque monde pour comprendre comment écrire la "
+"fonction."
+
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/Koch.html:1
+msgid "Snow flake"
+msgstr "Flocons de neige"
#. type: Content of: outside any tag (error?)
-#: src/lessons/lightbot/Main.html:2
+#: src/lessons/recursion/koch/Koch.html:3
msgid ""
-"This lesson introduces a little programming puzzle inspired from a flash "
-"game."
+"We will now draw snow flakes using the Koch fractal. A fractal is a "
+"geometric pattern repeated at every scale."
msgstr ""
-"Cette leçon introduit un petit jeu de programmation inspiré d'un jeu en "
-"flash."
+"Nous allons maintenant dessiner des flocons de neige en utilisant la "
+"fractale de Koch. Une fractale est un dessin géométrique dont le motif se "
+"reproduit à n'importe quelle échelle."
#. type: Content of: <p>
-#: src/lessons/lightbot/Main.html:4
-msgid "See the <i>About this world</i> dialog for more details."
+#: src/lessons/recursion/koch/Koch.html:6
+msgid ""
+"The general form is a triangle, with each side given by several recursive "
+"calls. Your work is only to write the code of the <code>snowSide</code> "
+"method so that it draws one side of the triangle. To make it easier, each "
+"sides are represented in a specific color. Just draw the red things (without "
+"changing your pen color), and the other colors will be drawn automatically."
msgstr ""
-"Référez vous à l'aide <i>À propos de ce monde</i> pour plus de détails."
+"La forme générale est une sorte de triangle, dont chaque coté est généré par "
+"des appels récursifs.\n"
+"Vous ne devez dessiner qu'un coté de ce triangle dans la fonction "
+"<code>snowSide</code>. \n"
+"Pour simplifier les choses, chaque coté a une couleur particulière. "
+"Contentez vous de dessiner les choses en rouge (sans changer votre couleur), "
+"et les autres couleurs seront dessinées automatiquement."
#. type: Content of: <p>
-#: src/lessons/lightbot/short_desc.html:3
+#: src/lessons/recursion/koch/Koch.html:12
msgid ""
-"This lesson constitutes a little brain teaser for programmers. You have to "
-"instruct your robot to turn off all lights. The trick is that you program "
-"your robot graphically, and that you are limited in the amount of "
-"instructions."
-msgstr ""
-"Cette leçon constitue un casse-tête pour programmeurs, où vous devez "
-"apprendre à votre robot à éteindre toutes les lumières. Le truc est que vous "
-"le programmez graphiquement, et que vous n'avez droit qu'à un nombre limité "
-"d'instructions."
+"Observe the drawing in each world's objective to understand the pattern's "
+"logic, and then reproduce it. At level 0, the Koch curve is just a straight "
+"line. At level 1, the curve is divided in three thirds, and the middle part "
+"is replaced by the two sides of an equilateral triangle of the same length "
+"as the segment being removed. At level 2, the process is repeated, whith "
+"each segments split in three parts and the middle part being replaced by the "
+"two sides of an equilateral triangle."
+msgstr ""
+"Observez l'objectif de chaque monde pour comprendre la logique du motif à "
+"dessiner, puis reproduisez-le.\n"
+"Au niveau 0, la courbe de Koch est une simple ligne droite.\n"
+"Au niveau 1, elle est divisée en trois tiers, et la partie du milieu est "
+"remplacée par deux cotés d'un triangle équilatéral de même longueur que le "
+"segment supprimé.\n"
+"Au niveau 2, le processus est répété avec le tiers central de chaque segment "
+"remplacé par un petit triangle équilatéral."
-#. type: Content of: <p>
-#: src/lessons/lightbot/short_desc.html:8
-msgid "No previous experience is expected to take this lesson."
-msgstr "Aucune expérience préalable n'est nécessaire pour tenter cette leçon."
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/recursion/koch/Koch.html:19
+msgid "Too much letters. Please picture it."
+msgstr "TL;DR. Vous pouvez me dessiner tout ça ?"
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board01TwoSteps.html:1
-msgid "Welcome"
-msgstr "Bienvenue"
+#. type: Content of: <p><div><p>
+#: src/lessons/recursion/koch/Koch.html:20
+#: src/lessons/recursion/koch/SquareKoch.html:8
+msgid "Here are the results of the first levels of recursion."
+msgstr "Voici le résultat des premiers niveaux de recusion."
#. type: Content of: <p>
-#: src/lessons/lightbot/Board01TwoSteps.html:3
+#: src/lessons/recursion/koch/Koch.html:24
msgid ""
-"Welcome to the lightbot world. This is merely a programmer puzzle rather "
-"than a real lesson (although some use it to teach programming). The robot "
-"is not programmed in Java, but rather graphically. You can see the existing "
-"orders in the documentation using the <i>About this world</i> menu."
+"You must write the <code>snowSide()</code> method, which is recursive but "
+"<b>do not call snowFlake from snowSide</b>, or you will get very strange and "
+"unexpected behaviors."
msgstr ""
-"Bienvenue dans le monde de LightBot. Il s'agit plus d'une sorte de puzzle "
-"pour programmeur que d'une vraie leçon (bien qu'il puisse être utilisé pour "
-"enseigner la programmation). Le robot n'est pas programmé en Java, mais "
-"graphiquement. Vous trouverez les ordres disponibles dans la documentation "
-"en utilisant le menu <b>À propos de ce monde</b>."
+"Vous devez écrire la fonction snowSide, qui est récursive. Mais <b>n'appelez "
+"pas snowFlake depuis snowSide</b>, car sinon le résultat sera vraiment "
+"étrange et inattendu."
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:6
-msgid ""
-"The goal of each board is simply to switch on every lights of the board "
-"using your little robot."
-msgstr ""
-"L'objectif de chaque niveau est simplement de faire allumer toutes les "
-"ampoules du tableau à votre petit robot."
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/SquareKoch.html:1
+msgid "Snow square"
+msgstr "Carrés de neige"
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:8
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/SquareKoch.html:3
msgid ""
-"This is a introduction exercise, which should be solvable by only moving "
-"forward and switching the light, using respectively"
+"This exercise is a variation over the snow flake that we saw previously. "
+"The main difference is that we are growing little squares instead of "
+"triangles on the sides of the figure."
msgstr ""
-"Ce premier exercice est une simple mise en bouche. Vous devriez pouvoir le "
-"résourdre simplement en avancant et en allumant la lampe, grâce aux ordres "
-"suivants: "
-
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board01TwoSteps.html:10
-#: src/lessons/lightbot/Board02Turn.html:4
-#: src/lessons/lightbot/Board06Func.html:3
-msgid "and"
-msgstr "et"
-
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:10
-msgid "."
-msgstr "."
-
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board02Turn.html:1
-msgid "Turn around"
-msgstr "Se retourner"
+"Cet exercice est une variation sur le flocon de neige vu précédemment. \n"
+"La principale différence est qu'il faut maintenant faire pousser des petits "
+"carrés au lieu des triangles sur les segments de cette figure."
-# type: Content of: <p>
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board02Turn.html:3
-msgid "Now, you probably need to turn in addition (using"
-msgstr "Maintenant, vous avez probablement besoin de tourner (en utilisant "
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/recursion/koch/SquareKoch.html:7
+msgid "I don't see it, sorry. Please picture it."
+msgstr "Je ne vois pas. Je peux voir un dessin ?"
-# type: Content of: <p>
#. type: Content of: <p>
-#: src/lessons/lightbot/Board02Turn.html:4
-msgid ")."
-msgstr ")."
-
-# type: Content of: <h1>
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board03Jump.html:1
-msgid "Jump"
-msgstr "Sauter"
+#: src/lessons/recursion/koch/SquareKoch.html:13
+msgid ""
+"As previously, your <code>squareSide</code> function should only draw one "
+"side of the figure, and the template will call it for all sides "
+"automatically (with one color per side)."
+msgstr ""
+"Comme précédement, votre fonction <code>squareSide</code> doit seulement "
+"dessiner un coté de la figure, et le code fourni l'appellera 4 fois pour "
+"dessiner tous les cotés (chacun avec sa couleur)."
-# type: Content of: <p>
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board03Jump.html:3
-msgid "You can also jump using"
-msgstr "Vous pouvez également sauter en utilisant "
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/PentaKoch.html:1
+msgid "Snow pentagon"
+msgstr "Pentagone de neige"
-# type: Content of: <p>
#. type: Content of: <p>
-#: src/lessons/lightbot/Board03Jump.html:3
+#: src/lessons/recursion/koch/PentaKoch.html:3
msgid ""
-"to pass obstacles. You can either jump one level up or any amount of levels "
-"down, but you cannot jump to go on a cell of the same height."
+"Here comes yet another variation of the Koch curve. This time, we grow "
+"little pentagons (ie, polygons with five sides each). I'm sure you get it "
+"now."
msgstr ""
-"pour passer les obstacles. Vous pouvez soit sauter un étage vers le haut, ou "
-"vers le bas (même de plusieurs étages), mais vous ne pouvez pas sauter pour "
-"vous déplacer à plat."
-
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board04Stairs.html:1
-msgid "Stairs"
-msgstr "Escaliers"
+"Voici une autre variation de la courbe de Koch. Cette fois, ce sont de "
+"petits pentagones (càd des polygones à 5 cotés) qui doivent pousser sur les "
+"faces de la figure. Je suis sûr que vous commencez à prendre le truc."
#. type: Content of: <p>
-#: src/lessons/lightbot/Board04Stairs.html:3
-msgid "Can you pass these stairs?"
-msgstr "Parviendrez vous à passer ces escaliers ?"
-
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board05Higher.html:1
-msgid "Higher"
-msgstr "Toujours plus haut"
+#: src/lessons/recursion/koch/PentaKoch.html:6
+msgid ""
+"Another difference with earlier is that the length is not divided by three "
+"at each step anymore, but multiplied by 0.4. The curve looks better this "
+"way :)"
+msgstr ""
+"Une autre différence avec les exercices précédents est que cette fois, vous "
+"ne devez pas diviser la taille du segment par 3 à chaque niveau de "
+"récursion, mais vous devez le multiplier par 0,4. La courbe est plus jolie "
+"ainsi :)"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board05Higher.html:3
-msgid "Let's go higher"
-msgstr "Il est temps de nous élever de plus en plus haut."
+#: src/lessons/recursion/koch/PentaKoch.html:9
+msgid ""
+"We draw only one side in this exercise so your code will be called only once "
+"this time."
+msgstr ""
+"Nous dessinons un seul coté dans cet exercice, donc votre code ne sera "
+"appellé qu'une seule fois."
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board06Func.html:1
-msgid "Functions"
-msgstr "Fonctions"
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/HexaKoch.html:1
+msgid "Snow hexagon"
+msgstr "Hexagone de neige"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board06Func.html:3
-msgid "You can use"
-msgstr "Vous pouvez utiliser"
+#: src/lessons/recursion/koch/HexaKoch.html:3
+msgid ""
+"This time, we will draw the curve that is known as the (6, 0.14)-Koch curve. "
+"This means that you have to grow 6-sided polygons on the segments, and that "
+"the length should be multiplied by 0.14 at each recursion level."
+msgstr ""
+"Cette fois, nous allons dessiner une courbe surnommée la courbe de Koch-(6; "
+"0,14). Cela signifie que nous allons faire pousser des hexagones (des "
+"polygones à 6 faces) sur les segments, et que les longueurs doivent être "
+"multipliées par 0,14 à chaque étage de la récursion."
#. type: Content of: <p>
-#: src/lessons/lightbot/Board06Func.html:3
+#: src/lessons/recursion/koch/HexaKoch.html:7
msgid ""
-"to call respectively the first and second functions. Define their code in "
-"their own tab."
+"For the record, the origical Koch curve is the (3, 1/3)-Koch curve, the Snow "
+"square would be (4,1/3)-Koch curve while the Snow pentagon is also called "
+"the (5, 0.4)-Koch curve. If you want, you can switch to the creative mode in "
+"the menu and explore freely other Koch curves. Just change the initial call "
+"to hexaKoch to what you want."
msgstr ""
-"Pour appeller respectivement la première et la seconde fonction. Définissez "
-"leur code dans leur boîte respective."
+"Pour info, la courbe de Koch originale est la (3; 1/3). Le carré de neige "
+"est la courbe (4; 1/3). Le pentagone de neige est la courbe (5; 0,4). Si "
+"vous le souhaitez, vous pouvez passer en mode créatif pour explorer d'autres "
+"courbes de Koch. Remplacez simplement l'appel à hexaKoch par ce que vous "
+"voulez."
-#. type: Content of: <p><p>
-#: src/lessons/lightbot/Board06Func.html:5
-msgid "This is great if you get out of space in your main function"
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/HexaKoch.html:12
+msgid ""
+"For further reference, please see <a href=\"http://ecademy.agnesscott.edu/"
+"~lriddle/ifs/kcurve/kcurve.htm\">http://ecademy.agnesscott.edu/~lriddle/ifs/"
+"kcurve/kcurve.htm</a>."
msgstr ""
-"Cela peut s'avérer pratique si vous n'avez plus assez d'espace dans votre "
-"fonction principale."
+"Pour plus d'informations, référez vous à <a href=\"http://ecademy.agnesscott."
+"edu/~lriddle/ifs/kcurve/kcurve.htm\">http://ecademy.agnesscott.edu/~lriddle/"
+"ifs/kcurve/kcurve.htm</a>."
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board07Repeat.html:1
-msgid "Repetitive tasks"
-msgstr "Des tâches répétitives"
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/Crab.html:1
+msgid "Fractal Crab"
+msgstr "La fractale du crabe"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board07Repeat.html:3
-msgid "Functions are also of great use for repetitive tasks"
-msgstr "Les fonctions sont également très pratique pour les tâches répétitives"
-
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board08Rec.html:1
-msgid "Calling functions from functions"
-msgstr "Invoquer des fonctions depuis les fonctions"
+#: src/lessons/recursion/koch/Crab.html:3
+msgid ""
+"The Crab curve is not exactly a Koch curve, but that's still a fractal and "
+"it's built rather similarly. This time, we grow square triangle on the side "
+"of the figure: the angle is 45 degrees, and the length is divided by [!java|"
+"scala]Math.sqrt(2)[/!][!python]math.sqrt(2)[/!] at each step."
+msgstr ""
+"La courbe du crabe n'est pas exactement une courbe de Koch, mais cette "
+"fractale est construite de façon très similaire. Cette fois, nous ne "
+"remplaçons pas le tiers central de chaque segment, mais le segment entier. À "
+"la place, il faut faire pousser des triangles isocèles et rectangles. "
+"L'angle initial est de 45°, et la longueur est divisée par [!java|scala]Math."
+"sqrt(2)[/!][!python]math.sqrt(2)[/!] à chaque étape."
#. type: Content of: <p>
-#: src/lessons/lightbot/Board08Rec.html:3
-msgid "It is perfectly okay to call a function from within a function!"
+#: src/lessons/recursion/koch/Crab.html:7
+msgid ""
+"Check the figures produced by the first steps of recursion to understand the "
+"pattern."
msgstr ""
-"Rien ne vous interdit d'invoquer une fonction depuis une autre fonction !"
+"Vérifiez les figures produites par les premiers niveaux de récursivité pour "
+"comprendre le motif."
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board09Castle.html:1
-msgid "Castle"
-msgstr "Chateau"
+#. type: Content of: <h3>
+#: src/lessons/recursion/koch/Crab.html:9
+msgid "Bibliographical note"
+msgstr "Note bibliographique"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board09Castle.html:3
-msgid "You're getting good at this..."
-msgstr "Vous vous en sortez de mieux en mieux..."
+#: src/lessons/recursion/koch/Crab.html:10
+msgid ""
+"This curve, also called the Lévy C curve was invented in 1938 by the French "
+"mathematician Paul Lévy in 1938. As usual, the wikipedia page is very "
+"instructive, and the page provide a very good additions: <a href=\"http://"
+"www.mathcurve.com/fractals/c/c.shtml\">http://www.mathcurve.com/fractals/c/c."
+"shtml</a>."
+msgstr ""
+"Cette courbe, également appelée la courbe C de Lévy, a été inventée en 1938 "
+"par le mathématicien Français Paul Lévy. Comme souvent, la page wikipédia "
+"sur le sujet est très instructive. La page suivante apporte également des "
+"compléments intéressants : <a href=\"http://www.mathcurve.com/fractals/c/c."
+"shtml\">http://www.mathcurve.com/fractals/c/c.shtml</a>."
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board10Wall.html:1
-msgid "Wall"
-msgstr "Mur"
+#. type: Content of: <h2>
+#: src/lessons/recursion/tree/Tree.html:1
+msgid "Trees"
+msgstr "Arbres"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board10Wall.html:3
-msgid "Ready to climb the wall?"
-msgstr "Etes-vous prêt à escalader ce mur ?"
+#: src/lessons/recursion/tree/Tree.html:3
+msgid ""
+"We will now draw trees. For that, we will write a method using double "
+"recursion following this prototype"
+msgstr ""
+"Nous allons maintenant dessiner des arbres. Pour cela, nous allons écrire "
+"une fonction doublement récursive de prototype"
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board11Sea.html:1
-msgid "Sea"
-msgstr "Mer"
+#. type: Content of: <pre>
+#: src/lessons/recursion/tree/Tree.html:5
+#, no-wrap
+msgid "[!java]void [/!]tree([!java]int [/!]steps[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
+msgstr "[!java]void [/!]tree([!java]int [/!]nbPas[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], [!java]double [/!]multiplicateur[!scala]:Double[/!])"
#. type: Content of: <p>
-#: src/lessons/lightbot/Board11Sea.html:3
-msgid "You now have to surf these waves of lamps."
-msgstr "Vous devez maintenant surfer sur cette mer de lampes."
+#: src/lessons/recursion/tree/Tree.html:7
+msgid ""
+"To draw a tree of four levels, you have to draw a trunk of the given length, "
+"turn right of the given angle, draw a tree of level 3, turn left twice of "
+"the given angle, draw another tree of level 3, and come back to your initial "
+"location. Don't forget to come back to the initial location!"
+msgstr ""
+"Pour dessiner un arbre à quatre étages, il faut dessiner un tronc de la "
+"taille indiquée, tourner à droite de l'angle indiqué, faire un arbre à 3 "
+"étages, tourner à gauche de deux fois l'angle indiqué, faire un autre arbre "
+"à 3 étages, puis revenir à sa position initiale. N'oubliez pas de revenir à "
+"la position initiale !"
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board12Escher.html:1
-msgid "Escher Castle"
-msgstr "Le chateau d'Escher"
+#. type: Content of: <p><p><p>
+#: src/lessons/recursion/tree/Tree.html:12
+msgid ""
+"If a tree's trunk is of length 'len', the trunk of the next level tree will "
+"be of length 'len*shrink'."
+msgstr ""
+"Si le tronc d'un arbre mesure length à l'étage N, il mesure shrink*length à "
+"l'étage N+1."
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board12Escher.html:3
-msgid "This one aint easy."
-msgstr "Celui-ci est loin d'être facile."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Close10.html:1
-msgid "Close to 10"
-msgstr "Proche de 10"
-
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Close10.html:2
+#. type: Content of: <p><p><p><p><p>
+#: src/lessons/recursion/tree/Tree.html:15
msgid ""
-"Given 2 int values, return whichever value is nearest to the value 10, or "
-"return 0 in the event of a tie. [!java|scala]Note that Math.abs(n) returns "
-"the absolute value of a number.[/!] [!python]Note that math.fabs(n) returns "
-"the absolute value of a number. This function can only be used if you "
-"imported the math module.[/!]"
+"As you can see, each recursion level is represented by a distinctive color. "
+"For that, you have to call the <code>current(step)</code>, passing the "
+"current recursion level as a parameter. This will pick the right color for "
+"you. Don't erase your great colors when you move back to your initial "
+"location."
msgstr ""
-"Étant donné deux nombres entiers, retourner la valeur la plus proche de 10, "
-"ou 0 en cas de match nul.\n"
-"[!java|scala]Remarquez que Math.abs(n) retourne la valeur absolue d'un "
-"nombre.[/!] \n"
-"[!python]Remarquez que math.fabs(n) retourne la valeur absolue d'un nombre. "
-"Remarquez également que vous ne pouvez utiliser cette fonction que si vous "
-"avez importé le module math.[/!]"
+"Comme vous pouvez le voir, chaque étage de la récursion est représenté par "
+"une couleur distinctive. Pour cela, appelez la fonction <code>current(step)</"
+"code> en lui passant en paramètre l'étage actuel de la récursion. Elle se "
+"chargera de choisir la couleur adéquate. N'effacez pas vos couleurs quand "
+"vous retournez à votre position initiale."
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Close10.html:7
-#: src/lessons/welcome/bat/bool1/Diff21.html:5
-#: src/lessons/welcome/bat/bool1/HasTeen.html:6
-#: src/lessons/welcome/bat/bool1/IcyHot.html:5
-#: src/lessons/welcome/bat/bool1/In1020.html:5
-#: src/lessons/welcome/bat/bool1/In3050.html:5
-#: src/lessons/welcome/bat/bool1/LastDigit.html:9
-#: src/lessons/welcome/bat/bool1/LoneTeen.html:6
-#: src/lessons/welcome/bat/bool1/Main.html:11
-#: src/lessons/welcome/bat/bool1/Makes10.html:5
-#: src/lessons/welcome/bat/bool1/Max1020.html:7
-#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:7
-#: src/lessons/welcome/bat/bool1/NearHundred.html:7
-#: src/lessons/welcome/bat/bool1/ParotTrouble.html:8
-#: src/lessons/welcome/bat/bool1/PosNeg.html:5
-#: src/lessons/welcome/bat/bool1/SleepIn.html:7
-#: src/lessons/welcome/bat/bool1/SumDouble.html:5
-#: src/lessons/welcome/bat/bool2/AlarmClock.html:11
-#: src/lessons/welcome/bat/bool2/AnswerCell.html:8
-#: src/lessons/welcome/bat/bool2/BlueTicket.html:10
-#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:11
-#: src/lessons/welcome/bat/bool2/CigarParty.html:9
-#: src/lessons/welcome/bat/bool2/DateFashion.html:12
-#: src/lessons/welcome/bat/bool2/GreenTicket.html:9
-#: src/lessons/welcome/bat/bool2/In1To10.html:8
-#: src/lessons/welcome/bat/bool2/InOrderEqual.html:9
-#: src/lessons/welcome/bat/bool2/InOrder.html:8
-#: src/lessons/welcome/bat/bool2/LastDigit2.html:8
-#: src/lessons/welcome/bat/bool2/LessBy10.html:5
-#: src/lessons/welcome/bat/bool2/Main.html:4
-#: src/lessons/welcome/bat/bool2/MaxMod5.html:9
-#: src/lessons/welcome/bat/bool2/NearTen.html:8
-#: src/lessons/welcome/bat/bool2/RedTicket.html:9
-#: src/lessons/welcome/bat/bool2/ShareDigit.html:9
-#: src/lessons/welcome/bat/bool2/SortaSum.html:7
-#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:10
-#: src/lessons/welcome/bat/bool2/TeaParty.html:11
-#: src/lessons/welcome/bat/bool2/TeenSum.html:8
-#: src/lessons/welcome/bat/bool2/TwoAsOne.html:5
-#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:8
-#: src/lessons/bat/string1/Main.html:8 src/lessons/bat/string1/AltPairs.html:4
-#: src/lessons/bat/string1/FrontTimes.html:7
-#: src/lessons/bat/string1/Last2.html:8
-#: src/lessons/bat/string1/StringBits.html:4
-#: src/lessons/bat/string1/StringMatch.html:8
-#: src/lessons/bat/string1/StringSplosion.html:4
-#: src/lessons/bat/string1/StringTimes.html:4
-#: src/lessons/bat/string1/StringX.html:6
-#: src/lessons/bat/string1/StringYak.html:7
-#: src/lessons/welcome/array/array123/Array123.html:4
-#: src/lessons/welcome/array/array667/Array667.html:7
-#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:4
-#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:4
-#: src/lessons/welcome/array/notriples/NoTriples.html:7
-#: src/lessons/welcome/array/has271/Has271.html:9
+#. type: Content of: <p><p><p><p><p>
+#: src/lessons/recursion/tree/Tree.html:19
msgid ""
-"This exercise was converted to PLM from the excellent exercising site http://"
-"javabat.com/"
+"If you get your function wrong, this can easily become hairly to debug as "
+"your errors will appear at each level of the recursion, completely changing "
+"the drawing. For debugging purpose, you can use the <code>subtree()</code> "
+"that will draw a correct subtree. This function is then very similar to the "
+"one you are trying to write. The only difference is that <code>subtree()</"
+"code> only draws in black. So, you can use it instead of a recursive call to "
+"debug your code, but you have to change for a proper recursive call to your "
+"own code (once it works) to get the colors right, and pass the exercise."
msgstr ""
-"Cet exercice a été extrait de l'excellent site d'exercices http://javabat."
-"com/ pour PLM."
+"Si vous vous trompez dans votre fonction, il peut facilement devenir très "
+"compliqué de debugger votre code. Vos erreurs se produisant à tous les "
+"étages de la récursion, le dessin peut vite devenir illisible. Pour vous "
+"aider à debugger, vous pouvez utiliser la fonction <code>subtree()</code> "
+"qui dessine un sous-arbre correct. Cette fonction est très (très) semblable "
+"par ailleurs à la fonction que vous tentez d'écrire. La seule différence est "
+"que <code>subtree()</code> ne dessine qu'en noir. Vous pouvez donc "
+"l'utiliser à la place de vos appels récursifs pendant le debug, mais vous "
+"devez changer pour des appels récursifs à votre propre code (quand il "
+"marche) pour avoir les couleurs justes, et donc pour passer l'exercice. "
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/CountTeen.html:1
-msgid "Count Teen"
-msgstr "Compter les ados"
+#. type: Content of: <h2>
+#: src/lessons/recursion/sierpinski/Sierpinski.html:1
+msgid "Sierpinski's Triangle"
+msgstr "Triangle de Sierpinski"
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/CountTeen.html:2
+#: src/lessons/recursion/sierpinski/Sierpinski.html:3
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
-"Given 4 int values, return the amount of teen ones."
+"The fractal we will now draw is formed of a big triangle inside which "
+"several smaller triangles are embedded. The prototype of the function to "
+"draw it is the following:"
msgstr ""
-"On dira qu'un nombre est \"ado\" s'il appartient est entre 13 et 19 "
-"(inclus). Étant donné quatre nombres entiers, retournez combien d'entre eux "
-"sont ados."
+"La fractale que nous allons dessiner maintenant est formée d'un triangle "
+"dans lequel sont imbriqués des triangles plus petits. Le prototype de la "
+"fonction le traçant est le suivant :"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Diff21.html:1
-msgid "Diff 21"
-msgstr "Diff 21"
+#. type: Content of: <pre>
+#: src/lessons/recursion/sierpinski/Sierpinski.html:6
+#, no-wrap
+msgid "[!java]void [/!]sierpinski([!java]int [/!]level[!scala]:Int[/!], [!java]double [/!]length[!scala]:Double[/!])"
+msgstr "[!java]void [/!]sierpinski([!java]int [/!]niveau[!scala]:Int[/!], [!java]double [/!]longueur[!scala]:Double[/!])"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/Diff21.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/sierpinski/Sierpinski.html:8
msgid ""
-"Given an int n, return the absolute difference between n and 21, except "
-"return double the absolute difference if n is over 21."
+"Have a look at each world's objective view to understand how to write the "
+"function. To draw one side of the triangle, draw a smaller recursive "
+"triangle (halve the length) and move forward by the requested length. "
+"Globally, you have to draw 3 such sides and turn by 120 between each side."
msgstr ""
-"Étant donné un entier n, retournez la différence absolue entre n et 21, sauf "
-"si n est plus grand que 21. Dans ce cas, doublez la différence absolue."
+"Consultez les objectifs des différents mondes pour comprendre le code que "
+"vous devez écrire. Pour dessiner un coté du triangle, vous devez dessiner un "
+"triangle récursif plus petit (avec la moitié de la taille) et avancer de la "
+"longueur demandée. Au total, vous devez dessiner 3 cotés de la sorte en "
+"tournant de 120 entre chaque."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/HasTeen.html:1
-msgid "Has Teen"
-msgstr "A des ados"
+#. type: Content of: <h2>
+#: src/lessons/recursion/spiral/Spiral.html:1
+msgid "Spirals"
+msgstr "Spirales"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/HasTeen.html:2
+#: src/lessons/recursion/spiral/Spiral.html:3
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
-"Given 3 int values, return true if 1 or more of them are teen."
+"We will now draw our first recursive function with the turtle. The goal is "
+"to draw different kind of spirals with the same function, which prototype is "
+"the following:"
msgstr ""
-"On dira qu'un nombre est \"ado\" s'il appartient à l'intervale [13;19]. "
-"Étant donné trois nombres entiers, retournez vrai ssi un ou plusieurs "
-"d'entre eux sont ados."
+"Nous allons maintenant écrire notre première fonction récursive avec les "
+"tortues. L'objectif est de dessiner des spirales de différentes formes avec "
+"la même fonction, dont le prototype est le suivant:"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/IcyHot.html:1
-msgid "Icy Hot"
-msgstr "Feu glacé"
+#. type: Content of: <pre>
+#: src/lessons/recursion/spiral/Spiral.html:6
+#, no-wrap
+msgid "[!java]void [/!]spiral([!java]int [/!]steps[!scala]:Int[/!], [!java]int [/!]angle[!scala]:Int[/!], [!java]int [/!]length[!scala]:Int[/!], [!java]int [/!]increment[!scala]:Int[/!])"
+msgstr "[!java]void [/!]spiral([!java]int [/!]nbPas[!scala]:Int[/!], [!java]int [/!]angle[!scala]:Int[/!], [!java]int [/!]longueur[!scala]:Int[/!], [!java]int [/!]increment[!scala]:Int[/!])"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/IcyHot.html:2
+#: src/lessons/recursion/spiral/Spiral.html:8
msgid ""
-"Given two temperatures, return true if one is less than 0 and the other is "
-"greater than 100."
+"To help you understanding how to write it, here is an example of how the "
+"parameters change during one specific call:"
msgstr ""
-"Étant donné deux températures, retournez vrai si l'une est inférieure à zéro "
-"et l'autre supérieure à 100."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/In1020.html:1
-msgid "In [10;20]"
-msgstr "Dans [10;20]"
+"Pour vous aider à comprendre comment l'écrire, voici un exemple de la suite "
+"des différentes valeurs prises par les paramètres dans un cas:"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/In1020.html:2
+#. type: Content of: <pre>
+#: src/lessons/recursion/spiral/Spiral.html:11
+#, no-wrap
msgid ""
-"Given 2 int values, return true if either of them is in the range 10..20 "
-"inclusive."
+"spiral(5, 90, 0, 3);\n"
+" forward(0);\n"
+" left(90);\n"
+" spiral(4,90,3,3);\n"
+" forward(3);\n"
+" left(90);\n"
+" spiral(3,90,6,3);\n"
+" forward(6);\n"
+" left(90);\n"
+" spiral(2,90,9,3);\n"
+" forward(9);\n"
+" left(90);\n"
+" spiral(1,90,12,3);\n"
+" forward(12);\n"
+" left(90);\n"
+" spiral(0,90,12,3);\n"
msgstr ""
-"Étant donné deux nombres entiers, retournez vrai s'un d'entre eux est dans "
-"l'intervale [10;20]."
+"spiral(5, 90, 0, 3);\n"
+" avance(0);\n"
+" gauche(90);\n"
+" spiral(4,90,3,3);\n"
+" avance(3);\n"
+" gauche(90);\n"
+" spiral(3,90,6,3);\n"
+" avance(6);\n"
+" gauche(90);\n"
+" spiral(2,90,9,3);\n"
+" avance(9);\n"
+" gauche(90);\n"
+" spiral(1,90,12,3);\n"
+" avance(12);\n"
+" gauche(90);\n"
+" spiral(0,90,12,3);\n"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/In3050.html:1
-msgid "In [30;50]"
-msgstr "Dans [30;50]"
+#. type: Content of: <h2>
+#: src/lessons/recursion/spiral/SpiralUse.html:1
+msgid "Drawing spirals"
+msgstr "Faire des spirales"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/In3050.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/spiral/SpiralUse.html:3
msgid ""
-"Given 2 int values, return true if they are both in the range 30..40 "
-"inclusive, or they are both in the range 40..50 inclusive."
+"This exercise is not really an exercise in that sense that you just have to "
+"click on the Execute button to get the reward: All the needed code is "
+"already provided. Instead, you can here explore the possibilities of the "
+"code you just wrote by changing the parameters of the call to the "
+"<code>spiral</code> function. You can move on to the next exercise if you "
+"are short on time, and come back later to play around."
msgstr ""
-"Étant donné deux nombres entiers, retournez vrai s'ils sont tous les deux "
-"dans l'intervale [30;40], ou s'ils sont tous les deux dans l'intervale "
-"[40;50]."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/LastDigit.html:1
-msgid "LastDigit"
-msgstr "Dernier chiffre"
+"Cet exercice est un peu particulier, car vous n'avez rien à faire pour le "
+"passer. Tout le code nécessaire pour le passer est fourni, et il suffit de "
+"cliquer sur le bouton «Exécuter». Il est là pour vous permettre d'explorer "
+"les possibilités du code que vous venez d'écrire en changeant les paramètres "
+"de l'appel à la fonction <code>spiral</code>. Vous pouvez passer à "
+"l'exercice suivant si le temps vous manque, puis revenir jouer ici plus tard."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/LastDigit.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/spiral/SpiralUse.html:9
msgid ""
-"Given two non-negative int values, return true if they have the same last "
-"digit, such as with 27 and 57. Note that the % \"mod\" operator computes "
-"remainders, so 17 % 10 is 7."
+"Here are some of the figures that you can produce with your <code>Spiral</"
+"code> function, provided that you come with the right parameters. You can "
+"switch to the creative mode (from the Session menu) to disable the world "
+"comparison when you explore with these spirals."
msgstr ""
-"Étant donné deux nombres entiers positifs, retournez vrai s'ils ont le même "
-"dernier chiffre, comme 27 et 57. Remarquez que l'opérateur % (modulo) "
-"calcule le reste de la division entière (donc 17 % 10 vaut 7)."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/LoneTeen.html:1
-msgid "Lone Teen"
-msgstr "Ado solitaire"
+"Voici quelques figures que l'on peut produire avec votre fonction "
+"<code>spiral</code> en lui passant les bons paramètres. Passez en mode "
+"créatif (dans le menu session) pour désactiver la correction de votre code "
+"quand vous explorez ces spirales."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/LoneTeen.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/spiral/SpiralUse.html:18
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
-"Given 2 int values, return true if one or the other is teen, but not both."
+"If you discover a cool figure, don't forget to send your parameters (menu "
+"Help/feedback) so that we can add it to the list!"
msgstr ""
-"On dira qu'un nombre est \"ado\" s'il appartient à l'intervale [13;19]. "
-"Étant donné deux nombres entiers, retournez vrai si l'un d'entre eux est "
-"ado, mais pas les deux."
+"Si vous découvrez une figure sympa n'oubliez pas de nous envoyer vos "
+"paramètres (menu Aide/envoyer une anomalie) pour que nous puissions "
+"l'ajouter à la liste!"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Main.html:1
-msgid "Boolean fun"
-msgstr "Jeux booléens"
+#. type: Content of: <h2>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:1
+msgid "Dragon curve (1)"
+msgstr "Courbe du Dragon (1)"
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Main.html:3
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:3
+msgid "The dragon curve is a classical example of recursive method."
+msgstr "Un exemple classique de la méthode récursive est la courbe du Dragon."
+
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:5
+msgid "The definition of this curve is the following:"
+msgstr "La définition de cette courbe est la suivante :"
+
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:6
msgid ""
-"Boolean operations are one of the very basic task in programming. As long "
-"as you cannot write a not so simple boolean test under the minute, you "
-"probably will have a very bad time writing a real program."
+"the dragon curve of order 1 is a vector between to arbitrary points P and Q,"
msgstr ""
-"Les opérations booléennes sont l'une des fondements de la programmation. "
-"Tant que vous ne pourrez pas écrire des tests booléens (même non triviaux) "
-"en moins d'une minute, il vous sera difficile d'écrire un vrai programme."
+"la courbe du Dragon d'ordre 1 est un vecteur entre deux points quelconques P "
+"et Q,"
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Main.html:8
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:7
msgid ""
-"That is why this lesson provides you a bunch of such exercises, so that you "
-"can get trained in this."
+"the dragon curve of order n is the dragon curve of order n-1 between P and "
+"R, followed by the same curve of order n-1 between Q and R, where PRQ is an "
+"isosceles triangle with angle R being a right angle, and R being at the "
+"right of the PQ vector. Thus, if P and Q coordinates are (x, y) and (z, t), "
+"the coordinate (u, v) of R are given by:"
msgstr ""
-"C'est pourquoi cette leçon vous propose une certaine quantité de tels "
-"exercices pour vous permettre de vous entrainer."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Makes10.html:1
-msgid "Makes 10"
-msgstr "Font 10"
+"la courbe du Dragon d'ordre n est la courbe du Dragon d'ordre n-1 entre P et "
+"R suivie de la même courbe d'ordre n-1 entre Q et R, où PRQ est le triangle "
+"isocèle rectangle en R, et R est à droite du vecteur PQ. Donc, si P et Q "
+"sont les points de coordonnées (x, y) et (z,t), les coordonnées (u, v) de R "
+"sont les suivantes:"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/Makes10.html:2
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:13
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:26
+#, no-wrap
msgid ""
-"Given 2 ints, a and b, return true if one if them is 10 or if their sum is "
-"10."
+"u = (x + z)/2 + (t - y)/2\n"
+"v = (y + t)/2 - (z - x)/2\n"
msgstr ""
-"Étant donné deux nombres entiers, retournez vrai si l'un d'entre eux vaut "
-"10, ou si leur somme vaut 10."
+"u = (x + z)/2 + (t - y)/2\n"
+"v = (y + t)/2 - (z - x)/2\n"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Max1020.html:1
-msgid "Max1020"
-msgstr "Max1020"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:17
+msgid "The prototype of the method drawing the curve is the following:"
+msgstr "Le prototype de la méthode traçant la courbe est le suivant :"
+
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:18
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:22
+#, no-wrap
+msgid "[!java]void [/!]dragon([!java]int [/!]order[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
+msgstr "[!java]void [/!]dragon([!java]int [/!]ordre[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Max1020.html:2
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:21
msgid ""
-"Given 2 positive int values, return the larger value that is in the range "
-"10..20 inclusive, or return 0 if neither is in that range."
+"You should use the method <code>setPos(x,y)</code> to put your turtle at "
+"coordinates (x,y) and the method <code>moveTo(z,t)</code> to draw a line "
+"between the turtle position and the point(z,t)."
msgstr ""
-"Étant donné deux nombres entiers, retournez la plus grande valeur dans "
-"l'intervale 10..20 inclus, ou retournez 0 si aucun des nombres n'est dans "
-"cet intervale."
+"Vous utiliserez la méthode <code>setPos(x,y)</code> pour déplacer votre "
+"tortue aux coordonnées (x,y) et la méthode <code>allerVers(z,t)</code> pour "
+"tracer un trait depuis le point où la tortue est positionnée vers le point "
+"de coordonnées (z,t)"
+
+#. type: Content of: <h2>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:1
+msgid "The dragon curve (2)"
+msgstr "Courbe du Dragon (2)"
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Max1020.html:5
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:3
msgid ""
-"Note that Math.max(Int,Int):Int and Math.min(Int,Int):Int return the maximum "
-"and minimum of two integers"
+"Previous solution induce that the turtle teleports to other location, or at "
+"the very least, that it moves its pen up during the drawing. Indeed, the end "
+"of the drawing of the first recursive call does not match the begining of "
+"the second recursive call. That is why we had to use the method "
+"<code>setPos()</code>"
msgstr ""
-"Notez que Math.max(Int,Int):Int et Math.min(Int,Int):Int retournent "
-"respectivement le maximum et le minimum de deux entiers."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:1
-msgid "MonkeyTrouble"
-msgstr "Problème de singe"
+"La solution précédente nécessite que la tortue se téléporte, autrement dit, "
+"qu'il est parfois nécessaire de lever le crayon pour tracer la courbe. En "
+"effet, entre la destination du trait tracé par le premier appel récursif ne "
+"correspond pas à la source du trait qui doit être tracé par le second appel "
+"récursif. C'est pourquoi il était nécessaire d'utiliser la méthode "
+"<code>setPos()</code>"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:3
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:9
msgid ""
-"We have two monkeys, a and b, and the parameters aSmile and bSmile indicate "
-"if each is smiling. We are in trouble if they are both smiling or if "
-"neither of them is smiling. Return true if we are in trouble."
+"In this lesson, you will write a recursive method allowing to draw the "
+"dragon curve without taking the pen up. For that, we need another recursive "
+"method drawing the mirror side of the curve."
msgstr ""
-"Nous avons deux singes, a et b, et les paramètres aSmile et bSmile indiquent "
-"s'ils sourient. Nous avons un problème s'ils sourient tous les deux en même "
-"temps, ou si aucun des deux ne sourit. Retournez vrai si nous avons un "
-"problème."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/NearHundred.html:1
-msgid "Near Hundred"
-msgstr "Presque 100"
+"Dans cette leçon, vous allez donc réaliser une méthode récursive qui permet "
+"de tracer la courbe du dragon sans lever le crayon. Pour ce faire, vous "
+"définirez une seconde méthode récursive qui trace la courbe à l'envers."
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/NearHundred.html:2
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:13
msgid ""
-"Given an int n, return true if it is within 10 of 100 or 200. [!java|"
-"scala]Note that Math.abs(n) returns the absolute value of a number.[/!] [!"
-"python]Note that math.fabs(n) returns the absolute value of a number. This "
-"function can only be used if you imported the math module.[/!]"
+"The method <code>dragon()</code> is then recursively defined using itself "
+"and <code>dragonReverse()</code>. Likewise, the method "
+"<code>dragonReverse()</code> is defined recursively using itself and "
+"<code>dragon()</code>. This is thus an example of <i>mutual recursion</i>."
msgstr ""
-"Étant donné deux nombres entiers, retourner vrai si et seulement si la "
-"valeur est à moins de 10 de la valeur 100 ou de la valeur 200.\n"
-"[!java|scala]Remarquez que Math.abs(n) retourne la valeur absolue d'un "
-"nombre.[/!] \n"
-"[!python]Remarquez que math.fabs(n) retourne la valeur absolue d'un nombre. "
-"Remarquez également que vous ne pouvez utiliser cette fonction que si vous "
-"avez importé le module math.[/!]"
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/ParotTrouble.html:1
-msgid "Parot Trouble"
-msgstr "Problème de perroquet"
+"La méthode <code>dragon()</code> sera définie récursivement en fonction des "
+"méthodes <code>dragon()</code> et <code>dragonInverse()</code>. De même, la "
+"méthode <code>dragonInverse()</code> sera définie récursivement en terme de "
+"<code>dragon()</code> et de <code>dragonInverse()</code>. Voici un bien bel "
+"exemple de <i>récursivité croisée</i>."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/ParotTrouble.html:3
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:20
msgid ""
-"We have a loud talking parrot. The \"hour\" parameter is the current hour "
-"time in the range 0..23. We are in trouble if the parrot is talking and the "
-"hour is before 7 or after 20. Return true if we are in trouble."
+"The prototype of the <code>dragon()</code> method remains unchanged from "
+"previous exercise:"
msgstr ""
-"Nous avons un perroquet très bruyant. Le paramètre \"hour\" indique l'heure "
-"courante (dans l'intervale [0;23]). Nous avons un problème si le perroquet "
-"parle avant 7h ou après 20h. Retournez vrai si nous avons un problème."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/PosNeg.html:1
-msgid "Positive Negative"
-msgstr "Positif Negatif"
+"Le prototype de la méthode <code>dragon()</code> reste le même que "
+"précédemment :"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/PosNeg.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:24
msgid ""
-"Given 2 int values, return true if one is negative and one is positive. "
-"Unless negative is true, then they both must be negative."
+"The new point's coordinate (u, v) introduced by the <code>dragon()</code> "
+"are:"
msgstr ""
-"Étant donné deux entiers, retournez vrai si l'un d'entre eux est positif et "
-"l'autre négatif. Sauf si le paramètre negative est vrai, auquel cas il faut "
-"que les deux nombres soient négatifs."
+"Les coordonnées (u, v) du nouveau point introduit par la méthode "
+"<code>dragon()</code> seront :"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/SleepIn.html:1
-msgid "SleepDay"
-msgstr "Grasse matinée"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:30
+msgid "The prototype of the method <code>dragonReverse</code> is similar:"
+msgstr ""
+"Le prototype de la méthode <code>dragonInverse()</code> est identique : :"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/SleepIn.html:3
-msgid ""
-"The parameter weekday is true if it is a weekday, and the parameter vacation "
-"is true if we are on vacation. We sleep in if it is not a weekday or we're "
-"on vacation. Return true if we sleep in."
-msgstr ""
-"Le paramètre weekday est vrai si nous sommes un jour de semaine, et le "
-"paramètre vacation est vrai si nous sommes en vacances. Nous pouvons dormir "
-"ce matin s'il ne s'agit pas d'un jour de semaine ou si nous sommes en "
-"vacances. Retournez vrai si nous pouvons faire la grasse matinée."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/SumDouble.html:1
-msgid "Sum Double"
-msgstr "Somme doublée"
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:31
+#, no-wrap
+msgid "[!java]void [/!]dragonReverse([!java]int [/!]order[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
+msgstr "[!java]void [/!]dragonReverse([!java]int [/!]ordre[!scala]:Int[/!], [!java]double [/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], [!java]double [/!]t[!scala]:Double[/!])"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/SumDouble.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:33
msgid ""
-"Given two int values, return their sum. Unless the two values are the same, "
-"then return double their sum."
+"The new point's coordinate (u, v) introduced by the <code>dragonReverse()</"
+"code> are:"
msgstr ""
-"Étant donné deux entiers, retournez leur somme. Sauf si les valeurs sont "
-"égales, auquel cas vous devez retourner le double de leur somme."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/AlarmClock.html:1
-msgid "AlarmClock"
-msgstr "Radio réveil"
+"Les coordonnées (u, v) du nouveau point introduit par la méthode "
+"<code>dragonInverse()</code> seront :"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/AlarmClock.html:2
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:35
+#, no-wrap
msgid ""
-"Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a "
-"boolean indicating if we are on vacation, return a string of the form "
-"\"7:00\" indicating when the alarm clock should ring. Weekdays, the alarm "
-"should be \"7:00\" and on the weekend it should be \"10:00\". Unless we are "
-"on vacation -- then on weekdays it should be \"10:00\" and weekends it "
-"should be \"off\"."
+"u = (x + z)/2 - (t - y)/2\n"
+"v = (y + t)/2 + (z - x)/2\n"
msgstr ""
-"Étant donné le jour de la semaine, codé de la façon suivante : 0=Dimanche, "
-"1=Lundi, 2=Mardi, ... 6=Samedi, et un booléen vacation indiquant si nous "
-"sommes en vacances, retournez une chaine de caractères de la forme \"7:00\" "
-"indiquant à quelle heure nous devons régler le radio-réveil. Les jours de la "
-"semaine, nous devons nous réveiller à 7h tandis que nous pouvons dormir "
-"jusqu'à 10h le week-end. Pendant les vacances, il nous faut nous lever à 10h "
-"la semaine tandis que le réglage pour le radio-réveil doit être \"off\" le "
-"week-end."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/AnswerCell.html:1
-msgid "AnswerCell"
-msgstr "Répondeur"
+"u = (x + z)/2 - (t - y)/2\n"
+"v = (y + t)/2 + (z - x)/2\n"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/AnswerCell.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:39
msgid ""
-"Your cell phone rings. Return true if you should answer it. Normally you "
-"answer, except in the morning you only answer if it is your mom calling. In "
-"all cases, if you are asleep, you do not answer."
+"To make the work of each method recursiv more visible, the line painted by "
+"the <code>dragon()</code> must be red (<code>Color.red</code>) while the "
+"line painted by the <code>dragonReverse()</code> must be blue (<code>Color."
+"blue</code>)."
msgstr ""
-"Votre téléphone sonne. Renvoyez vrai si vous décrochez. Vous le faites "
-"habituellement, sauf le matin où vous ne répondez que si votre mère appelle. "
-"Dans tous les cas, vous ne répondez pas si vous dormez."
+"Afin de rendre, plus visible le travail de chacune des deux méthodes "
+"récursives, le trait tracé par la méthode <code>dragon()</code> devra être "
+"rouge (<code>Color.red</code>) et le trait tracé par la méthode "
+"<code>dragonInverse</code> devra être bleu (<code>Color.blue</code>)."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/BlueTicket.html:1
-msgid "BlueTicket"
-msgstr "Ticket bleu"
+#. type: Content of: <h3>
+#: src/lessons/recursion/hanoi/Main.html:1
+#: src/lessons/recursion/hanoi/short_desc.html:1
+msgid "Hanoi towers"
+msgstr "Les tours de Hanoï"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/BlueTicket.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/Main.html:2
msgid ""
-"You have a blue lottery ticket, with ints a, b, and c on it. This makes "
-"three pairs, which we'll call ab, bc, and ac. Consider the sum of the "
-"numbers in each pair. If any pair sums to exactly 10, the result is 10. "
-"Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the "
-"result is 5. Otherwise the result is 0."
+"Here comes the super classical exercise on recursion. It's not very "
+"developed here, I'm not sure of what I could add to this lesson. If you have "
+"any idea, please submit them."
msgstr ""
-"Vous avez un ticket de loterie bleu, avec des entiers a, b et c inscrits "
-"dessus. Cela fait trois paires que l'on appellera ab, bc et ac. Considérez "
-"la somme des nombres de chaque paire. Si la somme de l'une des paires vaut "
-"exactement 10, le résultat est 10. Sinon, si la somme ab vaut exactement 10 "
-"de plus que les sommes bc ou ac, le résultat est 5. Sinon, le résultat est 0."
+"Voici l'exercice ultra classique sur la récursivité. Il n'est pas très "
+"développé ici, mais je ne sais pas vraiment quoi rajouter pour prolonger le "
+"plaisir. Si vous avez des idées, n'hésitez pas à nous en faire part."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:1
-msgid "CaughtSpeeding"
-msgstr "Radar de vitesse"
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/short_desc.html:2
+msgid "Here comes the super classical exercise on recursion."
+msgstr "Voici l'exercice ultra classique de récursivité."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/short_desc.html:4
msgid ""
-"You are driving a little too fast, and a police officer stops you. Write "
-"code to compute the result, encoded as an int value: 0=no ticket, 1=small "
-"ticket, 2=big ticket. If speed is 60 or less, the result is 0. If speed is "
-"between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the "
-"result is 2. Unless it is your birthday -- on that day, your speed can be 5 "
-"higher in all cases."
+"This is an application exercise of recursion, that you should master to take "
+"this lesson."
msgstr ""
-"Vous conduisez un peu trop vite et un officier de police vous arrête. "
-"Écrivez le code pour calculer le résultat, encodé sous forme d'un entier : "
-"0=pas d'amende, 1=petite amende, 2=grosse amende. Si votre vitesse est "
-"inférieure à 60, le résultat est 0. Si la vitesse est incluse entre 61 et 80 "
-"(inclus), le résultat est 1. Si la vitesse est 81 ou plus, le résultat est "
-"2. Tout ceci ne vaut que si ce n'est pas votre anniversaire aujourd'hui, car "
-"sinon, votre vitesse peut être supérieure de 5 dans tous les cas."
+"C'est un exercice d'application de la récursivité, que vous devez maîtriser "
+"avant de tenter cette leçon."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/CigarParty.html:1
-msgid "CigarParty"
-msgstr "Cigares de fête"
+#. type: Content of: <h2>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:1
+msgid "Tower of Hanoi"
+msgstr "Les tours de Hanoï"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/CigarParty.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:3
msgid ""
-"When squirrels get together for a party, they like to have cigars. A "
-"squirrel party is successful when the number of cigars is between 40 and 60, "
-"inclusive. Unless it is the weekend, in which case there is no upper bound "
-"on the number of cigars. Return true if the party with the"
+"The Tower of Hanoi or Towers of Hanoi, also called the Tower of Brahma or "
+"Towers of Brahma, is a mathematical game or puzzle. It consists of three "
+"pegs, and a number of disks of different sizes which can slide onto any peg. "
+"The puzzle starts with the disks in a neat stack in ascending order of size "
+"on one peg, the smallest at the top, thus forming a pyramid."
msgstr ""
-"Quand les écureuils font la fête, ils aiment avoir des cigares. Une fête "
-"d'écureuils est réussie si le nombre de cigares est entre 40 et 60 (inclus). "
-"Sauf si c'est le week-end, auquel cas il n'y a pas de limite supérieure au "
-"nombre de cigares. Renvoyez vrai si la fête est réussie. "
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/DateFashion.html:1
-msgid "DateFashion"
-msgstr "Rendez-vous élégant"
+"La tour de Hanoï, ou les tours de Hanoï, aussi appelé la Tour de Brahma ou "
+"les tours de Brahma, est un jeu ou puzzle mathématique. Il consiste en trois "
+"tours, et un nombre de disques de différentes tailles qui peuvent glisser "
+"sur n'importe quelle tour. Le puzzle commence avec tous les disques en une "
+"belle pile selon l'ordre croissant de la taille, le plus petit en haut, sur "
+"une tour, formant donc une pyramide. L'objectif du puzzle est de déplacer la "
+"pile entière jusqu'à une autre tour, en respectant les règles suivantes :"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/DateFashion.html:2
+#: src/lessons/recursion/hanoi/HanoiBoard.html:9
msgid ""
-"You and your date are trying to get a table at a restaurant. The parameter "
-"\"you\" is the stylishness of your clothes, in the range 0..10, and \"date\" "
-"is the stylishness of your date's clothes. The result getting the table is "
-"encoded as an int value with 0=no, 1=maybe, 2=yes. If either of you is very "
-"stylish, 8 or more, then the result is 2 (yes). With the exception that if "
-"either of you has style of 2 or less, then the result is 0 (no). Otherwise "
-"the result is 1 (maybe)."
+"The objective of the puzzle is to move the entire stack to another peg, "
+"obeying the following rules:"
msgstr ""
-"Vous et votre compagne/compagnon essayez d'obtenir une table au restaurant. "
-"Le paramètre \"you\" est l'élégance de vos vêtements, dans l'intervalle "
-"[0,10], et \"date\" est l'élégance des vêtements de votre compagne/"
-"compagnon. Le résultat à obtenir la table est encodé comme une valeur "
-"entière avec 0=non, 1=peut-être et 2=oui. Si l'un de vous deux est très "
-"élégant (8 ou plus) alors le résultat est 2 (oui). Avec l'exception que si "
-"l'un de vous deux a un style de 2 ou moins, alors le résultat est 0 (no). "
-"Sinon, le résultat est 1 (peut-être)."
+"Le but de ce puzzle est de déplacer tous les disques de la pile vers un "
+"autre piquet en respectant les règles suivantes :"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/GreenTicket.html:1
-msgid "GreenTicket"
-msgstr "Ticket vert"
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:11
+msgid "Only one disk may be moved at a time."
+msgstr "Seul un disque peut être bougé à la fois."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/GreenTicket.html:2
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:13
msgid ""
-"You have a green lottery ticket, with ints a, b, and c on it. If the numbers "
-"are all different from each other, the result is 0. If all of the numbers "
-"are the same, the result is 20. If two of the numbers are the same, the "
-"result is 10."
+"Each move consists of taking the upper disk from one of the pegs and sliding "
+"it onto another peg, on top of the other disks that may already be present "
+"on that peg."
msgstr ""
-"Vous avez un ticket de lotterie vert, avec des entiers a, b et c inscrits "
-"dessus. Si les nombres sont tous différents les uns des autres, le résultat "
-"est 0. Si tous les nombres sont identiques, le résultat est 20. Si deux des "
-"nombres sont les mêmes, le résultat est 10."
+"Chaque mouvement consiste à prendre le disque supérieur de l'une des tours "
+"et à le déposer sur une autre tour, au sommet des autres disques qui peuvent "
+"déjà être présents sur cette tour."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/In1To10.html:1
-msgid "In1To10"
-msgstr "De 1 à 10"
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:17
+msgid "No disk may be placed on top of a smaller disk."
+msgstr "Aucun disque ne peut être placé au dessus d'un disque plus petit."
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/In1To10.html:2
+#: src/lessons/recursion/hanoi/HanoiBoard.html:22
msgid ""
-"Given a number n, return true if n is in the range 1..10, inclusive. Unless "
-"\"outsideMode\" is true, in which case return true if the number is less or "
-"equal to 1, or greater or equal to 10."
+"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
+"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
+"[/!]other[!scala]:Int[/!], [!java]int [/!]height[!scala]:Int[/!])</code>"
msgstr ""
-"Soit un nombre n, renvoyez vrai si n est dans l'intervalle [1,10]. Sauf si"
-"\"outsideMode\" est vrai, auquel cas renvoyez vrai si le nombre est plus "
-"petit ou égal à 1 ou bien s'il est plus grand ou égal à 10"
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/InOrderEqual.html:1
-msgid "InOrderEqual"
-msgstr "Dans l'ordre croissant"
+"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
+"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
+"[/!]autre[!scala]:Int[/!], [!java]int [/!]hauteur[!scala]:Int[/!])</code>"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/InOrderEqual.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:25
msgid ""
-"Given three ints, a b c, return true if they are in strict increasing order, "
-"such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the "
-"exception that if \"equalOk\" is true, equality is allowed, such as 5 5 7 or "
-"5 5 5."
+"This method will recursively solve the presented problem. The first "
+"parameter named <code>src</code> is the index of the initial tower, the "
+"second parameter <code>dst</code> is the index of the expected final tower, "
+"the third parameter <code>other</code> is the index of the unused peg while "
+"the fourth parameter <code>height</code> is the height of the tower."
msgstr ""
-"Soit trois entiers, a b c, renvoyez vrai si ils sont dans un ordre croissant "
-"strict, tel que 2 5 11, ou 5 6 7, mais pas 6 5 7 ou 5 5 7. Cependant, avec "
-"l'exception que si \"equalOk\" est vrai, alors l'égalité est permise, comme "
-"5 5 7 ou 5 5 5."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/InOrder.html:1
-msgid "InOrder"
-msgstr "Dans l'ordre"
+"Cette méthode résout récursivement le problème. \n"
+"Le premier paramètre (nommé <code>src</code>) est l'index de la pile "
+"initiale.\n"
+"Le second paramètre (nommé <code>dst</code>) est l'index du piquet vers "
+"lequel la pile dont être déplacée.\n"
+"Le troisième paramètre (nommé <code>other</code>) est l'index du piquet "
+"inutilisé, tandis que le quatrième paramètre (nommé <code>hauteur</code>) "
+"est la taille de la pile à déplacer."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/InOrder.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:31
msgid ""
-"Given three ints, a b c, return true if b is greater than a, and c is "
-"greater than b. However, with the exception that if \"bOk\" is true, b does "
-"not need to be greater than a."
+"A key to solving this puzzle is to recognize that it can be solved by "
+"breaking the problem down into a collection of smaller problems and further "
+"breaking those problems down into even smaller problems until a solution is "
+"reached."
msgstr ""
-"Soit trois entiers, a b c, renvoyez vrai si b est plus grand que a, et si c "
-"est plus grand que b. Cependant, avec l'exception que si \"bOk\" est vrai, b "
-"n'a pas besoin d'être plus grand que a."
+"La clé pour résoudre de puzzle est de reconnaitre qu'il peut être résolu en "
+"cassant le problème en un ensemble de problèmes de plus petites tailles et "
+"de continuer cette réduction de la taille du problème jusqu'à atteindre une "
+"solution."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/LastDigit2.html:1
-msgid "LastDigit 2"
-msgstr "L'autre dernier chiffre"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:35
+msgid "I don't get it, please give me some extra indications"
+msgstr "Je suis perdu, je voudrais plus d'indications"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/LastDigit2.html:2
-msgid ""
-"Given three ints, a b c, return true if two or more of them have the same "
-"rightmost digit. The ints are non-negative. Note: the % \"mod\" operator "
-"computes the remainder, e.g. 17 % 10 is 7."
+#. type: Content of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:36
+msgid "Here is the pseudo-code of the solution:"
+msgstr "Voici le pseudo-code de la solution :"
+
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:38
+msgid "label the pegs A, B, C (these labels may move at different steps)"
msgstr ""
-"Soit trois entiers, a b c, renvoyez vrai si deux ou plus d'entre eux ont le "
-"même chiffre le plus à droite. Les entiers sont positifs. Note: l'opérateur "
-"% \"mod\" calcule le reste, i.e. 17 % 10 vaut 7."
+"Etiquetons les tours A, B, C ( ces étiquettes peuvent changer à différentes "
+"étapes )"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/LessBy10.html:1
-msgid "LessBy10"
-msgstr "Plus petit par 10"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:39
+msgid "let n be the total number of discs (the height of the initial tower)"
+msgstr "Soit n le nombre total de disques ( la hauteur de la tour initiale )"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/LessBy10.html:2
-msgid ""
-"Given three ints, a b c, return true if one of them is 10 or more less than "
-"one of the others."
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:40
+msgid "number the discs from 1 (smallest, topmost) to n (largest, bottommost)"
msgstr ""
-"Soit trois entiers, a b c, renvoyez vrai si l'un d'entre eux est plus petit "
-"de 10 ou plus que l'un des autres."
+"Numérotez les disques de 1 ( le plus petit, le plus en haut ) à n ( le plus "
+"large, le plus en bas )"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/Main.html:1
-msgid "Boolean (even more) fun"
-msgstr "Encore des jeux booléens"
+#. type: Content of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:43
+msgid "To move n discs from peg A to peg C:"
+msgstr "Pour déplacer n disques du poteau A au poteau C : "
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool2/Main.html:3
-msgid ""
-"A very good introduction to this type is available here: http://javabat.com/"
-"doc/ifboolean.html."
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:45
+msgid "move n−1 discs from A to B. This leaves disc number n alone on peg A"
msgstr ""
-"Une très bonne introduction à ce type est disponible ici : http://javabat."
-"com/doc/ifboolean.html."
+"déplacer n-1 disques de A vers B. Cela laisse le disque numéro n seul sur le "
+"poteau A"
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/MaxMod5.html:1
-msgid "MaxMod5"
-msgstr "Maximum Mod 5"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:46
+msgid "move disc number n from A to C"
+msgstr "déplacer le disque numéro n de A vers C"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/MaxMod5.html:2
-msgid ""
-"Given two int values, return whichever value is larger. However if the two "
-"values have the same remainder when divided by 5, then the return the "
-"smaller value. However, in all cases, if the two values are the same, return "
-"0. Note: the % \"mod\" operator computes the remainder, e.g. 7 % 5 is 2."
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:47
+msgid "move n−1 discs from B to C so they sit on disc number n"
msgstr ""
-"Soit deux valeurs entières, renvoyez la plus grande des deux. Cependant, si "
-"les deux valeurs ont le même reste quand elles sont divisées par 5, alors "
-"renvoyez la plus petite des deux. Cependant, dans tous les cas, si les deux "
-"valeurs sont égales, renvoyez 0. Note: l'opérateur % \"mod\" calcule le "
-"reste, i.e. 7 % 5 vaut 2."
+"deplacer n-1 disques de B vers C afin qu'ils reposent sur le disque numéro n"
#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/NearTen.html:1
-msgid "NearTen"
-msgstr "Près de dix"
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:1
+msgid "HanoiWorld"
+msgstr "Le monde des tours de Hanoï"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/NearTen.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:4
msgid ""
-"Given a non-negative number \"num\", return true if num is within 2 of a "
-"multiple of 10. Note: (a % b) is the remainder of dividing a by b, so (7 % "
-"5) is 2."
+"This world implements the ultra-classical Hanoi problem. You are asked to "
+"move the disk pile from the stick where they are to the target stick (given "
+"as second parameter in the world's name -- number 1 for the default world). "
+"There is some extra constraint: you can only move one disk at a time, and "
+"you cannot move a big disk over a smaller one."
msgstr ""
-"Soit un entier positif \"num\", renvoyez vrai si num est à moins de 2 d'un "
-"multiple de 10. Note: ( a % b ) est le reste de la division de a par b, donc "
-"(7 % 5) vaut 2."
+"Ce monde implémente le problème ultra classique de Hanoï. Il vous est "
+"demandé de déplacer une pile de disques du piquet où ils se trouvent vers un "
+"piquet cible (passé comme second paramètre dans le nom du monde -- numéro 1 "
+"pour le monde par défaut). Il y a quelques contraintes supplémentaires: il "
+"est interdit de déplacer plus d'un disque à la fois, ainsi que de placer un "
+"disque plus grand sur un disque plus petit."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/RedTicket.html:1
-msgid "RedTicket"
-msgstr "Ticket rouge"
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:11
+msgid "Only 4 functions are provided:"
+msgstr "Seules quatre fonctions sont fournies :"
+
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:13
+#, no-wrap
+msgid "[!java]void [/!]move([!java]int [/!]src, [!java]int [/!]dst)"
+msgstr "[!java]void [/!]deplace([!java]int [/!]src, [!java]int [/!]dst)"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/RedTicket.html:2
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:15
msgid ""
-"You have a red lottery ticket showing ints a, b, and c, each of which is 0, "
-"1, or 2. If they are all the value 2, the result is 10. Otherwise if they "
-"are all the same, the result is 5. Otherwise so long as both b and c are "
-"different from a, the result is 1. Otherwise the result is 0."
+"Moves one disk from the stick <code>src</code> onto the stick <code>dst</"
+"code>. If you try to do an invalid move (like laying a disk over a smaller "
+"one), an IllegalArgumentException is thrown."
msgstr ""
-"Vous avez un ticket de lotterie rouge comportant trois entiers a, b et c. "
-"Chacun d'entre eux est 0, 1, ou 2. Si ils sont tous comme valeur 2, le "
-"résultat vaut 10. Sinon, si ils sont égaux, le résultat vaut 5. Sinon, tant "
-"que b et c sont différents de a, le résultat vaut 1. Sinon, le résultat est "
-"0."
+"Elle déplace un disque d'un piquet <code>src</code> vers le piquet "
+"<code>dst</code>. Si vous demandez un déplacement invalide (comme le "
+"placement d'un disque sur un disque plus petit), une exception "
+"IllegalArgumentException est levée."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/ShareDigit.html:1
-msgid "ShareDigit"
-msgstr "Chiffre partagé"
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:19
+#, no-wrap
+msgid "[!java]int [/!]getSlotSize([!java]int [/!]slot)[!scala]:Int[/!]"
+msgstr "[!java]int [/!]getTaillePiquet([!java]int [/!]slot)[!scala]:Int[/!]"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/ShareDigit.html:2
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:20
msgid ""
-"Given two ints, each in the range 10..99, return true if there is a digit "
-"that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e."
-"g. n/10, gives the left digit while the % \"mod\" n%10 gives the right "
-"digit.)"
+"Returns the amount of disks placed on the specified slot. This is mainly "
+"used to initialize the recursion and set the amount of recursive call to "
+"execute."
msgstr ""
-"Soit deux entiers, chacun étant dans l'intervalle [10,99], renvoyez vrai si "
-"il y a un chiffre qui apparait dans les deux nombres, comme 2 dans 12 et 23. "
-"(Note: division, i.e. n/10, renvoie le chiffre à gauche tant que le % \"mod"
-"\" n%10 renvoye le bon chiffre.)"
+"Retourne le nombre de disques placés sur un piquet donné. Cette fonction est "
+"surtout utile pour initialiser la récursion et déterminer le nombre d'appels "
+"récursifs à réaliser."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/SortaSum.html:1
-msgid "SortaSum"
-msgstr "Sommes d'entiers"
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:23
+#, no-wrap
+msgid "[!java]int [/!]getRadius([!java]int [/!]slot)[!scala]:Int[/!]"
+msgstr "[!java]int [/!]getRayon([!java]int [/!]slot)[!scala]:Int[/!]"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/SortaSum.html:2
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:24
+msgid "Returns the radius of the top-most disk of the specified slot."
+msgstr "Retourne le rayon du disque placé en haut du piquet spécifié."
+
+#. type: Content of: <h3>
+#: src/lessons/maze/Main.html:1 src/lessons/maze/short_desc.html:1
+msgid "Labyrinths"
+msgstr "Labyrinthes"
+
+#. type: Content of: <p>
+#: src/lessons/maze/Main.html:3 src/lessons/maze/short_desc.html:3
msgid ""
-"Given 2 ints, a and b, return their sum. However, sums in the range 10..19 "
-"inclusive, are forbidden, so in that case just return 20."
+"This lesson proposes several exercises about labyrinths in the buggle world."
msgstr ""
-"Soit deux entiers, a et b, renvoyez leur somme. Cependant, les sommes entre "
-"10 et 19 inclus sont interdites, dans ce cas, renvoyez 20."
+"Cette leçon propose divers exercices à propos des labyrinthes dans le monde "
+"des buggles."
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:1
-msgid "SquirrelPlay"
-msgstr "Jeu de l'écureuil"
+#. type: Content of: <h2>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:1
+msgid "The crazy mouse"
+msgstr "La souris folle"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:3
msgid ""
-"The squirrels in Palo Alto spend most of the day playing. In particular, "
-"they play if the temperature is between 60 and 90 (inclusive). Unless it is "
-"summer, then the upper limit is 100 instead of 90. Given an int temperature "
-"and a boolean isSummer, return true if the squirrels play and false "
-"otherwise."
+"The day of your buggle starts badly. Out of luck, it got trapped into a "
+"maze. Help it finding its path out of there."
msgstr ""
-"Les écureuils dans Palo Alto passent la majorité de leurs journées à jouer. "
-"En particulier, ils jouent si la température est entre 60 et 90 ( inclus ). "
-"A moins que ce soit l'été, alors la limite supérieure est de 100 au lieu de "
-"90.Soit une température entière et un booléen isSummer.\n"
-"Renvoyez vrai si les écureuils jouent et faux sinon."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TeaParty.html:1
-msgid "TeaParty"
-msgstr "Goûter"
+"La journée de votre buggle commence mal. Elle n'a pas eu de chance. Elle est "
+"tombée dans un piège. Aidez-la à sortir de ce labyrinthe."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TeaParty.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:8
msgid ""
-"We are having a party with amounts of tea and candy. Return the int outcome "
-"of the party encoded as 0=bad, 1=good, or 2=great. A party is good (1) if "
-"both tea and candy are at least 5. However, if either tea or candy is at "
-"least double the amount of the other one, the party is great (2). However, "
-"in all cases, if either tea or candy is less than 5, the party is always bad "
-"(0)."
+"The exit is represented by a baggle and you need to pick this baggle in "
+"order to exit the maze."
msgstr ""
-"Nous avons un goûter avec quantité de thé et de bonbons. Renvoyez l'entier "
-"'outcome' du goûter encodé comme 0=mauvais, 1=bien, ou 2=excellent. Un "
-"goûter est bien (1) si le thé et les bonbons sont à 5 au moins. Cependant, "
-"si soit le thé soit les bonbons est à au moins le double de la quantité de "
-"l'autre, le goûter est excellent (2). Cependant, dans tous les cas, si soit "
-"le thé soit les bonbons sont à moins de 5, le goûter est toujours mauvais "
-"(0)."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TeenSum.html:1
-msgid "TeenSum"
-msgstr "Somme d'ados"
+"La sortie est représentée par un baggle et vous devez le ramasser afin de "
+"vous échapper du labyrinthe."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TeenSum.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:13
msgid ""
-"Given 2 ints, a and b, return their sum. However, \"teen\" values in the "
-"range 13..19 inclusive, are extra lucky. So if either value is a teen, just "
-"return 19."
+"Since the maze is so small, we can write the dumbest possible algorithm to "
+"do so. It relies on randomness and proves quite inefficient."
msgstr ""
-"Étant donné deux nombres entiers (a et b), renvoyez leur somme. Cependant, "
-"les valeurs ados (dans l'intervale [13;19]) sont particulièrement "
-"chanceuses. Donc, si l'un des nombres est ado, renvoyez simplement 19."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TwoAsOne.html:1
-msgid "TwoAsOne"
-msgstr "Deux pour un"
+"Nous allons profiter du fait que le labyrinthe ne soit pas trop grand pour "
+"écrire l'algorithme le plus bête possible. Cet algorithme repose sur le "
+"hasard et est très inefficace."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TwoAsOne.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:18
msgid ""
-"Given three ints, a b c, return true if it is possible to add two of the "
-"ints to get the third."
+"While the buggle didn't find the path to the escape, it must proceed the "
+"following way: pick a random integer between 0 and 2 by using the provided "
+"<code>random3()</code> method and make one of the following actions: moving "
+"forward if possible, turn left or turn right."
msgstr ""
-"Soit trois entiers, a b c, renvoyez vrai si il est possible d'en additionner "
-"deux d'entre eux pour obtenir le troisième."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:1
-msgid "WithoutDoubles"
-msgstr "Sans double"
+"Tant que notre buggle n'a pas trouvé la sortie, elle doit progresser de la "
+"façon suivante : choisir un entier entre 0 et 2 au hasard à l'aide de "
+"la méthode <code>random3()</code> fournie et prendre l'une des décisions "
+"suivantes selon l'entier choisi : avancer si elle le peut, tourner à "
+"droite ou bien tourner à gauche."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:24
msgid ""
-"Return the sum of two 6-sided dice rolls, each in the range 1..6. However, "
-"if noDoubles is true, if the two dice show the same value, increment one die "
-"to the next value, wrapping around to 1 if its value was 6."
+"You don't believe that it could work? Well, give it a try, you will see... "
+"Don't forget to pick up the baggle once you've reached it."
msgstr ""
-"Renvoyez la somme du jet de deux dés à six faces. Cependant, si noDoubles "
-"est vrai et que les deux dés ont la même valeur, incrémentez l'un des dés à "
-"la valeur suivante, en le mettant à 1 si sa valeur était 6."
+"Vous ne croyez pas qu'une méthode aussi stupide puisse fonctionner ? Et "
+"bien, essayez, vous verrez bien.\n"
+"N'oubliez pas de ramasser le biscuit quand vous l'avez trouvé."
-#. type: Content of: <h1>
-#: src/plm/universe/bat/BatWorld.html:1
-msgid "BatWorld"
-msgstr "BatWorld"
+#. type: Content of: <h2>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:1
+msgid "Following the walls"
+msgstr "Longer les murs"
#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:3
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:3
msgid ""
-"This world is a simplistic testing environment largely inspired from the "
-"http://codingbat.com invented by Nick Parlente."
+"This time, the maze is a bit more complicated. Random won't be enough, we "
+"ough to be smart!"
msgstr ""
-"Ce monde contient un environnement simpliste de tests largement inspiré de "
-"http://codingbat.com inventé par Nick Parlente."
+"Cette fois-ci le labyrinthe est beaucoup plus compliqué. Le hasard ne sera "
+"pas suffisant, il va falloir être intelligent !"
#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:6
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:6
msgid ""
-"The typical exercises are very short ones, aiming at improving the tactical "
-"programming abilities of the students. That is to say that you will be "
-"presented a quite long list of very little exercises about rather simple "
-"things. The idea is to train you on these issues until they become automatic "
-"to you."
+"The good news is that this maze is simpler that it seems at the first "
+"glance: every wall are connected to each other. To get out of this kind of "
+"maze, the buggle only have to follow a wall (the one on its left or the one "
+"on its right, it doesn't matter). While keeping a paw on the wall, the "
+"buggle must move forward until it finds the maze exit and this biscuit it "
+"loves so much."
msgstr ""
-"Les exercices classiques sont très courts, et visent à améliorer les "
-"abilités de stratégie de programmation des étudiants. C'est pour vous "
-"prévenir que vous allez faire face à une très longue liste de très petits "
-"exercices à propos de choses très simples. L'idée est de vous entrainer sur "
-"ces problèmes jusqu'à ce que cela devienne automatique."
+"Heureusement, ce labyrinthe est plus simple qu'il n'y paraît: tous les murs "
+"sont connectés les uns aux autres. Pour sortir de ce genre de labyrinthe, il "
+"suffit à votre buggle de longer un mur (celui à sa droite, ou celui à sa "
+"gauche: c'est sans importance). Tout en gardant sa patte posée sur ce mur, "
+"votre buggle doit avancer jusqu'à ce qu'elle trouve la sortie du labyrinthe "
+"et ce biscuit qu'il apprécie tant."
#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:12
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:13
msgid ""
-"In contrary to the other worlds, the BatWorld does not provide any fancy "
-"abstraction nor visualization. You have to fill a function, which gets "
-"called for a bunch of parameter sets, and that's it."
+"This works here because there is no island of isolated walls, so our buggle "
+"cannot loop around for ever without encountering its baggle."
msgstr ""
-"Contrairement aux autres mondes, le BatWorld ne fournit pas ni de belle "
-"abstractions ni de belles visualisaitons. Vous aurez à remplier une "
-"fonction, qui sera appelée avec un tas d'ensembles de différentes "
-"paramètres, et c'est tout."
+"Cet algorithme fonctionne ici car il n'y a pas d'île de murs isolés, ce qui "
+"fait que la buggle ne peut pas boucler autour des murs sans rencontrer le "
+"biscuit qu'elle cherche."
-#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:16
+#. type: Content of: outside any tag (error?)
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:17
msgid ""
-"For more information, you should refer to the CodingBat.com documentation, "
-"which contains for example a very useful documentation on boolean operators: "
-"http://codingbat.com/doc/ifboolean.html"
+"The goal of this exercise is to write an algorithm allowing the buggle to "
+"get out of this maze."
msgstr ""
-"Pour plus d'informations, vous devriez consulter la documentation de "
-"CodingBat.com qui contient par exemple une documentation très utile sur les "
-"opérateurs booléens : http://codingbat.com/doc/ifboolean.html"
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/Main.html:1
-msgid "String fun"
-msgstr "String fun"
+"<a name=\"Objectifs\"> L'objectif de cet exercice est d'écrire un algorithme "
+"permettant à votre buggle de sortir du labyrinthe."
#. type: Content of: <p>
-#: src/lessons/bat/string1/Main.html:3
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:20
msgid ""
-"Strings are the simplest of the complex data types :) They provide several "
-"operations, such as getting the length of the string, or a substring of it.."
+"As said earlier, it does not matter whether you decide to follow the left "
+"wall or the right one. Simply, the demo follows the left one, so you should "
+"do the same in your solution to ease the comparison of your solution and the "
+"demo."
msgstr ""
-"Les chaînes de caractères (\"String\") sont les plus simples des types de "
-"données complexes :) Elles fournissent différentes opérations, comme obtenir "
-"la longueur de la chaîne ou une sous-chaîne..."
+"Comme dit précédement, le mur choisi n'a pas d'importance. Simplement, la "
+"démo suit le mur gauche, et il serait donc avisé d'en faire de même pour "
+"simplifier la comparaison de votre solution et de la démo."
#. type: Content of: <p>
-#: src/lessons/bat/string1/Main.html:7
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:25
msgid ""
-"A very good introduction to this type is available here: http://javabat.com/"
-"doc/string.html."
+"Write a method <code>keepHandOnSideWall()</code> which lets the buggle move "
+"one step forward while keeping the paw on the wall of the selected side. You "
+"must ensure that the buggle always keep the paw on the wall, but also that "
+"it won't crash into a wall. You can check the tip for more info on this, but "
+"only do so if you're stuck. Try to do it without the tip first."
msgstr ""
-"Une très bonne introduction à ce type est disponible ici : http://javabat."
-"com/doc/string.html."
-
-#. type: Content of: <h3>
-#: src/lessons/bat/string1/short_desc.html:1
-msgid "Small exercises about strings"
-msgstr "Petits exercices sur les chaînes"
+"Écrivez une méthode <code>keepHandOnSideWall()</code> qui fait avancer votre "
+"buggle d'une case tout en gardant la patte sur le mur du côté choisi. Vous "
+"devez vous assurer que votre buggle garde toujours la patte sur le mur et "
+"également qu'elle ne risque pas de percuter un mur. Vous pouvez regarder "
+"l'indice (hint) si vous êtes coincé, mais vous devriez d'abord essayer de le "
+"faire par vous-même."
#. type: Content of: <p>
-#: src/lessons/bat/string1/short_desc.html:3
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:32
msgid ""
-"These are some training exercises around strings. But unfortunately, its "
-"integration within PLM is still ongoing."
+"Then, write the whole algorithm to traverse the maze step by step (using "
+"<code>keepHandOnSideWall()</code>) until it finds the biscuit and the exit. "
+"Don't forget to pick the baggle up once you've found it."
msgstr ""
-"Il s'agit d'exercices d'entraînement au sujet des chaînes de caractères. "
-"Mais malheureusement, leur intégration à PLM est encore en cours."
-
-#. type: Content of: <p>
-#: src/lessons/bat/string1/short_desc.html:6
-msgid "Please be patient with us."
-msgstr "Merci de votre patience."
+"Enfin, écrivez l'algorithme complet qui parcourt le labyrinthe pas à pas "
+"jusqu'à trouver le biscuit et la sortie. N'oubliez pas de prendre le baggle."
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/AltPairs.html:1
-msgid "AltPairs"
-msgstr "Sans les paires"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:37
+msgid "I'm lost, please give me some extra indications"
+msgstr "Je suis perdu, je voudrais plus d'indications"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/AltPairs.html:2
+#. type: Content of: <div><p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:38
msgid ""
-"Given a string, return a string made of the chars at indexes 0,1, 4,5, "
-"8,9 ... so \"kittens\" yields \"kien\"."
+"When your buggle has a wall on the left, there is three situations to "
+"consider, depending on the surrounding walls. The following table depicts "
+"each initial situation, and where you should let your buggle end after one "
+"step."
msgstr ""
-"Soit une chaîne de caractères, renvoyez la chaîne composée des caractères "
-"aux index 0,1,4,5,8,9 ... par exemple \"kittens\" devient \"kien\"."
+"Quand votre buggle a un mur à sa gauche, il faut considérer trois situations "
+"possibles, qui dépendent des murs alentours. Le tableau suivant représente "
+"graphiquement chaque situation initiale, et où vous devez placer votre "
+"buggle à la fin de l'étape."
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/FrontTimes.html:1
-msgid "FrontTimes"
-msgstr "Multiplication de début"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:45
+msgid "Case 1"
+msgstr "Cas 1"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/FrontTimes.html:2
-msgid ""
-"Given a string and a non-negative int n, we'll say that the front of the "
-"string is the first 3 chars, or whatever is there if the string is less than "
-"length 3. Return n copies of the front;"
-msgstr ""
-"Soit une chaîne de caractère et un entier n.\n"
-"On définit le début d'une chaîne de caractère comme les trois premiers "
-"caractères, ou tout ce qu'il y a si la chaîne a une longueur de moins de 3.\n"
-"Renvoyez n copies du début de la chaîne."
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/Last2.html:1
-msgid "Last2"
-msgstr "Deux derniers"
-
-#. type: Content of: <p>
-#: src/lessons/bat/string1/Last2.html:3
-msgid ""
-"Given a string, return the amount of times that the two last letters appear "
-"as a substring of the string. So \"hixxxhi\" yields 1 (we won't count the "
-"end substring) while \"aaaNaa\" yields 2 (substrings may overlap)."
-msgstr ""
-"Étant donné une chaîne de caractères, retournez le nombre de fois que les "
-"deux\n"
-"dernières lettres apparaissent. Par exemple, \"hixxxhi\" renvoie 1 (on ne "
-"compte pas la dernière sous-chaîne) tandis que \"aaaNaa\" renvoie 2 (les "
-"occurences peuvent se chevaucher partiellement)."
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:46
+msgid "Case 2"
+msgstr "Cas 2"
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringBits.html:1
-msgid "StringBits"
-msgstr "Éclats de chaîne"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:47
+msgid "Case 3"
+msgstr "Cas 3"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringBits.html:2
-msgid ""
-"Given a string, return a new string made of every other char starting with "
-"the first, so \"Hello\" yields \"Hlo\"."
-msgstr ""
-"Étant donné une chaîne de caractères, retournez une nouvelle chaîne formée "
-"en\n"
-"prenant un caractère sur deux dans le paramètre, en commençant avec le "
-"premier\n"
-"caractère. Ainsi, \"Bonjour\" donne \"Bnor\"."
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:49
+msgid "Initial situation"
+msgstr "Situation initiale"
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringMatch.html:1
-msgid "StringMatch"
-msgstr "Comparaison de chaînes"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:54
+msgid "Where is the next step"
+msgstr "Étape suivante"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringMatch.html:2
+#. type: Content of: <div><p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:60
msgid ""
-"Given 2 strings, a and b, return the number of the positions where they "
-"contain the same length 2 substring. So \"xxcaazz\" and \"xxbaaz\" yields 3, "
-"since the \"xx\", \"aa\", and \"az\" substrings appear in the same place in "
-"both strings."
+"If you do a <code>right()</code> in any case at the end of your function, "
+"it's possible to write it in 3 lines with a <code>while</code> loop."
msgstr ""
-"Soit deux chaînes de caractères a et b.\n"
-"Renvoyez le nombre de position où elles contiennent la même sous-chaine de "
-"longueur 2.\n"
-"Ainsi, \"xxcaazz\" et \"xxbaaz\" renvoient 3, puisque les sous-chaînes \"xx"
-"\", \"aa\", et \"az\" apparaissent dans les mêmes emplacement dans les deux "
-"chaînes."
+"Si vous faites un <code>right()</code> dans tous les cas à la fin de votre "
+"fonction, il est possible de l'écrire en trois lignes avec une boucle "
+"<code>while</code>."
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringSplosion.html:1
-msgid "StringSplosion"
-msgstr "Explosion de chaîne"
+#. type: Content of: <h2>
+#: src/lessons/maze/pledge/PledgeMaze.html:1
+msgid "Pledge algorithm"
+msgstr "Algorithme de Pledge"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringSplosion.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:3
msgid ""
-"Given a non-empty string like \"Code\" return a string like \"CCoCodCode\"."
+"Once again, you thought that your algorithm were good enough to escape the "
+"maze, and once again, you buggle is now in a maze where your previous "
+"algorithm fails. Just give it a try: copy/paste your code and hit the \"Run"
+"\" button and see your creation fail. The trap is shaped like an upper case "
+"\"G\". The buggle enters the trap and follows the inner border. At some "
+"point, it finds the north direction free, run into that direction, and falls "
+"again in the trap."
msgstr ""
-"Soit une chaîne de caractères non vide comme \"Code\".\n"
-"Renvoyez une chaîne de caractères comme \"CCoCodCode\"."
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringTimes.html:1
-msgid "StringTimes"
-msgstr "Multiplication de chaînes"
+"Une fois de plus, vous pensiez que votre algorithme vous permettait de vous "
+"échapper des labyrinthes, et une fois de plus, votre buggle est prise dans "
+"un labyrinthe mettant votre algorithme en défaut. Essayez de copier votre "
+"code et de l'exécuter pour voir : votre création précédente échoue "
+"lamentablement. Le piège a la forme d'un «G» majuscule : la buggle entre "
+"dans le piège, suit le bord interne. Au bout d'un moment, la direction nord "
+"est libre et votre buggle se met donc à courir dans cette direction. Pour "
+"retomber dans le piège..."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringTimes.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:13
msgid ""
-"Given a string and a non-negative int n, return a larger string that is n "
-"copies of the original string."
+"The Pledge's algorithm (named after Jon Pledge of Exeter) can solve this "
+"maze."
msgstr ""
-"Soit une chaîne et un entier n positif.\n"
-"Renvoyez une chaîne plus grande qui consiste en n copies de la chaîne "
-"originale."
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringX.html:1
-msgid "StringX"
-msgstr "Chaîne X"
+"L'algorithme de Pledge (nommé d'après Jon Pledge d'Exeter) peut sortir de ce "
+"labyrinthe."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringX.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:16
msgid ""
-"Given a string, return a version where all the \"x\" have been removed. "
-"Except an \"x\" at the very start or end should not be removed."
+"This algorithm is a modification of the previous one thought to avoid "
+"obstacles. It randomly picks a heading and let the buggle move in that "
+"direction. When it encounters an obstacle, a paw (for example the left one) "
+"is kept on the wall following the obstacle while counting the turns. When "
+"the buggle is back to its original heading and when the sum of the turns is "
+"0, the buggle leaves the obstacle and continues keeping its original heading."
msgstr ""
-"Soit une chaîne de caractère, renvoyez une version où tous les \"x\" ont été "
-"supprimés.\n"
-"Seuls les \"x\" au tout début ou en toute fin ne doivent pas être supprimés."
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringYak.html:1
-msgid "StringYak"
-msgstr "String Yak"
+"Cet algorithme est une version modifiée l'algorithme précédent conçu pour "
+"éviter les obstacles. Il nécessite de choisir de manière arbitraire une "
+"direction vers laquelle la buggle se dirigera. Quand un obstacle est "
+"rencontré, une patte (disons la patte de gauche) est gardée le long des "
+"obstacles tandis que les virages sont comptabilisés. Quand la buggle est "
+"face à nouveau à la direction originale, et que la somme des virages est "
+"égale à 0, la buggle quitte l'obstacle et continue de se déplacer dans sa "
+"direction d'origine."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringYak.html:2
+# type: Content of: <p><p>
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:24
msgid ""
-"Suppose the string \"yak\" is unlucky. Given a string, return a version "
-"where all the \"yak\" are removed, but the \"a\" can be any char. The \"yak"
-"\" strings will not overlap."
+"Note that the use of \"total turning\" rather than just the \"current "
+"direction\" allows the algorithm to avoid G-shapped traps. If one proceeds "
+"left into the trap, one gets turned around a full 360 degrees by the walls. "
+"As we said before, the naive \"current direction\" algorithm gets into a "
+"limit cycle as it leaves the lower rightmost wall heading left and runs into "
+"the curved section on the left again."
msgstr ""
-"La chaîne \"yak\" n'a pas de chance. Soit une chaîne de caractères, renvoyez "
-"une version où tous les \"yak\" sont supprimées (quel que soit le caractère "
-"à la place du 'a'). Les différentes chaînes \"yak\" ne se chevauchent pas."
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/array/basics/Array1.html:1
-msgid "[!java|scala]Arrays[/!][!python]Lists[/!] and Knotting"
-msgstr "[!java|scala]Tableaux[/!][!python]Listes[/!] et tricot"
+"Notez que l'utilisation de la \"somme des virages\" à la place de la "
+"\"direction courante\" permet à l'algorithme d'éviter les pièges tel que les "
+"formes en \"G\" majuscule. Si l'on rentre par la gauche dans le piège, on "
+"tourne de 360 degrés autour des murs. Un algorithme qui se contenterait "
+"naivement de se retrouver dans la même direction qu'à l'origine rentre dans "
+"un cycle infini puisque qu'il quite le mur le plus à droite en étant dirigé "
+"vers la gauche, et entre à nouveau dans la section incurvée."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/basics/Array1.html:3
+# type: Content of: <p><p>
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:31
msgid ""
-"The goal of this exercise is to reproduce the pattern of the first row in "
-"the other rows with a shift of one cell (see the Objective tab for details). "
-"The biggest difference between this exercise and the others we had on "
-"patterns is that you have to read the pattern (on first row) before "
-"reproducing it. You cannot do otherwise because the same code will be "
-"executed on three different worlds, each of them having a specific pattern."
+"The Pledge's algorithm does not leave the rightmost wall due to the total "
+"turning not being zero at that point. It follows the wall all the way "
+"around, finally leaving it heading left on the bottom outside"
msgstr ""
-"L'objectif de cet exercice est de reproduire le motif de la première colonne "
-"en le décalant d'une case (voir l'onglet «Objectif» pour plus de détails). "
-"La grande différence entre cet exercice et les précédents sur les motifs, "
-"c'est qu'il faut maintenant lire (sur la première colonne) le motif "
-"souhaité, puis le reproduire ensuite. Il est impossible de faire autrement "
-"car votre programme sera exécuté par trois buggles dans trois mondes "
-"différents, chacune ayant un motif propre à reproduire."
+"L'algorithme de Pledge ne quitte pas le mur en bas à droite puisque la somme "
+"des virages ne vaut pas zéro à ce moment. Il continue de suivre le mur "
+"jusqu'à avoir complétement fait le tour, et le quitte en regardant à gauche "
+"une fois parvenu sous l'obstacle."
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:11
+#: src/lessons/maze/pledge/PledgeMaze.html:38
msgid ""
-"One solution is to read the next cell, and go copy it in position before "
-"coming back to read the second cell. But since it is forbidden to use the "
-"methods to teleport the buggle to a specific position (<code>setPos()</code> "
-"and similar), this approach will be a pain to implement."
+"<a name=\"Objective\"/>You now have to modify your solution to implement the "
+"Pledge algorithm to escape this maze."
msgstr ""
-"Une possibilité est de lire la prochaine case, puis d'aller la recopier en "
-"position, avant de revenir lire la case suivante, etc. Mais comme vous "
-"n'avez pas le droit d'utiliser les méthodes permettant de téléporter la "
-"buggle à une case particulière (<code>setPos()</code> et autres), cette "
-"façon de faire va être très pénible à mettre en place."
+"<a name=\"Objectifs\"> L'objectif de cet exercice est d'écrire une "
+"implémentation de l'algorithme de Pledge qui permettra à votre buggle de "
+"sortir du labyrinthe."
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:16
+#: src/lessons/maze/pledge/PledgeMaze.html:41
msgid ""
-"The simplest is to store the sequence of colors that constitute the whole "
-"pattern in an [!java|scala]<b>array</b>[/!][!python]<b>list</b>[/!]. But "
-"before we can do so, we should learn a bit what [!java|scala]arrays[/!][!"
-"python]lists[/!] are."
+"Change your <code>keepHandOnSideWall()</code> method to count the amount of "
+"turns done by the buggle (+1 when it turns left, and -1 when it turns "
+"right). This counting may require the addition of an <code>angleSum</code> "
+"integer value in your program."
msgstr ""
-"Le plus simple est de stocker l'enchainement de couleurs constituant le "
-"motif dans \n"
-"[!java|scala]un <b>tableau</b>[/!][!python]une <b>liste</b>[/!]. \n"
-"Mais avant de pouvoir faire cela, nous devons en apprendre un peu plus sur "
-"les [!java|scala]tableau[/!][!python]listes[/!]."
-
-#. type: Content of: <h2>
-#: src/lessons/welcome/array/basics/Array1.html:20
-msgid "[!java|scala]Arrays[/!][!python]List[/!]"
-msgstr "[!java|scala]Les tableaux[/!][!python]Les listes[/!]"
+"Reprenez la méthode <code>keepHandOnSideWall()</code> de l'exercice "
+"précédent. Modifiez cette méthode pour compter les virages pris par votre "
+"buggle (+1 lorsqu'il a tourné à gauche par rapport à son origine, -1 "
+"lorsqu'il a tourné à droite). Pour comptabiliser vous aurez besoin d'ajouter "
+"une variable <code>sommeAngle</code> de type entière à votre programme."
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:22
+#: src/lessons/maze/pledge/PledgeMaze.html:46
msgid ""
-"[!java|scala]An array[/!][!python]A list[/!] is an ordered sequence of "
-"variables that go together. It is somehow similar to a shelve where each "
-"level can store a separate value. Each variable of the sequence is "
-"identified by its position, and can store a specific value. [!java|scala]All "
-"cells of the array must store values of the same type because arrays are "
-"homogeneous in [!thelang]. It is possible to trick this restriction by using "
-"the datatype <code>[!java]Object[/!][!scala]Any[/!]</code> that can contain "
-"[!java]almost[/!] any other datatype. [!java]Primitive types such as the "
-"ones we saw so far (int, boolean, double, char, etc) cannot be stored in an "
-"Object variable, but their objectified counter-part (Integer, Boolean, "
-"Double, Char, Boolean, etc) can.[/!] It is however a good practice to make "
-"the type of an array as specific as possible, i.e., if you plan to store "
-"some integers in your array, make it an array of integers, not of [!"
-"java]Object[/!][!scala]Any[/!].[/!] [!python]Lists can even mix values of "
-"differing types, such as integer values in some cells and colors in other "
-"cells.[/!]"
+"Write a boolean method <code>isDirectionFree(dir)</code> indicating if the "
+"provided direction is free, ie, if you can move in that direction (Note that "
+"the demo uses the NORTH direction for that). You can retrieve the current "
+"direction of the buggle using the method <code>getDirection()</code>. You "
+"can change your direction (without moving) using <code>setDirection(dir)</"
+"code>. Don't forget to store the previous direction of your buggle (in a "
+"dedicated variable) before checking if your favorite direction is free in "
+"order to restore your state afterward."
msgstr ""
-"[!java|scala]Un tableau[/!][!python]Une liste[/!] est une séquence ordonnée "
-"de variables qui marchent ensemble. \n"
-"C'est un peu similaire à une commode dont les différents tiroirs peuvent "
-"stocker des valeurs différentes. \n"
-"Chaque variable de la séquence est identifiée par sa position et peut "
-"stocker une valeur spécifique.\n"
-"[!java|scala]Toutes les cellules d'un tableau doivent stocker des valeurs du "
-"même type de données parce que les tableaux sont homogènes en [!thelang]. \n"
-"Il est cependant possible de contourner cette restriction en utilisant le "
-"type de données <code>[!java]Object[/!][!scala]Any[/!]</code> qui peut "
-"contenir [!java]presque[/!] tous les autres type de données[!scala] («any» "
-"veut dire «n'importe» en anglais)[/!].\n"
-"[!java]Les types primitifs comme ceux que nous avons utilisé jusqu'à présent "
-"(int, boolean, double, char, etc) ne peuvent pas être stockés dans une "
-"variable Object, mais leurs variantes objectifiées (Integer, Boolean, "
-"Double, Char, Boolean, etc) peuvent l'être.[/!] \n"
-"Il est cependant raisonnable de rendre ses tableaux aussi spécifiques que "
-"possible. Si vous avez l'intention de stocker des entiers, faites en un "
-"tableau de [!java]integer[/!][!scala]Int[/!], pas de [!java]Object[/!][!"
-"scala]Any[/!].[/!] \n"
-"[!python]Les listes peuvent contenir des données de différents types, en "
-"mélangeant par exemple quelques valeurs entières dans certaines cellules "
-"avec des entiers dans d'autres cellules.[/!]"
+"Écrivez une méthode booléenne <code>isDirectionFree(dir)</code> indiquant si "
+"la direction fournie en paramètre est libre, c'est-à-dire si vous pouvez "
+"vous déplacer dans cette direction. Notez que la démo utilise la direction "
+"NORD pour cela. Vous pouvez retrouver la direction courante de la buggle en "
+"utilisant la méthode <code>Direction getDirection()</code>. Vous pouvez "
+"diriger (sans se déplacer) votre buggle dans une direction en utilisant la "
+"méthode <code>setDirection(dir)</code>. Pensez à mémoriser (dans une "
+"variable dédiée) la direction courante de votre buggle avant de vérifier si "
+"votre buggle peut se diriger vers sa direction de prédilection pour pouvoir "
+"restaurer l'état après coup."
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:38
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:55
msgid ""
-"T is the [!java|scala]array[/!][!python]list[/!]'s name, [!java|python]T[0]"
-"[/!][!scala]T(0)[/!] is the name of the first cell, [!java|python]T[1][/!][!"
-"scala]T(1)[/!] the name of the second cell, [!java|python]T[2][/!][!"
-"scala]T(2)[/!] the third one, etc. And yes, the first cell is numbered [!"
-"java|python]T[0][/!][!scala]T(0)[/!] while the last one of [!java|scala]an "
-"array[/!][!python]a list[/!] of size N is [!java|python]T[N-1][/!][!"
-"scala]T(N-1)[/!]. It may seem funny to count starting from 0 and not from 1 "
-"as usual, but some historical reasons make it unavoidable here."
+"You may have to change the rest of your code also, but these changes should "
+"remain limited."
msgstr ""
-"T est le nom [!python]de la liste[/!][!scala|java]du tableau[/!], \n"
-"[!java|python]T[0][/!][!scala]T(0)[/!] est le nom de la première case, \n"
-"[!java|python]T[1][/!][!scala]T(1)[/!] de la deuxième case, \n"
-"[!java|python]T[2][/!][!scala]T(2)[/!] de la troisième case, etc... \n"
-"Et oui, la première case est [!java|python]T[0][/!][!scala]T(0)[/!] et la "
-"dernière case\n"
-"[!python]d'une liste[/!][!scala|java]d'un tableau[/!] de taille N est \n"
-"[!java|python]T[N-1][/!][!scala]T(N-1)[/!]. \n"
-"Cela peut sembler étrange de commencer à compter à partir de 0 et non de 1, "
-"mais c'est ainsi (et cela s'explique par des raisons historiques obscures)."
-
-#. type: Content of: <p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:46
-msgid "Basic usage"
-msgstr "Usage de base"
+"Vous pouvez être amenés à modifier également le reste de votre code, mais "
+"ces changements devraient rester limités."
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:48
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:58
msgid ""
-"We can use an integer variable <i>i</i> to access with [!java|python]T[i][/!]"
-"[!scala]T(i)[/!] to the cells: when the value of <i>i</i> is 0, then [!java|"
-"python]T[i][/!][!scala]T(i)[/!] accesses [!java|python]T[0][/!][!scala]T(0)"
-"[/!]; when the value of <i>i</i> is 10, then [!java|python]T[i][/!][!"
-"scala]T(i)[/!] accesses [!java|python]T[10][/!][!scala]T(10)[/!]. <i>i</i> "
-"is said to be the <b>index</b> in T. <code>[!java|python]T[i][/!][!"
-"scala]T(i)[/!]</code> can be used just like any variable. We can set a new "
-"value:"
+"Don't forget that if you have a method modifying a global variable (such as "
+"angleSum), you should ensure that it declares this variable as global. "
+"Without it, the method creates a new variable of the same name, and the "
+"global never gets modified."
msgstr ""
-"On peut utiliser une variable entière <i>i</i> pour accéder avec [!java|"
-"python]T[i][/!][!scala]T(i)[/!] aux cases.\n"
-"Quand <i>i</i> vaut 0 alors [!java|python]T[i][/!][!scala]T(i)[/!] dénote la "
-"case [!java|python]T[0][/!][!scala]T(0)[/!]; \n"
-"lorsque <i>i</i> vaut 10, [!java|python]T[i][/!][!scala]T(i)[/!] dénote [!"
-"java|python]T[10][/!][!scala]T(10)[/!].\n"
-"On dit alors que <i>i</i> est un <b>indice</b> dans [!java|scala]le "
-"tableau[/!][!python]la liste[/!] T.\n"
-"<code>[!java|python]T[i][/!][!scala]T(i)[/!]</code> peut être utilisé comme "
-"n'importe quelle variable.\n"
-"On peut lui affecter une nouvelle valeur:"
+"N'oubliez pas que si l'une de vos méthodes modifie une variable globale "
+"(telle que sommeAngles), vous devez vous assurer qu'elle définie cette "
+"globale correctement. Sinon, la méthode crée une nouvelle variable locale de "
+"même nom, et la globale n'est jamais modifiée."
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:56
+#. type: Content of: <div><pre>
+#: src/lessons/maze/pledge/PledgeMaze.html:62
#, no-wrap
-msgid "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
-msgstr "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
+msgid ""
+"def myMethod():\n"
+" global angleSum\n"
+" ...\n"
+" angleSum = angleSum + 1\n"
+msgstr ""
+"def myMethod():\n"
+" global sommeAngle\n"
+" ...\n"
+" sommeAngle = sommeAngle + 1\n"
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:58
-msgid "We can retrieve and use its value:"
-msgstr "On peut réutiliser et tester cette valeur :"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/pledge/PledgeMaze.html:68
+msgid "Show an additional tip"
+msgstr "Montrer un indice supplémentaire"
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:59
-#, no-wrap
-msgid "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
-msgstr "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
+#. type: Content of: <div>
+#: src/lessons/maze/pledge/PledgeMaze.html:69
+msgid ""
+"You should set your direction to your favorite one (NORTH is advised). Then, "
+"you should write the algorithm main loop. In other words, while your buggle "
+"did not find its biscuit, you have to move forward until next obstacle in "
+"the favorite direction. Then, put a paw on a wall (using "
+"(<code>keepHandOnSideWall()</code>) while the sum of turns is not null and "
+"the favorite direction is not free. Do that until you find your baggle."
+msgstr ""
+"Vous devez changer votre cap vers votre direction favorite (probablement le "
+"nord -- Direction.NORD). Il vous faut ensuite écrire la boucle principale de "
+"votre algorithme. Tant que votre buggle n'a pas trouvé son biscuit, il faut "
+"avancer jusqu'à un obstacle dans la direction de prédilection. Quand un "
+"obstacle est rencontré, il faut garder la patte sur un mur (en utilisant "
+"<code>keepHandOnSideWall()</code>) tant que la somme des virages n'est pas "
+"nulle et que la direction de prédilection n'est pas libre. Faites cela "
+"jusqu'à trouver votre biscuit."
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:61
-msgid "We can test this value:"
-msgstr "On peut tester cette valeur :"
+#. type: Content of: <h2>
+#: src/lessons/maze/island/IslandMaze.html:1
+msgid "Lost between islands"
+msgstr "Perdu dans les îles"
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:62
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/maze/island/IslandMaze.html:3
msgid ""
-"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) [!scala|java]{[/!][!python]:[/!]\n"
-" [!java|scala]//[/!][!python]#[/!] instructions...\n"
-"[!java|scala]}[/!]"
+"You thought that your algorithm was enough to escape mazes? Well, not every "
+"mazes..."
msgstr ""
-"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) [!scala|java]{[/!][!python]:[/!]\n"
-" [!java|scala]//[/!][!python]#[/!] instructions...\n"
-"[!java|scala]}[/!]"
+"Vous pensiez que votre algorithme était suffisant pour échapper de tous les "
+"labyrinthes ? Et bien, pas tous les labyrinthes..."
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:66
+#. type: Content of: <p>
+#: src/lessons/maze/island/IslandMaze.html:7
msgid ""
-"It is very easy to traverse the whole [!scala|java]array[/!][!"
-"python]list[/!], for example to initialize each cells."
+"The <i>wall follower algorithm</i> we used so far only works if the entry "
+"and the exit are placed near to walls connected to the external wall. But if "
+"the buggle begins in the middle of the maze, it may exist wall sections "
+"disconnected from the external wall."
msgstr ""
-"Il est également très simple de parcourir [!java|scala]tout le tableau[/!][!"
-"python]toute la liste[/!], par exemple pour initialiser chaque cellule."
+"L'algorithme de suivi de mur que nous avons utilisé jusqu'à présent "
+"fonctionne seulement si l'entrée et la sortie sont placées à côté de murs "
+"connectés à un mur externe. Mais si la buggle commence au milieu du "
+"labyrinthe, il peut exister des pans de mur déconnectés du mur externe."
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:69
-#, no-wrap
+#. type: Content of: <p><p>
+#: src/lessons/maze/island/IslandMaze.html:12
msgid ""
-"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
-" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"That is why the previous strategy would let the buggle round around for "
+"ever. Indeed, the maze you should now escape from contains islands, and the "
+"buggle does not start along one of the external walls. Just give it a try if "
+"you want: copy your code over, push the run button and see your previous "
+"solution failing miserabily."
msgstr ""
-"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
-" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"Dans cette situation, notre précédente stratégie ferait notre buggle tourner "
+"en rond pour toujours sur l'un de ces îlots. En effet, le labyrinthe dont "
+"vous devez vous échapper maintenant contient des îles, et la buggle ne "
+"commence pas sur un des murs externes. Vous pouvez essayer si vous voulez : "
+"Copie/collez votre code et appuyez sur le bouton 'Exécuter' pour admirez "
+"votre solution précédente échouer lamentablement."
+
+#. type: Content of: <p><p>
+#: src/lessons/maze/island/IslandMaze.html:18
+msgid ""
+"The method of following a wall is still good and allow to escape very "
+"efficiently some sections of the maze, so we do not want to remove it "
+"entierely. Instead, we want to stop following the wall under some "
+"conditions. Notice that the baggle lays near to the external border of the "
+"maze. So, we want to reach the border and then follow that wall. We need for "
+"example to search for the north wall before following it to the baggle."
+msgstr ""
+"Cette méthode de suivre un mur est toujours efficace est permet d'échapper "
+"de manière assez efficace à certaines parties du labyrinthe, on ne va donc "
+"pas la supprimer entièrement. À la place, nous allons cesser de suivre le "
+"mur sous certaines conditions. Notez que le baggle repose près d'un mur "
+"externe du labyrinthe. Donc nous voulons atteindre un mur externe et ensuite "
+"le suivre. Nous avons par exemple de rechercher le mur nord avant de le "
+"suivre jusqu'au baggle."
#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:73
+#: src/lessons/maze/island/IslandMaze.html:26
msgid ""
-"[!java|scala]The notation <code>T.length</code> retrieves the length of the "
-"array T,[/!] [!python]The function <code>len()</code> retrieves the length "
-"of the list T,[/!] allowing to build a classical for loop easily. [!"
-"python]Actually, the <code>len()</code> function is much more generic and "
-"can be used to retrieve the length of many objects. Applied to strings for "
-"example, it returns the amount of chars in this string.[/!] [!scala]Don't "
-"forget to start at <code>0</code> and stop at <code>T.length-1</code> "
-"instead of <code>1 to T.length</code> however.[/!]"
+"To find the north wall, you simply run to the north as long as it's "
+"possible, and when facing an obstacle, you avoid it (using previous method)."
msgstr ""
-"[!java|scala]La notation <code>T.length</code> permet d'accéder à la taille "
-"(«length» en anglais) du tableau T,[/!]\n"
-"[!python]La fonction <code>len()</code> renvoie la longueur de la liste T,"
-"[/!] \n"
-"ce qui permet de construire facilement la boucle.\n"
-"[!python]En fait, la fonction <code>len()</code> est bien plus générique et "
-"peut être utilisée pour calculer la taille de nombreux objets. Appliquée à "
-"une chaîne de caractères par exemple, elle retourne le nombre de caractères "
-"composant cette chaîne.[/!]\n"
-"[!scala]N'oubliez pas de commencer à <code>0</code> pour terminer à <code>T."
-"length-1</code> au lieu de <code>1 to T.length</code>![/!]"
+"Pour trouver le mur nord, vous avez tout simplement à foncez vers le nord "
+"tant que c'est possible, et quand vous faites face à un obstacle, vous "
+"l'évitez (en utilisant la méthode précédente)."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:81
+#. type: Attribute 'alt' of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:30
+msgid "I'm lost now, please give me some extra indications"
+msgstr "Je suis perdu, je voudrais plus d'indications"
+
+#. type: Content of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:31
msgid ""
-"If you just want to iterate over the values of T without keeping track of "
-"their index, you can simply write:"
+"Our new run() method will consist in two modes: our buggle will alternate "
+"between the \"north runner mode\" and the \"left follower mode\". You begin "
+"in \"north runner mode\", and switch to \"left follower\" when you have a "
+"wall at the north (do not forget to make sure you have a wall at your left "
+"before switching to \"left follower\" mode). You switch to \"north runner\" "
+"as soon as your buggle is facing north and is not in front of a wall during "
+"its trip around its left wall. The easiest way to write such a state machine "
+"is something like"
msgstr ""
-"Si vous souhaitez simplement parcourir les valeurs de T sans avoir besoin de "
-"l'index de chaque valeur, vous pouvez écrire simplement :"
+"Notre nouvelle méthode run() va consister en deux états: notre buggle va "
+"alterner entre le mode «coureur au nord» et le mode «suiveur à gauche». Vous "
+"commencerz dans le mode «coureur au nord», et vous passerez au mode «suiveur "
+"à gauche» quand il y aura un mur au nord (n'oubliez pas de vous assurez "
+"d'avoir un mur à votre gauche avant de changer de passer au mode «suiveur à "
+"gauche»). Vous repasserez au mode «coureur au nord» dès que votre buggle "
+"fera face au nord et qu'elle n'est pas face à un mur. La manière la plus "
+"simple d'écrire une telle machine à état est quelque chose de ce type:"
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:82
+#. type: Content of: <p><p><div><pre>
+#: src/lessons/maze/island/IslandMaze.html:39
#, no-wrap
msgid ""
-"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in T:[/!]\n"
-" action()[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"[!scala]var state=0;\n"
+"state match {\n"
+" case 0 => // North runner\n"
+" ...\n"
+" state = 1;\n"
+" case 1 => // Left follower\n"
+" ...\n"
+" state = 0;\n"
+" case _ => println(\"This case should not happen. Please fix me\")\n"
+"}[/!][!java]int state=0;\n"
+"switch (state) {\n"
+" case 0: // North runner\n"
+" ...\n"
+" state = 1;\n"
+" break;\n"
+" case 1: // Left follower\n"
+" ...\n"
+" state = 0;\n"
+" break;\n"
+"}[/!][!python]northRunner = True\n"
+"if northRunner:\n"
+" ...\n"
+" northRunner = False\n"
+"else: # left follower\n"
+" ...\n"
+" northRunner = True[/!]"
msgstr ""
-"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in T:[/!]\n"
-" action()[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"[!scala]var etat=0;\n"
+"etat match {\n"
+" case 0 => // courir au nord\n"
+" ...\n"
+" etat = 1;\n"
+" case 1 => // suivre à gauche\n"
+" ...\n"
+" etat = 0;\n"
+" case _ => println(\"Ce cas ne devrait pas arriver. Corrigez ce problème svp.\")\n"
+"}[/!][!java]int etat=0;\n"
+"switch (etat) {\n"
+" case 0: // courir au nord\n"
+" ...\n"
+" etat = 1;\n"
+" break;\n"
+" case 1: // suivre à gauche\n"
+" ...\n"
+" etat = 0;\n"
+" break;\n"
+"}[/!][!python]coureurNord = True\n"
+"if coureurNord:\n"
+" ...\n"
+" coureurNord = False\n"
+"else: # suiveur à gauche\n"
+" ...\n"
+" coureurNord = True[/!]"
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:85
+#. type: Content of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:66
msgid ""
-"[!java]This construct is called an <i>extended loop</i> in Java. The "
-"variable <i>i</i> takes all values of the set located to the right of the "
-"colon (:), one after the other.[/!] [!python|scala]This is actually very "
-"similar to the previous construct. Simply, <code>[!python]range(n)[/!][!"
-"scala]i to j[/!]</code> returns a set of integers over which the for "
-"construct iterates. Actually, [!thelang] offers much more elegant ways to "
-"traverse [!python]lists[/!][!scala]arrays[/!] and other data collections, "
-"but this should be the topic of a specific set of exercises (that are still "
-"to be written in PLM).[/!]"
+"Don't forget the default case (matching _), or scala will issue an error "
+"since your matching would be incomplete.[/!]"
msgstr ""
-"[!java]Cette construction s'appelle une boucle <code>for</code> étendue en "
-"Java. \n"
-"La variable <i>i</i> prend successivement toutes les valeurs de l'ensemble "
-"placé à droite des deux-points (:).[/!] \n"
-"[!python|scala]Cette écriture est finalement très semblable à la "
-"précédente. \n"
-"Simplement, <code>[!python]range(n)[/!][!scala]i to j[/!]</code> retourne un "
-"ensemble d'entiers sur lequel la boucle <code>for</code> itère.\n"
-"En fait, [!thelang] offre d'autres moyens très élégants de traverser des [!"
-"python]listes[/!][!scala]tableaux[/!] \n"
-"et d'autres collections de données. Mais cela devrait être le sujet "
-"d'exercices spécifiques (qui restent à écrire dans PLM).[/!]"
+"N'oubliez pas le cas par défaut (qui accepte _), ou scala vous donnera un "
+"message d'erreur en échange de votre filtrage incomplet."
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:96
-msgid "Declaring [!python]a list[/!][!java|scala]an array[/!]"
-msgstr "Declarer [!python]une liste[/!][!java|scala]un tableau[/!]"
+#. type: Content of: <p><p><p>
+#: src/lessons/maze/island/IslandMaze.html:69
+msgid "Don't forget to let the buggle pick the baggle at the end of your code."
+msgstr ""
+"N'oubliez pas de faire ramasser le baggle par votre buggle à la fin de votre "
+"code."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:99
+#. type: Content of: <p><p><p>
+#: src/lessons/maze/island/IslandMaze.html:72
msgid ""
-"If you know beforehand the content of your list, you can affect these values "
-"all together. Just put them between square braces and separated by commas "
-"as follows:"
+"You're up. That should be enough for you to figure out how to escape this "
+"maze, but if not, you can always request for the tip. But you do not need "
+"any more help, do you?"
msgstr ""
-"Si vous connaissez à l'avance le contenu de votre liste, vous pouvez "
-"affecter ces valeurs directement. Placez-les simplement entre crochets et "
-"séparées par des virgules comme ceci :"
+"Vous êtes prêts. Tout ceci devrait suffire pour vous permettre de trouver "
+"comment sortir de ce labyrinthe, mais si ce n'est pas le cas, vous pouvez "
+"toujours demander l'astuce. Mais vous n'avez plus besoin d'aide, n'est-ce "
+"pas ?"
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:102
-#, no-wrap
+#. type: Content of: <h2>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:1
+msgid "Basic Shortest Path algorithm"
+msgstr "Algorithme basique de recherche du plus court chemin"
+
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:3
msgid ""
-"L = [1, 3, 5, 7, 9] \n"
-"<span class=\"comment\"># L is now an array of 5 values, all of them being integers</span>"
+"To conclude with this introductory lesson to maze solving algorithms, we "
+"will investigate another way to find the exit. The buggle in this lesson is "
+"a special buggle: he is a jedi. He can feel the Force. This means he is able "
+"to feel his environment."
msgstr ""
-"L = [1, 3, 5, 7, 9] \n"
-"<span class=\"comment\"># L est maintenant une liste de 5 valeurs, toutes des entiers</span>"
+"Pour conclure avec cette leçon d'introduction aux algorithmes de sortie de "
+"labyrinthe, nous allons étudier un autre moyen de trouver la sortie. La "
+"buggle de cette leçon est spécial : c'est un jedi. Il peut ressentir la "
+"Force. Cela signifie qu'elle peut ressentir son environnement."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:104
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:7
msgid ""
-"Otherwise, you probably want to create an empty list and then append each "
-"values separately to the list:"
+"Without even leaving his position, he can retrieve information about the "
+"world he is leaving in, with the following functions:"
msgstr ""
-"Dans le cas contraire, le plus simple est de créer une liste vide puis "
-"d'ajouter chaque valeur séparément à la liste :"
+"Sans même changer de place, elle peut retrouver des informations sur le "
+"monde qui l'entoure, avec les instructions suivantes :"
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:106
-#, no-wrap
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:9
+msgid "<code>getWorldWidth()</code> gives the width of its world."
+msgstr "<code>getMondeLargeur()</code> pour connaitre la largeur du monde"
+
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:10
+msgid "<code>getWorldHeight()</code> gives the height of its world."
+msgstr "<code>getMondeHauteur()</code> pour connaitre la hauteur du monde."
+
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:11
msgid ""
-"L2 = [] \n"
-"<span class=\"comment\"># L2 is now an empty list</span>\n"
-"L2.append(1)\n"
-"L2.append(3)\n"
-"L2.append(5)\n"
-"L2.append(7)\n"
-"L2.append(9) \n"
-"<span class=\"comment\"># Its content is now the same as L previously</span>"
+"<code>hasTopWall(x,y)</code> tells whether the cell (x,y) of this world has "
+"a wall on top."
msgstr ""
-"L2 = [] \n"
-"<span class=\"comment\"># L2 est maintenant une liste vide</span>\n"
-"L2.append(1)\n"
-"L2.append(3)\n"
-"L2.append(5)\n"
-"L2.append(7)\n"
-"L2.append(9) \n"
-"<span class=\"comment\"># Son contenu est maintenant le même que celui de L ci-dessus</span>"
+"<code>aMurNord(x,y)</code> indique si la cellule (x,y) de ce monde est "
+"fermée par un mur en haut."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:117
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:12
msgid ""
-"To declare a variable named <b>T</b> that can store arrays of integers, one "
-"should write:"
+"<code>hasLeftWall(x,y)</code> tells whether the cell (x,y) of this world has "
+"a wall on the left."
msgstr ""
-"Pour créer une variable nommée <b>T</b> pouvant contenir un tableau "
-"d'entiers, on écrira :"
-
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:118
-#, no-wrap
-msgid "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
-msgstr "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
+"<code>aMurOuest(x,y)</code> indique si la cellule (x,y) de ce monde est "
+"fermée par un mur à gauche."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:120
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:13
msgid ""
-"[!java]<code>int</code> means that the elements of the array are of type "
-"integer; <code>[]</code> means that we are speaking of an array and <code>T</"
-"code> is the name of the variable. For historical reasons, this can also be "
-"written as <code>int T[]</code> (with the [] after the variable name), but "
-"this is less readable and should probably be avoided.[/!] [!scala]The "
-"<code>[Int]</code> notation specializes the Array type (that is generic), "
-"specifying that each cell of this array is an integer. An array of booleans "
-"would simply by written <code>Array[Boolean]</code>.[/!]"
+"<code>hasBaggle(x,y)</code> tells whether the cell (x,y) of this world has a "
+"baggle."
msgstr ""
-"[!java]<code>int</code> indique que les éléments du tableau sont de type "
-"entier;\n"
-"<code>[]</code> indique que nous parlons d'un tableau tandis que <code>T</"
-"code> est le nom de la variable. \n"
-"Pour des raisons historiques, cela peut également être écrit sous la forme "
-"<code>int T[]</code> (avec [] à droite du nom de la variable), \n"
-"mais cette forme est moins lisible et devrait probablement être évitée.[/!]\n"
-"[!scala]La notation <code>[Int]</code> spécialise le type <code>Array</code> "
-"(«tableau» en anglais), qui est générique. Cela spécifie que chaque case du "
-"tableau est un entier. Le type d'un tableau de booleens s'écrirait "
-"simplement <code>Array[Boolean]</code>.[/!]"
-
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:128
-msgid "Allocating an array"
-msgstr "Allocation d'un tableau"
+"<code>aBiscuit(x,y)</code> indique si un baggle se trouve dans la cellule (x,"
+"y) de ce monde."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:130
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:14
msgid ""
-"Declaring a variable <code>T</code> that stores an array only reserve the "
-"<b>name</b> <code>T</code> for later use, but not the memory area to store "
-"the cells. The array is not initialized yet: it does not have any value. "
-"What would <code>[!java]T[4][/!][!scala]T(4)[/!]</code> mean if we didn't "
-"say that the array is 5 cells long?"
+"<code>setIndication(x,y,i)</code> adds the integer indication <code>i</code> "
+"to the cell (x,y)."
msgstr ""
-"Déclarer un tableau <code>T</code> nous réserve juste le nom <code>T</code> "
-"pour l'utiliser plus tard, mais pas la place en mémoire pour stocker les "
-"cases. Le tableau n'est pas initialisé : il n'a pas de valeur. Que voudrait "
-"dire <code>T[4]</code> si nous n'avons pas encore dit que <code>T</code> est "
-"un tableau de 5 éléments ?"
-
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:135
-msgid "First and foremost, we have to give a value to <code>T</code>:"
-msgstr "Avant tout, il faut donc lui affecter une valeur à <code>T</code>:"
-
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:136
-#, no-wrap
-msgid "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
-msgstr "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
+"<code>setIndication(x,y,i)</code> ajoute une indication entière <code>i</"
+"code> sur le sol de la cellule (x,y)."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:138
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:15
msgid ""
-"<code>new</code> means that we want to create something, and <code>[!"
-"java]int[10][/!][!scala]Array[Int](10)[/!]</code> means that it is an array "
-"of 10 integer values. In return, an array of 10 integer cells is created in "
-"memory, and the <code>T</code> variable <b>references</b> this array."
+"<code>getIndication(x,y,i)</code> retrieves the integer indication of the "
+"cell (x,y) (or 9999 if there is no indication)."
msgstr ""
-"<code>new</code> indique qu'il faut créer quelque chose, et \n"
-"<code>[!java]int[10][/!][!scala]Array[Int](10)[/!]</code> indique qu'il "
-"s'agit d'un tableau de 10 valeur entières. En réponse, un tableau d'entiers "
-"de longueur 10 est crée en mémoire, et la variable <code>T</code> "
-"<b>référence</b> ce tableau."
+"<code>getIndication(x,y,i)</code> retourne l'indication entière qui se "
+"trouve dans la cellule (x,y) (ou bien la valeur 9999 s'il n'y a pas "
+"d'indication à l'endroit indiqué)."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:143
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:18
msgid ""
-"The size of an array is fixed and cannot be changed after the creation of "
-"the array. The size of a <code>T</code> array can be retrieve by consulting "
-"the variable <code>T.length</code>."
+"It has to be noted that it is not possible to build a wall on the bottom "
+"edge or on the right edge of a cell. Therefore when such wall exists, it "
+"means it was built on a sibling cells -- as a top (respectively left) wall "
+"on the cell that is located below (respectively at the right of) the current "
+"cell."
msgstr ""
-"La taille d'un tableau est fixée et ne peut plus être changée après la "
-"création du tableau. Pour connaître la taille d'un tableau <code>T</code>, "
-"on peut consulter la variable <code>T.length</code>."
+"Il est bon de noter qu'il n'est pas possible de construire un mur sur le "
+"côté inférieur ou le coté droit d'une case. Néanmoins, quand de tels murs "
+"existent, cela signifie qu'il a été construit sur une case voisine -- comme "
+"mur supérieur (respectivement gauche) sur la case qui est située en dessous "
+"(respectivement sur à droite) de la case courante."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:147
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:24
msgid ""
-"While allocating, you can specify the size with a variable: <code>[!"
-"java]int[] T = new int[i];[/!][!scala]var T = new Array[Int](i);[/!]</code> "
-"In this case, the array's size will be set to the value of <code>i</code> "
-"<i>when <code>new</code> gets called</i>. The size of the array still "
-"cannot be modified : even if the variable <code>i</code> changes afterward, "
-"the size remains to the value given when it was allocated. [!java]Also, it "
-"is forbidden to write something like <code>int T[10];</code> when declaring "
-"the variable. You are required to use the <code>new</code> instruction to "
-"allocate it, as in <code>int[] T = new int[10];</code> [/!]"
+"Your buggle should first write the distance to the exit on each cell (or at "
+"least the useful ones)."
msgstr ""
-"Lors de l'allocation, vous pouvez spécifier la taille à utiliser avec une "
-"variable: \n"
-"<code>[!java]int[] T = new int[i];[/!][!scala]var T = new Array[Int](i);"
-"[/!]</code> \n"
-"Dans ce cas, la taille du tableau est fixée à la valeur de <code>i</code> "
-"<i>quand <code>new</code> a été appelé</i>. \n"
-"La taille du tableau ne peut toujours pas être modifiée. Même si la valeur "
-"de <code>i</code> est modifiée ensuite, la taille reste la même.\n"
-"[!java]Enfin, il est interdit d'écrire quelque chose comme <code>int T[10];</"
-"code> pour déclarer la variable. Il faut absolument utiliser <code>new</"
-"code> pour l'allouer, comme dans <code>int[] T = new int[10];</code> [/!]"
+"Votre buggle devrait tout d'abord écrire sur chaque case importante la "
+"distance qui la sépare de la sortie."
-#. type: Content of: <p><p><p><h4>
-#: src/lessons/welcome/array/basics/Array1.html:155
-msgid "Declaration and initialization"
-msgstr "Déclaration et initialisation"
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:25
+msgid ""
+"For that, find the exit and write 0 there. Then, write 1 on every "
+"neighboring cells that is not separated from the exit with a wall. And then "
+"mark every cells from which you can reach the exit in 2 steps, and iterate "
+"for all cells until you mark the cell where the buggle is located."
+msgstr ""
+"Pour cela, trouvez la sortie et écrivez 0 dessus. Ensuite, écrivez 1 sur "
+"toutes les cases adjacentes à la sortie qui n'en sont pas séparées par un "
+"mur. Ensuite, écrivez 2 sur toutes les cases à partir desquelles on peut "
+"atteindre une case marquée 1, puis faites de même pour toutes les cases "
+"jusqu'à numéroter la case où se trouve votre buggle."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:156
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:30
msgid ""
-"If you know beforehand the content of your array, you can declare, allocate "
-"and initialize it in one shoot:"
+"Once the cells are marked, get your jedi buggle to follow the shortest "
+"path. Basically the buggle has only to walk on each case with the lesser "
+"distance from the exit. You can use the method "
+"<code>setDirection(direction)</code> to make your buggle look at the "
+"specific direction such as <code>Direction.NORTH</code> or <code>Direction."
+"EAST</code>."
msgstr ""
-"Si vous connaissez le contenu de votre tableau à l'avance, vous pouvez le "
-"déclarer, l'allouer et l'initialiser en un coup:"
+"Une fois que toutes les cases sont marquées, faites en sorte que votre "
+"buggle jedi trouve le plus court chemin en suivant les indications écrites "
+"au sol. Pour celà, il lui suffit à chaque pas d'aller sur la case de plus "
+"petite distance parmis celles accessibles. Vous pouvez utiliser la méthode "
+"<code>void setDirection(Direction d)</code> pour faire regarder votre buggle "
+"dans une direction spécifique comme <code>Direction.NORD</code>, "
+"<code>Direction.SUD</code>, <code>Direction.EST</code> ou <code>Direction."
+"OUEST</code>, qui correspondent respectivement au nord, sud, est et ouest."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:157
-#, no-wrap
-msgid "[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
-msgstr "[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:35
+msgid "I'm lost now. Please give me some extra indications."
+msgstr "Je suis perdu, je voudrais plus d'indications"
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:159
+#. type: Content of: <div>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:36
+msgid "Use the Force, Luke!"
+msgstr "Utilises la Force Luke !"
+
+#. type: Content of: <h2>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:1
+msgid "Finding the walls to follow"
+msgstr "Trouver les murs à longer"
+
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:3
msgid ""
-"To know the size of the array to allocate, the compiler counts the provided "
-"values. This code is equivalent to:"
+"This is exactly the same maze than before, but the buggle does not start at "
+"the same location. In particular, it does not have any wall to its left at "
+"the beginning."
msgstr ""
-"Pour connaître la taille du tableau à allouer, le compilateur compte les "
-"valeurs données. Ce code est équivalent à :"
+"C'est exactement le même labyrinthe que précédemment, mais la buggle ne "
+"commence plus au même emplacement. En particulier, elle n'a plus de mur à sa "
+"gauche dès le départ."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:161
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:7
msgid ""
-"[!java]int[] T = new int[10];\n"
-"T[0] = 1;\n"
-"T[1] = 2;\n"
-"...\n"
-"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
-"T(0) = 1\n"
-"T(1) = 2\n"
-"...\n"
-"T(9) = 10[/!]"
+"As a result, the method you wrote for the previous exercise probably don't "
+"work for this one. If you use it here with no modification, your buggle "
+"probably start looping over the four free cells around its start position "
+"(if that's not the case, well, you didn't really stick to the mission on "
+"previous exercise. Feel lucky and proceed to the next :)"
msgstr ""
-"[!java]int[] T = new int[10];\n"
-"T[0] = 1;\n"
-"T[1] = 2;\n"
-"...\n"
-"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
-"T(0) = 1\n"
-"T(1) = 2\n"
-"...\n"
-"T(9) = 10[/!]"
-
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:171
-msgid "It is also equivalent to:"
-msgstr "C'est aussi équivalent au code :"
+"Ceci fait que la méthode écrite à l'exercice précédent ne fonctionne plus. "
+"Si vous l'utilisez ici sans modification, votre buggle va probablement "
+"commencer à tourner sur les quatres cases à côté de sa position de départ "
+"(si ça n'est pas le cas, et bien, vous n'avez pas réellement suivi la "
+"mission de l'exercice précédent. Sentez vous chanceux et passez à l'exercice "
+"suivant une fois que vous aurez lu ce texte)."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:172
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:14
msgid ""
-"[!java]int[] T = new int[10];\n"
-"for (int i=0; i<T.length; i++) {\n"
-" T[i] = i+1;\n"
-"}[/!][!scala]var T = new Array[Int](10);\n"
-"for (i <- 0 to T.length-1) {\n"
-" T(i) = i+1\n"
-"}[/!]"
+"This is because your <code>keepHandOnSideWall()</code> method has an "
+"implicit <b>pre-condition</b>: it works well if and only if the buggle has a "
+"wall to its left when you call it. Such pre-condition are very heavily used "
+"when programming. Specifying them explicitly helps understanding the code "
+"written by other, and they even allow sometimes to prove that the code works "
+"correctly."
msgstr ""
-"[!java]int[] T = new int[10];\n"
-"for (int i=0; i<T.length; i++) {\n"
-" T[i] = i+1;\n"
-"}[/!][!scala]var T = new Array[Int](10);\n"
-"for (i <- 0 to T.length-1) {\n"
-" T(i) = i+1\n"
-"}[/!]"
-
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:183
-msgid "[!python]Lists[/!][!scala|java]Arrays[/!] and method parameters"
+"C'est parce que votre méthode <code>keepHandOnSideWall()</code> a une <b>pré-"
+"condition</b> implicite : la méthode marche bien si et seulement si la "
+"buggle a un mur sur sa gauche quand vous appelez cette méthode. De telles "
+"pré-conditions sont très utilisées en programmation. Les spécifier "
+"explicitement aide à comprendre le code écrit par d'autres personnes, et "
+"peuvent même parfois prouver que le code marche correctement."
+
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:24
+msgid ""
+"Fixing the problem should be very easy. Simply make sure that the pre-"
+"condition of <code>keepHandOnSideWall()</code> is verified before calling "
+"it. For that, update your code to first look for a wall on its left before "
+"the big <code>while</code> loop."
msgstr ""
-"Les [!python]listes[/!][!scala|java]tableaux[/!] et les paramètres de "
-"méthodes"
+"Réparer le problème devrait être très facile. Assurez-vous simplement que la "
+"pré-condition de <code>keepHandOnSideWall()</code> est vérifiée avant de "
+"l'appeler. Pour ce faire, mettez à jour votre code pour tout d'abord "
+"rechercher à avoir un mur à sa gauche avant de rentrer dans la grande boucle "
+"<code>while</code>."
+
+#. type: Content of: <h3>
+#: src/plm/universe/lightbot/LightBotWorld.html:1
+#: src/lessons/lightbot/Main.html:1 src/lessons/lightbot/short_desc.html:1
+msgid "LightBot"
+msgstr "LightBot"
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/lightbot/LightBotWorld.html:3
+msgid ""
+"This universe introduces a little programming puzzle which can somehow be "
+"used to introduce programmation to non-reading kids since it is programmed "
+"graphically. The goal of each board is to light up all the lights. Your "
+"robot understands the following orders:"
+msgstr ""
+"Cet univers introduit un petit puzzle de programmation qui peut être utilisé "
+"pour introduire la programmation aux enfants ne sachant pas lire. En effet, "
+"il est programmé de manière graphique. L'objectif de chaque niveau est "
+"d'allumer toutes les lumières du plateau en utilisant le petit robot. Celui-"
+"ci comprend les ordres suivants :"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:7
+msgid "<b>Order</b>"
+msgstr "<b>Ordre</b>"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:7
+msgid "<b>Meaning</b>"
+msgstr "<b>Signification</b>"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:8
+msgid "<b>Move forward</b>"
+msgstr "<b>Avancer</b>"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:8
+msgid ""
+"Cannot be done if the destination cell is of another height than source cell"
+msgstr ""
+"Ne peut être utilisé que si la case d'arrivée est à la même altitude que la "
+"case de départ."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:9
+msgid "<b>Jump forward</b>"
+msgstr "<b>Sauter en avant</b>"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:9
+msgid ""
+"Can only be done if the destination cell is one step higher than source "
+"cell, or if destination is lower than source. Cannot be used for plain moves."
+msgstr ""
+"Ne peut être utilisé que si la case d'arrivée est un étage plus haute que la "
+"case de départ, ou si l'arrivée est plus basse que le départ. Il est "
+"impossible de sauter sur un terrain plat."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:10
+msgid "<b>Turn left</b>."
+msgstr "<b>Tourner à gauche</b>."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:11
+msgid "<b>Turn right</b>."
+msgstr "<b>Tourner à droite</b>."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:12
+msgid "<b>Switch the light</b>."
+msgstr "<b>Allumer ou éteindre</b>"
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:12
+msgid ""
+"Turn it on if it was off, and off if it was on. No effect if the cell does "
+"not contain any light."
+msgstr ""
+"Allumer l'ampoule si elle était éteinte, et éteindre si elle était allumée. "
+"Sans effet s'il n'y a pas d'ampoule dans la case courante."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:13
+msgid "<b>Call function 1</b>."
+msgstr "<b>Appeller la fonction 1</b>."
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:14
+msgid "<b>Call function 2</b>."
+msgstr "<b>Appeller la fonction 2</b>."
+
+#. type: Content of: <p>
+#: src/plm/universe/lightbot/LightBotWorld.html:17
+msgid ""
+"Please note that this world is not completely suited to small kids since the "
+"main difficulty comes from the fact that your are highly limited in the "
+"amount of instructions you can give to your robot. Advanced levels thus "
+"require to write sound functions, and are often above the capacities of "
+"small kids."
+msgstr ""
+"Veuillez noter que ce jeu n'est pas vraiment adapté aux jeunes enfants "
+"puisque la principale difficulté vient de la limitation du nombre "
+"d'instructions utilisable dans chaque programme. Les niveaux avancés ne "
+"peuvent être résolus sans écrire des fonctions pour factoriser le code, ce "
+"qui est souvent au delà des capacités des jeunes enfants."
+
+#. type: Content of: <p>
+#: src/plm/universe/lightbot/LightBotWorld.html:19
+msgid ""
+"This game is heavily inspirated from a flash game of the same name, which "
+"can for example be played on kongregate.com. It was written by Danny "
+"Yaroslavski (Coolio-Niato), the original idea being of Matt Chase."
+msgstr ""
+"Ce jeu est très largement inspiré d'un jeu en flash du même nom, que l'on "
+"peut par exemple trouver sur kongregate.com. Il a été écrit par Danny "
+"Yaroslavski (Coolio-Niato), d'après une idée originale de Matt Chase."
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/lightbot/Main.html:2
+msgid ""
+"This lesson introduces a little programming puzzle inspired from a flash "
+"game."
+msgstr ""
+"Cette leçon introduit un petit jeu de programmation inspiré d'un jeu en "
+"flash."
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Main.html:4
+msgid "See the <i>About this world</i> dialog for more details."
+msgstr ""
+"Référez vous à l'aide <i>À propos de ce monde</i> pour plus de détails."
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/short_desc.html:3
+msgid ""
+"This lesson constitutes a little brain teaser for programmers. You have to "
+"instruct your robot to turn off all lights. The trick is that you program "
+"your robot graphically, and that you are limited in the amount of "
+"instructions."
+msgstr ""
+"Cette leçon constitue un casse-tête pour programmeurs, où vous devez "
+"apprendre à votre robot à éteindre toutes les lumières. Le truc est que vous "
+"le programmez graphiquement, et que vous n'avez droit qu'à un nombre limité "
+"d'instructions."
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/short_desc.html:8
+msgid "No previous experience is expected to take this lesson."
+msgstr "Aucune expérience préalable n'est nécessaire pour tenter cette leçon."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board01TwoSteps.html:1
+msgid "Welcome"
+msgstr "Bienvenue"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board01TwoSteps.html:3
+msgid ""
+"Welcome to the lightbot world. This is merely a programmer puzzle rather "
+"than a real lesson (although some use it to teach programming). The robot "
+"is not programmed in Java, but rather graphically. You can see the existing "
+"orders in the documentation using the <i>About this world</i> menu."
+msgstr ""
+"Bienvenue dans le monde de LightBot. Il s'agit plus d'une sorte de puzzle "
+"pour programmeur que d'une vraie leçon (bien qu'il puisse être utilisé pour "
+"enseigner la programmation). Le robot n'est pas programmé en Java, mais "
+"graphiquement. Vous trouverez les ordres disponibles dans la documentation "
+"en utilisant le menu <b>À propos de ce monde</b>."
+
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:6
+msgid ""
+"The goal of each board is simply to switch on every lights of the board "
+"using your little robot."
+msgstr ""
+"L'objectif de chaque niveau est simplement de faire allumer toutes les "
+"ampoules du tableau à votre petit robot."
+
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:8
+msgid ""
+"This is a introduction exercise, which should be solvable by only moving "
+"forward and switching the light, using respectively"
+msgstr ""
+"Ce premier exercice est une simple mise en bouche. Vous devriez pouvoir le "
+"résoudre simplement en avancant et en allumant la lampe, grâce aux ordres "
+"suivants: "
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board01TwoSteps.html:10
+#: src/lessons/lightbot/Board02Turn.html:4
+#: src/lessons/lightbot/Board06Func.html:3
+msgid "and"
+msgstr "et"
+
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:10
+msgid "."
+msgstr "."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board02Turn.html:1
+msgid "Turn around"
+msgstr "Se retourner"
+
+# type: Content of: <p>
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board02Turn.html:3
+msgid "Now, you probably need to turn in addition (using"
+msgstr "Maintenant, vous avez probablement besoin de tourner (en utilisant "
+
+# type: Content of: <p>
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board02Turn.html:4
+msgid ")."
+msgstr ")."
+
+# type: Content of: <h1>
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board03Jump.html:1
+msgid "Jump"
+msgstr "Sauter"
+
+# type: Content of: <p>
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board03Jump.html:3
+msgid "You can also jump using"
+msgstr "Vous pouvez également sauter en utilisant "
+
+# type: Content of: <p>
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board03Jump.html:3
+msgid ""
+"to pass obstacles. You can either jump one level up or any amount of levels "
+"down, but you cannot jump to go on a cell of the same height."
+msgstr ""
+"pour passer les obstacles. Vous pouvez soit sauter un étage vers le haut, ou "
+"vers le bas (même de plusieurs étages), mais vous ne pouvez pas sauter pour "
+"vous déplacer à plat."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board04Stairs.html:1
+msgid "Stairs"
+msgstr "Escaliers"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board04Stairs.html:3
+msgid "Can you pass these stairs?"
+msgstr "Parviendrez vous à passer ces escaliers ?"
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board05Higher.html:1
+msgid "Higher"
+msgstr "Toujours plus haut"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board05Higher.html:3
+msgid "Let's go higher"
+msgstr "Il est temps de nous élever de plus en plus haut."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board06Func.html:1
+msgid "Functions"
+msgstr "Fonctions"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board06Func.html:3
+msgid "You can use"
+msgstr "Vous pouvez utiliser"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board06Func.html:3
+msgid ""
+"to call respectively the first and second functions. Define their code in "
+"their own tab."
+msgstr ""
+"Pour appeller respectivement la première et la seconde fonction. Définissez "
+"leur code dans leur boîte respective."
+
+#. type: Content of: <p><p>
+#: src/lessons/lightbot/Board06Func.html:5
+msgid "This is great if you get out of space in your main function"
+msgstr ""
+"Cela peut s'avérer pratique si vous n'avez plus assez d'espace dans votre "
+"fonction principale."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board07Repeat.html:1
+msgid "Repetitive tasks"
+msgstr "Des tâches répétitives"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board07Repeat.html:3
+msgid "Functions are also of great use for repetitive tasks"
+msgstr "Les fonctions sont également très pratique pour les tâches répétitives"
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board08Rec.html:1
+msgid "Calling functions from functions"
+msgstr "Invoquer des fonctions depuis les fonctions"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board08Rec.html:3
+msgid "It is perfectly okay to call a function from within a function!"
+msgstr ""
+"Rien ne vous interdit d'invoquer une fonction depuis une autre fonction !"
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board09Castle.html:1
+msgid "Castle"
+msgstr "Chateau"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board09Castle.html:3
+msgid "You're getting good at this..."
+msgstr "Vous vous en sortez de mieux en mieux..."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board10Wall.html:1
+msgid "Wall"
+msgstr "Mur"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board10Wall.html:3
+msgid "Ready to climb the wall?"
+msgstr "Etes-vous prêt à escalader ce mur ?"
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board11Sea.html:1
+msgid "Sea"
+msgstr "Mer"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board11Sea.html:3
+msgid "You now have to surf these waves of lamps."
+msgstr "Vous devez maintenant surfer sur cette mer de lampes."
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board12Escher.html:1
+msgid "Escher Castle"
+msgstr "Le chateau d'Escher"
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board12Escher.html:3
+msgid "This one aint easy."
+msgstr "Celui-ci est loin d'être facile."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Close10.html:1
+msgid "Close to 10"
+msgstr "Proche de 10"
+
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Close10.html:2
+msgid ""
+"Given 2 int values, return whichever value is nearest to the value 10, or "
+"return 0 in the event of a tie. [!java|scala]Note that Math.abs(n) returns "
+"the absolute value of a number.[/!] [!python]Note that math.fabs(n) returns "
+"the absolute value of a number. This function can only be used if you "
+"imported the math module.[/!]"
+msgstr ""
+"Étant donné deux nombres entiers, retourner la valeur la plus proche de 10, "
+"ou 0 en cas de match nul.\n"
+"[!java|scala]Remarquez que Math.abs(n) retourne la valeur absolue d'un "
+"nombre.[/!] \n"
+"[!python]Remarquez que math.fabs(n) retourne la valeur absolue d'un nombre. "
+"Remarquez également que vous ne pouvez utiliser cette fonction que si vous "
+"avez importé le module math.[/!]"
+
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Close10.html:7
+#: src/lessons/welcome/bat/bool1/Diff21.html:5
+#: src/lessons/welcome/bat/bool1/HasTeen.html:6
+#: src/lessons/welcome/bat/bool1/IcyHot.html:5
+#: src/lessons/welcome/bat/bool1/In1020.html:5
+#: src/lessons/welcome/bat/bool1/In3050.html:5
+#: src/lessons/welcome/bat/bool1/LastDigit.html:9
+#: src/lessons/welcome/bat/bool1/LoneTeen.html:6
+#: src/lessons/welcome/bat/bool1/Main.html:11
+#: src/lessons/welcome/bat/bool1/Makes10.html:5
+#: src/lessons/welcome/bat/bool1/Max1020.html:7
+#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:7
+#: src/lessons/welcome/bat/bool1/NearHundred.html:7
+#: src/lessons/welcome/bat/bool1/ParotTrouble.html:8
+#: src/lessons/welcome/bat/bool1/PosNeg.html:5
+#: src/lessons/welcome/bat/bool1/SleepIn.html:7
+#: src/lessons/welcome/bat/bool1/SumDouble.html:5
+#: src/lessons/welcome/bat/bool2/AlarmClock.html:11
+#: src/lessons/welcome/bat/bool2/AnswerCell.html:8
+#: src/lessons/welcome/bat/bool2/BlueTicket.html:10
+#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:11
+#: src/lessons/welcome/bat/bool2/CigarParty.html:9
+#: src/lessons/welcome/bat/bool2/DateFashion.html:12
+#: src/lessons/welcome/bat/bool2/GreenTicket.html:9
+#: src/lessons/welcome/bat/bool2/In1To10.html:8
+#: src/lessons/welcome/bat/bool2/InOrderEqual.html:9
+#: src/lessons/welcome/bat/bool2/InOrder.html:8
+#: src/lessons/welcome/bat/bool2/LastDigit2.html:8
+#: src/lessons/welcome/bat/bool2/LessBy10.html:5
+#: src/lessons/welcome/bat/bool2/Main.html:4
+#: src/lessons/welcome/bat/bool2/MaxMod5.html:9
+#: src/lessons/welcome/bat/bool2/NearTen.html:8
+#: src/lessons/welcome/bat/bool2/RedTicket.html:9
+#: src/lessons/welcome/bat/bool2/ShareDigit.html:9
+#: src/lessons/welcome/bat/bool2/SortaSum.html:7
+#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:10
+#: src/lessons/welcome/bat/bool2/TeaParty.html:11
+#: src/lessons/welcome/bat/bool2/TeenSum.html:8
+#: src/lessons/welcome/bat/bool2/TwoAsOne.html:5
+#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:8
+#: src/lessons/bat/string1/Main.html:8 src/lessons/bat/string1/AltPairs.html:4
+#: src/lessons/bat/string1/FrontTimes.html:7
+#: src/lessons/bat/string1/Last2.html:8
+#: src/lessons/bat/string1/StringBits.html:4
+#: src/lessons/bat/string1/StringMatch.html:8
+#: src/lessons/bat/string1/StringSplosion.html:4
+#: src/lessons/bat/string1/StringTimes.html:4
+#: src/lessons/bat/string1/StringX.html:6
+#: src/lessons/bat/string1/StringYak.html:7
+#: src/lessons/welcome/array/array123/Array123.html:4
+#: src/lessons/welcome/array/array667/Array667.html:7
+#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:4
+#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:4
+#: src/lessons/welcome/array/notriples/NoTriples.html:7
+#: src/lessons/welcome/array/has271/Has271.html:9
+msgid ""
+"This exercise was converted to PLM from the excellent exercising site http://"
+"javabat.com/"
+msgstr ""
+"Cet exercice a été extrait de l'excellent site d'exercices http://javabat."
+"com/ pour PLM."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:184
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/CountTeen.html:1
+msgid "Count Teen"
+msgstr "Compter les ados"
+
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/CountTeen.html:2
msgid ""
-"It is perfectly OK to pass [!python]a list[/!][!java|scala]an array[/!] to a "
-"method as a parameter. This method can then use this parameter as if it "
-"were defined locally:"
+"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
+"Given 4 int values, return the amount of teen ones."
msgstr ""
-"On peut tout à fait passer [!java|scala]un tableau[/!][!python]une liste[/!] "
-"en paramètre d'une méthode. La méthode peut alors l'utiliser comme si la "
-"variable avait été définie localement:"
+"On dira qu'un nombre est \"ado\" s'il appartient est entre 13 et 19 "
+"(inclus). Étant donné quatre nombres entiers, retournez combien d'entre eux "
+"sont ados."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:186
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Diff21.html:1
+msgid "Diff 21"
+msgstr "Diff 21"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/Diff21.html:2
msgid ""
-"[!java]boolean has42First(int[] array) {\n"
-" return array[0] == 42;\n"
-"}[/!][!python]def has42First(list):\n"
-" return list[0] == 42[/!][!scala]def has42First(array:Array[Int]):Boolean = {\n"
-" return array(0) == 42\n"
-"}[/!]"
+"Given an int n, return the absolute difference between n and 21, except "
+"return double the absolute difference if n is over 21."
msgstr ""
-"[!java]boolean a42Premier(int[] tableau) {\n"
-" return tableau[0] == 42;\n"
-"}[/!][!python]def a42Premier(liste):\n"
-" return liste[0] == 42[/!][!scala]def a42Premier(tableau:Array[Int]):Boolean = {\n"
-" return tableau(0) == 42\n"
-"}[/!]"
+"Étant donné un entier n, retournez la différence absolue entre n et 21, sauf "
+"si n est plus grand que 21. Dans ce cas, doublez la différence absolue."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:193
-msgid "On the caller side, that also very simple:"
-msgstr "Coté appelant, c'est aussi simple :"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/HasTeen.html:1
+msgid "Has Teen"
+msgstr "A des ados"
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:194
-#, no-wrap
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/HasTeen.html:2
msgid ""
-"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] (10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
-"[!java|scala]<span class=\"comment\">// Values initialization omitted</span>\n"
-"[/!]if (has42First(tab))[!java|scala] {[/!][!python]:[/!]\n"
-" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] do something</span>\n"
-"[!java|scala]}[/!]"
+"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
+"Given 3 int values, return true if 1 or more of them are teen."
msgstr ""
-"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] (10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
-"[!java|scala]<span class=\"comment\">// Initialisation des valeurs omise</span>\n"
-"[/!]if (a42Premier(tab))[!java|scala] {[/!][!python]:[/!]\n"
-" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] faire des choses</span>\n"
-"[!java|scala]}[/!]"
+"On dira qu'un nombre est \"ado\" s'il appartient à l'intervalle [13;19]. "
+"Étant donné trois nombres entiers, retournez vrai ssi un ou plusieurs "
+"d'entre eux sont ados."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:201
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/IcyHot.html:1
+msgid "Icy Hot"
+msgstr "Feu glacé"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/IcyHot.html:2
msgid ""
-"If you want to allocate and initialize the array in one shoot, that's a bit "
-"more complicated as the compiler has to know the type of the parameter you "
-"are creating. For that, use the following (ugly) construct:"
+"Given two temperatures, return true if one is less than 0 and the other is "
+"greater than 100."
msgstr ""
-"Si vous voulez allouer et initialiser le tableau au vol lors du passage de "
-"paramètre, c'est un peu plus compliqué car il faut dire au compilateur le "
-"type du paramètre que vous construisez. Il faut alors utiliser la "
-"construction suivante, même si elle n'est pas très belle."
+"Étant donné deux températures, retournez vrai si l'une est inférieure à zéro "
+"et l'autre supérieure à 100."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:204
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/In1020.html:1
+msgid "In [10;20]"
+msgstr "Dans [10;20]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/In1020.html:2
msgid ""
-"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
-" <span class=\"comment\">// do something</span>\n"
-"}"
+"Given 2 int values, return true if either of them is in the range 10..20 "
+"inclusive."
msgstr ""
-"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
-" <span class=\"comment\">// faire des choses</span>\n"
-"}"
+"Étant donné deux nombres entiers, retournez vrai s'un d'entre eux est dans "
+"l'intervalle [10;20]."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:209
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/In3050.html:1
+msgid "In [30;50]"
+msgstr "Dans [30;50]"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/In3050.html:2
msgid ""
-"Methods can also return [!java|scala]arrays[/!][!python]lists[/!] as result "
-"without any complication. Here is a method that returns [!java|scala]an "
-"array[/!][!python]a list[/!] of the requested size, filled with 42s."
+"Given 2 int values, return true if they are both in the range 30..40 "
+"inclusive, or they are both in the range 40..50 inclusive."
msgstr ""
-"Les méthodes peuvent également retourner des [!java|scala]tableaux[/!][!"
-"python]listes[/!] comme résultat sans aucun problème.\n"
-"Voici une méthode retournant [!java|scala]un tableau[/!][!python]une "
-"liste[/!] de la taille demandée après avoir initialisé toutes les cases à la "
-"valeur 42."
+"Étant donné deux nombres entiers, retournez vrai s'ils sont tous les deux "
+"dans l'intervalle [30;40], ou s'ils sont tous les deux dans l'intervalle "
+"[40;50]."
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:212
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/LastDigit.html:1
+msgid "LastDigit"
+msgstr "Dernier chiffre"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/LastDigit.html:2
msgid ""
-"[!java]int[] fill42(int size) {\n"
-" int[] res = new int[size];\n"
-" for (int i=0; i<size; i++) \n"
-" res[i] = 42;\n"
-" return res;\n"
-"}[/!][!scala]def fill42(size:Int):Array[Int] = {\n"
-" var res = new Array[int] (size)\n"
-" for (i <- 0 to size -1) {\n"
-" res(i) = 42;\n"
-" }\n"
-" return res;\n"
-"}[/!][!python]def fill42(size):\n"
-" res = []\n"
-" for i in range(size):\n"
-" res.append(42)\n"
-" return res[/!]"
+"Given two non-negative int values, return true if they have the same last "
+"digit, such as with 27 and 57. Note that the % \"mod\" operator computes "
+"remainders, so 17 % 10 is 7."
msgstr ""
-"[!java]int[] remplir42(int taille) {\n"
-" int[] res = new int[taille];\n"
-" for (int i=0; i<taille; i++) \n"
-" res[i] = 42;\n"
-" return res;\n"
-"}[/!][!scala]def remplir42(taille:Int):Array[Int] = {\n"
-" var res = new Array[int] (taille)\n"
-" for (i <- 0 to taille -1) {\n"
-" res(i) = 42;\n"
-" }\n"
-" return res;\n"
-"}[/!][!python]def remplir42(taille):\n"
-" res = []\n"
-" for i in range(taille):\n"
-" res.append(42)\n"
-" return res[/!]"
+"Étant donné deux nombres entiers positifs, retournez vrai s'ils ont le même "
+"dernier chiffre, comme 27 et 57. Remarquez que l'opérateur % (modulo) "
+"calcule le reste de la division entière (donc 17 % 10 vaut 7)."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:231
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/LoneTeen.html:1
+msgid "Lone Teen"
+msgstr "Ado solitaire"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/LoneTeen.html:2
msgid ""
-"At least! After this long explanation, we can come back to the exercise."
+"We'll say that a number is \"teen\" if it is in the range 13..19 inclusive. "
+"Given 2 int values, return true if one or the other is teen, but not both."
msgstr ""
-"Enfin ! Après toutes ces explications, nous pouvons revenir à l'exercice."
+"On dira qu'un nombre est \"ado\" s'il appartient à l'intervalle [13;19]. "
+"Étant donné deux nombres entiers, retournez vrai si l'un d'entre eux est "
+"ado, mais pas les deux."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:232
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Main.html:1
+msgid "Boolean fun"
+msgstr "Jeux booléens"
+
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Main.html:3
msgid ""
-"Your mission is rather simple actually. Your code should save the color "
-"pattern observed on the first row into [!java|scala]an array[/!][!python]a "
-"list[/!]. [!python]The easiest is to create an empty list, and then "
-"<code>append()</code> the colors one after the others as you read them (with "
-"<code>getGroundColor()</code>).[/!] [!java|scala]For that, you should "
-"declare and allocate an array of <code>Color</code>. Beware, there is "
-"several worlds, of differing size; use <code>getWorldHeight()</code> to "
-"retrieve the size of the current world. Once the array allocated, fill it "
-"by reading the ground color in each locations (with <code>getGroundColor()</"
-"code>).[/!]"
+"Boolean operations are one of the very basic task in programming. As long "
+"as you cannot write a not so simple boolean test under the minute, you "
+"probably will have a very bad time writing a real program."
msgstr ""
-"Votre mission est plutôt simple au fond. Votre code doit sauvegarder le "
-"motif de couleurs observé sur la première colonne. Il faut bien entendu "
-"sauvegarder ces valeurs dans [!java|scala]un tableau[/!][!python]une "
-"liste[/!]. \n"
-"[!python]Le plus simple pour cela est de créer une liste vide puis d'y "
-"adjoindre (avec <code>append()</code> les différentes couleurs lues sur le "
-"sol de la première colonne (avec <code>getCouleurSol()</code>).[/!] \n"
-"[!java|scala]Pour cela, il faut déclarer et créer un tableau de <code>Color</"
-"code>s. Attention, les différents mondes ne sont pas tous de la même taille "
-"et il faut utiliser <code>getMondeHauteur()</code> pour trouver la taille du "
-"monde courant. Une fois créé, remplissez le tableau en lisant les couleurs "
-"au sol de la première colonne (avec <code>getCouleurSol()</code>).[/!]"
+"Les opérations booléennes sont l'une des fondements de la programmation. "
+"Tant que vous ne pourrez pas écrire des tests booléens (même non triviaux) "
+"en moins d'une minute, il vous sera difficile d'écrire un vrai programme."
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:240
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Main.html:8
msgid ""
-"Once you managed to read and save the pattern on the first row, you have to "
-"reapply the pattern on every rows, for example by executing "
-"<code>getWorldHeight()</code> times a method written specifically for this."
+"That is why this lesson provides you a bunch of such exercises, so that you "
+"can get trained in this."
msgstr ""
-"Une fois le motif de la première colonne lu et sauvegardé, il faut le "
-"répliquer sur toutes les colonnes, par exemple en exécutant "
-"<code>getMondeLargeur()</code> fois une méthode écrite tout exprès."
+"C'est pourquoi cette leçon vous propose une certaine quantité de tels "
+"exercices pour vous permettre de vous entrainer."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/basics/Array2.html:1
-msgid "[!java|scala]Arrays[/!][!python]Lists[/!], Knotting and Modulos"
-msgstr "[!java|scala]Tableaux[/!][!python]Listes[/!], tricot et modulo"
+#: src/lessons/welcome/bat/bool1/Makes10.html:1
+msgid "Makes 10"
+msgstr "Font 10"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/Makes10.html:2
msgid ""
-"This exercise is similar to the previous one: you have to reproduce the "
-"color pattern of the first cell into the other ones."
+"Given 2 ints, a and b, return true if one if them is 10 or if their sum is "
+"10."
msgstr ""
-"Cet exercice ressemble au précédent : il faut reproduire le motif de "
-"couleurs de la première colonne dans les colonnes suivantes."
+"Étant donné deux nombres entiers, retournez vrai si l'un d'entre eux vaut "
+"10, ou si leur somme vaut 10."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Max1020.html:1
+msgid "Max1020"
+msgstr "Max1020"
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:6
+#: src/lessons/welcome/bat/bool1/Max1020.html:2
msgid ""
-"The first difference is that the world is bordered of walls: you thus have "
-"to slightly modify your trajectory to ensure that the buggle does not crash "
-"into a wall. The simpler for that is to handle the first cell out of the "
-"<code>for</code> loop and do only <code>getWorldHeight()-1</code> steps in "
-"the loop."
+"Given 2 positive int values, return the larger value that is in the range "
+"10..20 inclusive, or return 0 if neither is in that range."
msgstr ""
-"La première différence est que le monde est entouré d'un mur : il faut donc "
-"modifier légèrement les parcours pour s'assurer que la buggle ne se cogne "
-"pas sur les bords. Le plus simple est de traiter la première case de la "
-"colonne en dehors de la boucle <code>for</code> (avant la boucle), et faire "
-"seulement <code>getWorldHeight()-1</code> pas dans la boucle."
+"Étant donné deux nombres entiers, retournez la plus grande valeur dans "
+"l'intervalle 10..20 inclus, ou retournez 0 si aucun des nombres n'est dans "
+"cet intervalle."
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:12
+#: src/lessons/welcome/bat/bool1/Max1020.html:5
msgid ""
-"The other difference is that the offset to apply between columns is not "
-"fixed, but written on the first cell of each column. To get the info as an "
-"integer, we can use:"
+"Note that Math.max(Int,Int):Int and Math.min(Int,Int):Int return the maximum "
+"and minimum of two integers"
msgstr ""
-"La seconde différence est que le décalage à effectuer entre les colonnes "
-"n'est pas fixe, mais écrit sur la première case de chaque colonne. Pour "
-"obtenir l'information sous forme d'un entier, on peut utiliser:"
+"Notez que Math.max(Int,Int):Int et Math.min(Int,Int):Int retournent "
+"respectivement le maximum et le minimum de deux entiers."
-#. type: Content of: <pre>
-#: src/lessons/welcome/array/basics/Array2.html:16
-#, no-wrap
-msgid "[!java]int offset = Integer.parseInt(readMessage())[/!][!python]offset = int( readMessage() )[/!][!scala]val offset = readMessage().toInt[/!]"
-msgstr "[!java]int decalage = Integer.parseInt(litMessage())[/!][!python]decalage = int( litMessage() )[/!][!scala]val decalage = litMessage().toInt[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:1
+msgid "MonkeyTrouble"
+msgstr "Problème de singe"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:18
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:3
msgid ""
-"<code>readMessage()</code> gets the message on the ground as a [!java|"
-"scala]String[/!][!python]string[/!], while <code>[!java]Integer.parseInt(str)"
-"[/!][!scala]str.toInt[/!][!python]int(str)[/!]</code> transforms the string "
-"<code>str</code> into an integer by <i>reading</i> it."
+"We have two monkeys, a and b, and the parameters aSmile and bSmile indicate "
+"if each is smiling. We are in trouble if they are both smiling or if "
+"neither of them is smiling. Return true if we are in trouble."
msgstr ""
-"<code>litMessage()</code> lit l'indication au sol sous forme d'une chaîne de "
-"caractères, \n"
-"tandis que <code>[!java]Integer.parseInt(ch)[/!][!scala]ch.toInt[/!][!"
-"python]int(ch)[/!]</code> \n"
-"transforme la chaîne <code>ch</code> en un entier en la <i>lisant</i>."
+"Nous avons deux singes, a et b, et les paramètres aSmile et bSmile indiquent "
+"s'ils sourient. Nous avons un problème s'ils sourient tous les deux en même "
+"temps, ou si aucun des deux ne sourit. Retournez vrai si nous avons un "
+"problème."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/NearHundred.html:1
+msgid "Near Hundred"
+msgstr "Presque 100"
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:22
+#: src/lessons/welcome/bat/bool1/NearHundred.html:2
msgid ""
-"Then, to pick the right color, the easier is to use the <code>%</code> "
-"(modulo) operator. For example, <code>(i + 5) % size</code> allows to "
-"retrieve the <code>i</code>th cell of an array of size <code>size</code> "
-"with an offset of <code>5</code>."
+"Given an int n, return true if it is within 10 of 100 or 200. [!java|"
+"scala]Note that Math.abs(n) returns the absolute value of a number.[/!] [!"
+"python]Note that math.fabs(n) returns the absolute value of a number. This "
+"function can only be used if you imported the math module.[/!]"
msgstr ""
-"Ensuite, pour trouver la bonne couleur à utiliser, le plus simple est "
-"d'utiliser l'opérateur <code>%</code> (modulo). Par exemple, <code>(i + 5) % "
-"taille</code> permet de trouver la <code>i</code>ieme case d'un tableau de "
-"taille <code>taille</code> quand on applique un décalage de <code>5</code> "
-"cases."
-
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:27
-msgid "You're up."
-msgstr "À vous de jouer."
+"Étant donné deux nombres entiers, retourner vrai si et seulement si la "
+"valeur est à moins de 10 de la valeur 100 ou de la valeur 200.\n"
+"[!java|scala]Remarquez que Math.abs(n) retourne la valeur absolue d'un "
+"nombre.[/!] \n"
+"[!python]Remarquez que math.fabs(n) retourne la valeur absolue d'un nombre. "
+"Remarquez également que vous ne pouvez utiliser cette fonction que si vous "
+"avez importé le module math.[/!]"
#. type: Content of: <h1>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:1
-msgid "Searching for a given value"
-msgstr "Chercher une valeur donnée"
+#: src/lessons/welcome/bat/bool1/ParotTrouble.html:1
+msgid "Parot Trouble"
+msgstr "Problème de perroquet"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/ParotTrouble.html:3
msgid ""
-"The goal of this exercise is to search the cell of a given value, and return "
-"its position."
+"We have a loud talking parrot. The \"hour\" parameter is the current hour "
+"time in the range 0..23. We are in trouble if the parrot is talking and the "
+"hour is before 7 or after 20. Return true if we are in trouble."
msgstr ""
-"L'objectif de cet exercice est de chercher la case contenant une valeur "
-"donnée, et de retourner sa position."
+"Nous avons un perroquet très bruyant. Le paramètre \"hour\" indique l'heure "
+"courante (dans l'intervalle [0;23]). Nous avons un problème si le perroquet "
+"parle avant 7h ou après 20h. Retournez vrai si nous avons un problème."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:5
-msgid ""
-"To that extend, you should fill the method <code>indexOf()</code>, which "
-"parameters are the array to explore, and the value to search. If the value "
-"<code>lookingFor</code> is not in the array <code>tab</code>, the method "
-"should return -1."
-msgstr ""
-"Pour cela, il vous faut remplir le corps de la méthode <code>indexOf()</"
-"code>. Ses paramètres sont le tableau <code>tab</code> à explorer et la "
-"valeur <code>lookingFor</code> à chercher. Si la valeur <code>lookingFor</"
-"code> n'est pas dans le tableau <code>tab</code>, la méthode doit renvoyer "
-"-1."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/PosNeg.html:1
+msgid "Positive Negative"
+msgstr "Positif Negatif"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:9
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/PosNeg.html:2
msgid ""
-"The idea of the algorithm is to sweep over the whole array, checking the "
-"value of each cell. If it's the searched value, you should return the index "
-"of the cell currently checked."
+"Given 2 int values, return true if one is negative and one is positive. "
+"Unless negative is true, then they both must be negative."
msgstr ""
-"L'idée de l'algorithme est de parcourir tout le tableau en vérifiant la "
-"valeur\n"
-"contenue dans chaque case. S'il s'agit de la valeur cherchée, vous devez\n"
-"renvoyer l'indice de la case actuellement explorée."
+"Étant donné deux entiers, retournez vrai si l'un d'entre eux est positif et "
+"l'autre négatif. Sauf si le paramètre negative est vrai, auquel cas il faut "
+"que les deux nombres soient négatifs."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:13
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/SleepIn.html:1
+msgid "SleepDay"
+msgstr "Grasse matinée"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/SleepIn.html:3
msgid ""
-"Remember that indices begin at 0 and not at 1. So, if there is 3 cells, "
-"their indices will be 0, 1 and 2. There would not be any cell numbered 3."
+"The parameter weekday is true if it is a weekday, and the parameter vacation "
+"is true if we are on vacation. We sleep in if it is not a weekday or we're "
+"on vacation. Return true if we sleep in."
msgstr ""
-"N'oubliez pas que les cases sont sont numérotées à partir de 0. Donc, si "
-"vous avez 3 cases, leurs indices seront 0, 1 et 2. Il n'y aura pas de case "
-"numérotée 3."
+"Le paramètre weekday est vrai si nous sommes un jour de semaine, et le "
+"paramètre vacation est vrai si nous sommes en vacances. Nous pouvons dormir "
+"ce matin s'il ne s'agit pas d'un jour de semaine ou si nous sommes en "
+"vacances. Retournez vrai si nous pouvons faire la grasse matinée."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:16
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/SumDouble.html:1
+msgid "Sum Double"
+msgstr "Somme doublée"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/SumDouble.html:2
msgid ""
-"Remember also that the amount of cells in an array can be retrieved using "
-"the <code>length</code> attribute. So, if your array is called <code>tab</"
-"code>, its size can be retrieved as <code>tab.length</code>. Note that "
-"there is no () after <code>length</code>. An attribute is a sort of variable "
-"embedded in another object (here, the array)."
+"Given two int values, return their sum. Unless the two values are the same, "
+"then return double their sum."
msgstr ""
-"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être "
-"retrouvé\n"
-"grâce à l'attribut <code>length</code>. Donc, si votre tableau s'appelle\n"
-"<code>tableau</code>, sa taille sera <code>tableau.length</code>. Notez "
-"qu'il\n"
-"n'y a pas de () après <code>length</code>. Un attribut est une sorte de\n"
-"variable embarquée dans un autre objet (ici, le tableau)."
+"Étant donné deux entiers, retournez leur somme. Sauf si les valeurs sont "
+"égales, auquel cas vous devez retourner le double de leur somme."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:21
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/AlarmClock.html:1
+msgid "AlarmClock"
+msgstr "Radio réveil"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/AlarmClock.html:2
msgid ""
-"So, the last value of an array is given by <code>tab[tab.length - 1]</code>."
+"Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a "
+"boolean indicating if we are on vacation, return a string of the form "
+"\"7:00\" indicating when the alarm clock should ring. Weekdays, the alarm "
+"should be \"7:00\" and on the weekend it should be \"10:00\". Unless we are "
+"on vacation -- then on weekdays it should be \"10:00\" and weekends it "
+"should be \"off\"."
msgstr ""
-"Donc, la dernière valeur d'un tableau est donnée par <code>tab[tab.length "
-"-1]</code>."
+"Étant donné le jour de la semaine, codé de la façon suivante : 0=Dimanche, "
+"1=Lundi, 2=Mardi, ... 6=Samedi, et un booléen vacation indiquant si nous "
+"sommes en vacances, retournez une chaîne de caractères de la forme \"7:00\" "
+"indiquant à quelle heure nous devons régler le radio-réveil. Les jours de la "
+"semaine, nous devons nous réveiller à 7h tandis que nous pouvons dormir "
+"jusqu'à 10h le week-end. Pendant les vacances, il nous faut nous lever à 10h "
+"la semaine tandis que le réglage pour le radio-réveil doit être \"off\" le "
+"week-end."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:23
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/AnswerCell.html:1
+msgid "AnswerCell"
+msgstr "Répondeur"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/AnswerCell.html:2
msgid ""
-"Remember also that the amount of cells in an array can be retrieved with the "
-"<code>len()</code> function. So, if your array is called <code>tab</code>, "
-"its size can be retrieved as <code>len(tab)</code>."
+"Your cell phone rings. Return true if you should answer it. Normally you "
+"answer, except in the morning you only answer if it is your mom calling. In "
+"all cases, if you are asleep, you do not answer."
msgstr ""
-"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être "
-"retrouvé\n"
-"grâce à la fonction <code>len()</code>. Donc, si votre tableau s'appelle\n"
-"<code>tableau</code>, sa taille sera <code>len(tableau)</code>."
+"Votre téléphone sonne. Renvoyez vrai si vous décrochez. Vous le faites "
+"habituellement, sauf le matin où vous ne répondez que si votre mère appelle. "
+"Dans tous les cas, vous ne répondez pas si vous dormez."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:27
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/BlueTicket.html:1
+msgid "BlueTicket"
+msgstr "Ticket bleu"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/BlueTicket.html:2
msgid ""
-"So, the last value of an array is given by <code>tab[ len(tab) - 1]</code>."
+"You have a blue lottery ticket, with ints a, b, and c on it. This makes "
+"three pairs, which we'll call ab, bc, and ac. Consider the sum of the "
+"numbers in each pair. If any pair sums to exactly 10, the result is 10. "
+"Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the "
+"result is 5. Otherwise the result is 0."
msgstr ""
-"Donc, la dernière valeur d'un tableau est donnée par <code>tab[ len(tab) "
-"-1]</code>."
+"Vous avez un ticket de loterie bleu, avec des entiers a, b et c inscrits "
+"dessus. Cela fait trois paires que l'on appellera ab, bc et ac. Considérez "
+"la somme des nombres de chaque paire. Si la somme de l'une des paires vaut "
+"exactement 10, le résultat est 10. Sinon, si la somme ab vaut exactement 10 "
+"de plus que les sommes bc ou ac, le résultat est 5. Sinon, le résultat est 0."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:1
-msgid "Index of the maximum value"
-msgstr "Indice de la valeur maximale"
+#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:1
+msgid "CaughtSpeeding"
+msgstr "Radar de vitesse"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:2
msgid ""
-"In this exercise, you must compute the index of the tab cell containing the "
-"biggest value."
+"You are driving a little too fast, and a police officer stops you. Write "
+"code to compute the result, encoded as an int value: 0=no ticket, 1=small "
+"ticket, 2=big ticket. If speed is 60 or less, the result is 0. If speed is "
+"between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the "
+"result is 2. Unless it is your birthday -- on that day, your speed can be 5 "
+"higher in all cases."
msgstr ""
-"Dans cet exercice, vous devez calculer l'indice de la case contenant la plus "
-"grande valeur du tableau."
+"Vous conduisez un peu trop vite et un officier de police vous arrête. "
+"Écrivez le code pour calculer le résultat, encodé sous forme d'un entier : "
+"0=pas d'amende, 1=petite amende, 2=grosse amende. Si votre vitesse est "
+"inférieure à 60, le résultat est 0. Si la vitesse est incluse entre 61 et 80 "
+"(inclus), le résultat est 1. Si la vitesse est 81 ou plus, le résultat est "
+"2. Tout ceci ne vaut que si ce n'est pas votre anniversaire aujourd'hui, car "
+"sinon, votre vitesse peut être supérieure de 5 dans tous les cas."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:5
-msgid ""
-"For that, fill the <code>indexOfMaximum()</code> method. Its parameter is "
-"the array to explore. Should the array contain the searched value several "
-"times, you should return the index of the first occurrence."
-msgstr ""
-"Pour cela, remplissez la méthode <code>indexOfMaximum()</code> dont le "
-"paramètre est le tableau à explorer. Si jamais la plus grande des valeurs du "
-"tableau est répétée plusieurs fois, votre méthode doit renvoyer la position "
-"de la première occurence."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/CigarParty.html:1
+msgid "CigarParty"
+msgstr "Cigares de fête"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:9
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/CigarParty.html:2
msgid ""
-"To solve this exercise, you should sweep over the whole array. For each "
-"value, if it's bigger than the biggest value you saw so far, you must save "
-"this new champion and its position. You will thus need 2 extra variables; "
-"the initial value of the champion could be the value of the first cell."
+"When squirrels get together for a party, they like to have cigars. A "
+"squirrel party is successful when the number of cigars is between 40 and 60, "
+"inclusive. Unless it is the weekend, in which case there is no upper bound "
+"on the number of cigars. Return true if the party with the"
msgstr ""
-"Pour résoudre cet exercice, vous devez parcourir le tableau. Pour chaque "
-"case,\n"
-"si sa valeur est plus grande que la plus grande des valeurs que vous avez\n"
-"rencontré jusque là, sauvegardez cette nouvelle championne et sa position. "
-"Il\n"
-"vous faut donc deux nouvelles variables; la valeur initiale de la "
-"championne\n"
-"pourrait être la valeur rangée dans la première case."
+"Quand les écureuils font la fête, ils aiment avoir des cigares. Une fête "
+"d'écureuils est réussie si le nombre de cigares est entre 40 et 60 (inclus). "
+"Sauf si c'est le week-end, auquel cas il n'y a pas de limite supérieure au "
+"nombre de cigares. Renvoyez vrai si la fête est réussie. "
#. type: Content of: <h1>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:1
-msgid "Average value"
-msgstr "Valeur moyenne"
+#: src/lessons/welcome/bat/bool2/DateFashion.html:1
+msgid "DateFashion"
+msgstr "Rendez-vous élégant"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:4
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/DateFashion.html:2
msgid ""
-"The objective of this exercise is to compute the average value of the "
-"integer values stored in an array."
+"You and your date are trying to get a table at a restaurant. The parameter "
+"\"you\" is the stylishness of your clothes, in the range 0..10, and \"date\" "
+"is the stylishness of your date's clothes. The result getting the table is "
+"encoded as an int value with 0=no, 1=maybe, 2=yes. If either of you is very "
+"stylish, 8 or more, then the result is 2 (yes). With the exception that if "
+"either of you has style of 2 or less, then the result is 0 (no). Otherwise "
+"the result is 1 (maybe)."
msgstr ""
-"L'objectif de cet exercice est de calculer la valeur moyenne d'un tableau de "
-"valeur entière."
+"Vous et votre compagne/compagnon essayez d'obtenir une table au restaurant. "
+"Le paramètre \"you\" est l'élégance de vos vêtements, dans l'intervalle "
+"[0,10], et \"date\" est l'élégance des vêtements de votre compagne/"
+"compagnon. Le résultat à obtenir la table est encodé comme une valeur "
+"entière avec 0=non, 1=peut-être et 2=oui. Si l'un de vous deux est très "
+"élégant (8 ou plus) alors le résultat est 2 (oui). Avec l'exception que si "
+"l'un de vous deux a un style de 2 ou moins, alors le résultat est 0 (no). "
+"Sinon, le résultat est 1 (peut-être)."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:6
-msgid ""
-"You have to fill the body of the method <code>average()</code> which takes "
-"as parameter the array of integers of which it computes and returns the "
-"average value. Please note that this method must return an integer."
-msgstr ""
-"Vous devez donc remplir le corps de la méthode <code>average()</code> qui "
-"prend en paramètre le tableau, et qui retourne en résultat la valeur "
-"moyenne. Notez bien que cette méthode doit renvoyer un entier."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/GreenTicket.html:1
+msgid "GreenTicket"
+msgstr "Ticket vert"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:8
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/GreenTicket.html:2
msgid ""
-"To compute the average value of an integer, it is necessary to traverse the "
-"whole array and to compute the sum of all its values (so you will need a "
-"variable to store this temporary result), then you have to divide this sum "
-"by the size of the array."
+"You have a green lottery ticket, with ints a, b, and c on it. If the numbers "
+"are all different from each other, the result is 0. If all of the numbers "
+"are the same, the result is 20. If two of the numbers are the same, the "
+"result is 10."
msgstr ""
-"Pour calculer la valeur moyenne d'un tableau, il faut parcourir l'ensemble "
-"des valeurs du tableau, en faire la somme (vous aurez donc besoin d'une "
-"variable pour conserver le résultat intermédiaire), puis diviser cette somme "
-"par le nombre de valeur contenu dans le tableau."
+"Vous avez un ticket de loterie vert, avec des entiers a, b et c inscrits "
+"dessus. Si les nombres sont tous différents les uns des autres, le résultat "
+"est 0. Si tous les nombres sont identiques, le résultat est 20. Si deux des "
+"nombres sont les mêmes, le résultat est 10."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:10
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/In1To10.html:1
+msgid "In1To10"
+msgstr "De 1 à 10"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/In1To10.html:2
msgid ""
-"In Java, you can get the size of an array <code>myarray</code> by consulting "
-"its <code>length</code> attribute (in other words, <code>myarray.length</"
-"code>). Notice that there is no parenthesis after <code>length</code>."
+"Given a number n, return true if n is in the range 1..10, inclusive. Unless "
+"\"outsideMode\" is true, in which case return true if the number is less or "
+"equal to 1, or greater or equal to 10."
msgstr ""
-"En Java, vous pouvez retrouver la taille d'un tableau <code>monTableau</"
-"code> en consultant son attribut <code>length</code> (autrement dit, "
-"<code>monTableau.length</code>). Notez qu'il n'y a pas de parenthèses après "
-"<code>length</code>."
+"Soit un nombre n, renvoyez vrai si n est dans l'intervalle [1,10]. Sauf si "
+"\"outsideMode\" est vrai, auquel cas renvoyez vrai si le nombre est plus "
+"petit ou égal à 1 ou bien s'il est plus grand ou égal à 10"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:15
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/InOrderEqual.html:1
+msgid "InOrderEqual"
+msgstr "Dans l'ordre croissant"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/InOrderEqual.html:2
msgid ""
-"In python, retrieving the size of an array <code>myarray</code> is as easy "
-"as calling <code>len(myarray)</code>."
+"Given three ints, a b c, return true if they are in strict increasing order, "
+"such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the "
+"exception that if \"equalOk\" is true, equality is allowed, such as 5 5 7 or "
+"5 5 5."
msgstr ""
-"En python, retrouver la taille d'un tableau est aussi simple qu'appeller "
-"<code>len(monTableau)</code>."
+"Soit trois entiers, a b c, renvoyez vrai si ils sont dans un ordre croissant "
+"strict, tel que 2 5 11, ou 5 6 7, mais pas 6 5 7 ou 5 5 7. Cependant, avec "
+"l'exception que si \"equalOk\" est vrai, alors l'égalité est permise, comme "
+"5 5 7 ou 5 5 5."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:1
-msgid "Maximal value"
-msgstr "Valeur maximale"
+#: src/lessons/welcome/bat/bool2/InOrder.html:1
+msgid "InOrder"
+msgstr "Dans l'ordre"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/InOrder.html:2
msgid ""
-"In this exercise, you must compute the maximal value contained in an array. "
-"For that, fill the <code>maximum()</code> method, which parameter is the "
-"array to explore."
+"Given three ints, a b c, return true if b is greater than a, and c is "
+"greater than b. However, with the exception that if \"bOk\" is true, b does "
+"not need to be greater than a."
msgstr ""
-"Dans cet exercice, vous devez retrouver le maximum des valeurs stockées dans "
-"un tableau. Pour cela, remplissez le corps de la méthode <code>maximum()</"
-"code>, dont le paramètre est le tableau à explorer."
+"Soit trois entiers, a b c, renvoyez vrai si b est plus grand que a, et si c "
+"est plus grand que b. Cependant, avec l'exception que si \"bOk\" est vrai, b "
+"n'a pas besoin d'être plus grand que a."
-#. type: Content of: <p>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:7
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/LastDigit2.html:1
+msgid "LastDigit 2"
+msgstr "L'autre dernier chiffre"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/LastDigit2.html:2
msgid ""
-"To compute this value, sweep over the whole parameter. For each value, if "
-"it's bigger than the biggest value you saw so far, you must save this value "
-"somewhere to remember it afterward. You thus need an extra variable, which "
-"can be initialized to the value of the first array cell."
+"Given three ints, a b c, return true if two or more of them have the same "
+"rightmost digit. The ints are non-negative. Note: the % \"mod\" operator "
+"computes the remainder, e.g. 17 % 10 is 7."
msgstr ""
-"Pour résoudre cet exercice, parcourez le tableau. Pour chaque case, si sa\n"
-"valeur est plus grande que la plus grande des valeurs que vous avez "
-"rencontré\n"
-"jusque là, sauvegardez cette nouvelle championne pour retrouver sa valeur "
-"plus\n"
-"tard. Il vous faut donc une nouvelle variable, dont la valeur initiale peut "
-"être\n"
-"la valeur de la première case du tableau."
+"Soit trois entiers, a b c, renvoyez vrai si deux ou plus d'entre eux ont le "
+"même chiffre le plus à droite. Les entiers sont positifs. Note: l'opérateur "
+"% \"mod\" calcule le reste, i.e. 17 % 10 vaut 7."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:1
-msgid "Occurrence of a value"
-msgstr "Occurrences d'une valeur"
+#: src/lessons/welcome/bat/bool2/LessBy10.html:1
+msgid "LessBy10"
+msgstr "Plus petit par 10"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/LessBy10.html:2
msgid ""
-"In this exercise, you must compute the amount of occurrences of a given "
-"value in an array (that is, the amount of time that this value appears in "
-"the array). For that, fill the <code>occurrences()</code> method, which "
-"returns the number of occurrence of <code>lookingFor</code> in <code>tab</"
-"code>."
+"Given three ints, a b c, return true if one of them is 10 or more less than "
+"one of the others."
msgstr ""
-"Dans cet exercice, il vous faut calculer le nombre d'occurrences d'une "
-"valeur donnée, c'est à dire le nombre de fois que cette valeur apparaît dans "
-"le tableau. Pour cela, remplissez le corps de la méthode "
-"<code>occurrences()</code>, qui retourne le nombre d'occurrences de la "
-"valeur <code>lookingFor</code> dans le tableau <code>tab</code>."
+"Soit trois entiers, a b c, renvoyez vrai si l'un d'entre eux est plus petit "
+"de 10 ou plus que l'un des autres."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/Main.html:1
+msgid "Boolean (even more) fun"
+msgstr "Encore des jeux booléens"
#. type: Content of: <p>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:8
+#: src/lessons/welcome/bat/bool2/Main.html:3
msgid ""
-"To compute this value, simply sweep over the array counting for the amount "
-"of cells containing the searched value. You thus need an extra variable for "
-"that."
+"A very good introduction to this type is available here: http://javabat.com/"
+"doc/ifboolean.html."
msgstr ""
-"Pour calculer cette valeur, parcourez simplement le tableau en comptant le\n"
-"nombre de cases contenant la valeur cherchée que vous rencontrez. Il vous "
-"faut\n"
-"donc un paramètre supplémentaire pour cela."
+"Une très bonne introduction à ce type est disponible ici : http://javabat."
+"com/doc/ifboolean.html."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/array123/Array123.html:1
-msgid "Array123"
-msgstr "Tableau123"
+#: src/lessons/welcome/bat/bool2/MaxMod5.html:1
+msgid "MaxMod5"
+msgstr "Maximum Mod 5"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/array123/Array123.html:2
+#: src/lessons/welcome/bat/bool2/MaxMod5.html:2
msgid ""
-"Given an array of integers, return true if .. 1, 2, 3, .. appears in the "
-"array somewhere."
+"Given two int values, return whichever value is larger. However if the two "
+"values have the same remainder when divided by 5, then the return the "
+"smaller value. However, in all cases, if the two values are the same, return "
+"0. Note: the % \"mod\" operator computes the remainder, e.g. 7 % 5 is 2."
msgstr ""
-"Soit un tableau d'entiers, renvoyez vrai si .. 1, 2, 3, .. apparaissent "
-"quelquepart dans le tableau."
+"Soit deux valeurs entières, renvoyez la plus grande des deux. Cependant, si "
+"les deux valeurs ont le même reste quand elles sont divisées par 5, alors "
+"renvoyez la plus petite des deux. Cependant, dans tous les cas, si les deux "
+"valeurs sont égales, renvoyez 0. Note: l'opérateur % \"mod\" calcule le "
+"reste, i.e. 7 % 5 vaut 2."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/array667/Array667.html:1
-msgid "Array667"
-msgstr "Tableau667"
+#: src/lessons/welcome/bat/bool2/NearTen.html:1
+msgid "NearTen"
+msgstr "Près de dix"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/array667/Array667.html:2
+#: src/lessons/welcome/bat/bool2/NearTen.html:2
msgid ""
-"Given an array of integers, return the number of times that two 6's are next "
-"to each other in the array. Also count instances where the second \"6\" is "
-"actually a 7."
+"Given a non-negative number \"num\", return true if num is within 2 of a "
+"multiple of 10. Note: (a % b) is the remainder of dividing a by b, so (7 % "
+"5) is 2."
msgstr ""
-"Soit un tableau d'entiers, renvoyez le nombre de fois que deux 6 sont l'un à "
-"la suite de l'autre dans le tableau. Comptez également le nombre de fois où "
-"le deuxième \"6\" est en fait un 7."
+"Soit un entier positif \"num\", renvoyez vrai si num est à moins de 2 d'un "
+"multiple de 10. Note: ( a % b ) est le reste de la division de a par b, donc "
+"(7 % 5) vaut 2."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:1
-msgid "ArrayCount9"
-msgstr "Comptage de 9"
+#: src/lessons/welcome/bat/bool2/RedTicket.html:1
+msgid "RedTicket"
+msgstr "Ticket rouge"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:2
-msgid "Given an array of integers, return the number of 9's in the array."
-msgstr "Soit un tableau d'entiers, renvoyez le nombre de 9 dans ce tableau."
+#: src/lessons/welcome/bat/bool2/RedTicket.html:2
+msgid ""
+"You have a red lottery ticket showing ints a, b, and c, each of which is 0, "
+"1, or 2. If they are all the value 2, the result is 10. Otherwise if they "
+"are all the same, the result is 5. Otherwise so long as both b and c are "
+"different from a, the result is 1. Otherwise the result is 0."
+msgstr ""
+"Vous avez un ticket de loterie rouge comportant trois entiers a, b et c. "
+"Chacun d'entre eux est 0, 1, ou 2. Si ils sont tous comme valeur 2, le "
+"résultat vaut 10. Sinon, si ils sont égaux, le résultat vaut 5. Sinon, tant "
+"que b et c sont différents de a, le résultat vaut 1. Sinon, le résultat est "
+"0."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:1
-msgid "ArrayFront9"
-msgstr "Tableau commençant par 9"
+#: src/lessons/welcome/bat/bool2/ShareDigit.html:1
+msgid "ShareDigit"
+msgstr "Chiffre partagé"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:2
+#: src/lessons/welcome/bat/bool2/ShareDigit.html:2
msgid ""
-"Given an array of integers, return true if one of the first 4 elements in "
-"the array is a 9. The array length may be less than 4."
+"Given two ints, each in the range 10..99, return true if there is a digit "
+"that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e."
+"g. n/10, gives the left digit while the % \"mod\" n%10 gives the right "
+"digit.)"
msgstr ""
-"Soit un tableau d'entiers, renvoyez vrai si l'un des 4 premiers éléments "
-"dans ce tableau est un 9. Le tableau peut contenir moins de 4 éléments."
+"Soit deux entiers, chacun étant dans l'intervalle [10,99], renvoyez vrai si "
+"il y a un chiffre qui apparait dans les deux nombres, comme 2 dans 12 et 23. "
+"(Note: division, i.e. n/10, renvoie le chiffre à gauche tant que le % \"mod"
+"\" n%10 renvoye le bon chiffre.)"
#. type: Content of: <h1>
-#: src/lessons/welcome/array/notriples/NoTriples.html:1
-msgid "NoTriples"
-msgstr "Pas de triplet"
+#: src/lessons/welcome/bat/bool2/SortaSum.html:1
+msgid "SortaSum"
+msgstr "Sommes d'entiers"
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/notriples/NoTriples.html:2
+#: src/lessons/welcome/bat/bool2/SortaSum.html:2
msgid ""
-"Given an array of integers, we'll say that a triple is a value appearing 3 "
-"times in a row in the array. Return true if the array does not contain any "
-"triples."
+"Given 2 ints, a and b, return their sum. However, sums in the range 10..19 "
+"inclusive, are forbidden, so in that case just return 20."
msgstr ""
-"Soit un tableau d'entiers, on dira qu'un triplet est une valeur qui apparait "
-"3 fois à la suite dans le tableau. Renvoyez vrai si le tableau ne contient "
-"pas de triplet."
+"Soit deux entiers, a et b, renvoyez leur somme. Cependant, les sommes entre "
+"10 et 19 inclus sont interdites, dans ce cas, renvoyez 20."
#. type: Content of: <h1>
-#: src/lessons/welcome/array/has271/Has271.html:1
-msgid "Has271"
-msgstr "Contient 271"
-
-#. type: Content of: <p>
-#: src/lessons/welcome/array/has271/Has271.html:2
-msgid ""
-"Given an array of integers, return true if it contains a 2, 7, 1 pattern -- "
-"a value, followed by the value plus 5, followed by the initial value minus "
-"1. So, 2,7,1 is such a pattern because 7 is 5+2 and 1 is 2-1. 3,8,2 is also "
-"such a pattern."
-msgstr ""
-"Soit un tableau d'entiers, renvoyez vrai si il contient un motif 2,7,1 -- "
-"une valeur, suivie de cette valeur plus 5, suivie par cette valeur moins "
-"1. \n"
-"Par exemple, 2,7,1 est un tel motif car 7=5+2 et 1=2-1. 3,8,2 est un autre "
-"motif correspondant."
+#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:1
+msgid "SquirrelPlay"
+msgstr "Jeu de l'écureuil"
-#. type: Content of: <p>
-#: src/lessons/welcome/array/has271/Has271.html:6
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:2
msgid ""
-"Additionally the 271 counts even if the \"1\" differs by 2 or less from the "
-"correct value."
+"The squirrels in Palo Alto spend most of the day playing. In particular, "
+"they play if the temperature is between 60 and 90 (inclusive). Unless it is "
+"summer, then the upper limit is 100 instead of 90. Given an int temperature "
+"and a boolean isSummer, return true if the squirrels play and false "
+"otherwise."
msgstr ""
-"De plus, le 271 compte même si le \"1\" diffère de 2 ou moins de la valeur "
-"correcte.<"
+"Les écureuils dans Palo Alto passent la majorité de leurs journées à jouer. "
+"En particulier, ils jouent si la température est entre 60 et 90 (inclus). A "
+"moins que ce soit l'été, alors la limite supérieure est de 100 au lieu de "
+"90. Soit une température entière et un booléen isSummer.\n"
+"Renvoyez vrai si les écureuils jouent et faux sinon."
#. type: Content of: <h1>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:1
-msgid "PancakeWorld"
-msgstr "Monde des crêpes"
-
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:3
-msgid "This universe is very simple, with only five functions provided."
-msgstr "Cet univers est très simple, avec seulement cinq fonctions fournies."
-
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:5
-#, no-wrap
-msgid "[!java]int [/!]getStackSize() [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getTaillePile() [!scala]:Int[/!]"
+#: src/lessons/welcome/bat/bool2/TeaParty.html:1
+msgid "TeaParty"
+msgstr "Goûter"
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:6
+#: src/lessons/welcome/bat/bool2/TeaParty.html:2
msgid ""
-"Returns the size of the stack, that is the amount of pancakes it contains."
+"We are having a party with amounts of tea and candy. Return the int outcome "
+"of the party encoded as 0=bad, 1=good, or 2=great. A party is good (1) if "
+"both tea and candy are at least 5. However, if either tea or candy is at "
+"least double the amount of the other one, the party is great (2). However, "
+"in all cases, if either tea or candy is less than 5, the party is always bad "
+"(0)."
msgstr ""
-"Renvoie la taille du tas de crêpes, c'est à dire le nombre de crêpes qui le "
-"compose."
+"Nous avons un goûter avec quantité de thé et de bonbons. Renvoyez l'entier "
+"'outcome' du goûter encodé comme 0=mauvais, 1=bien, ou 2=excellent. Un "
+"goûter est bien (1) si le thé et les bonbons sont à 5 au moins. Cependant, "
+"si soit le thé soit les bonbons est à au moins le double de la quantité de "
+"l'autre, le goûter est excellent (2). Cependant, dans tous les cas, si soit "
+"le thé soit les bonbons sont à moins de 5, le goûter est toujours mauvais "
+"(0)."
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:8
-#, no-wrap
-msgid "[!java]int [/!]getPancakeRadius([!java]int [/!]rank[!scala]:Int[/!]) [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getRayonCrepe([!java]int [/!]rang[!scala]:Int[/!]) [!scala]:Int[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/TeenSum.html:1
+msgid "TeenSum"
+msgstr "Somme d'ados"
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:9
+#: src/lessons/welcome/bat/bool2/TeenSum.html:2
msgid ""
-"Returns the radius of the pancake passed as argument, with the rank of the "
-"top-most pancake being 0."
+"Given 2 ints, a and b, return their sum. However, \"teen\" values in the "
+"range 13..19 inclusive, are extra lucky. So if either value is a teen, just "
+"return 19."
msgstr ""
-"Renvoie le rayon de la crêpe passée en argument, sachant que le rang de la "
-"crêpe du haut est 0."
+"Étant donné deux nombres entiers (a et b), renvoyez leur somme. Cependant, "
+"les valeurs ados (dans l'intervalle [13;19]) sont particulièrement "
+"chanceuses. Donc, si l'un des nombres est ado, renvoyez simplement 19."
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:11
-#, no-wrap
-msgid "[!java]boolean [/!]isPancakeUpsideDown([!java]int [/!]rank[!scala]:Int[/!]) [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estCrepeRetournee([!java]int [/!]rang[!scala]:Int[/!]) [!scala]:Boolean[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/TwoAsOne.html:1
+msgid "TwoAsOne"
+msgstr "Deux pour un"
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:12
+#: src/lessons/welcome/bat/bool2/TwoAsOne.html:2
msgid ""
-"Returns whether the pancake passed as argument upside-down, that is, if its "
-"burned side is on top. As usual, the top-most pancake is of rank 0."
+"Given three ints, a b c, return true if it is possible to add two of the "
+"ints to get the third."
msgstr ""
-"Renvoie ssi la crêpe passée en paramètre (la crêpe du haut étant de rang 0) "
-"est à l'envers, c'est-à-dire si sa face brulée est en haut."
+"Soit trois entiers, a b c, renvoyez vrai si il est possible d'en additionner "
+"deux d'entre eux pour obtenir le troisième."
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:14
-#, no-wrap
-msgid "[!java]void [/!]flip([!java]int [/!]amount[!scala]:Int[/!])"
-msgstr "[!java]void [/!]retourne([!java]int [/!]quantité[!scala]:Int[/!])"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:1
+msgid "WithoutDoubles"
+msgstr "Sans double"
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:15
+#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:2
msgid ""
-"Flips the <code>amount</code> first pancakes composing the stack, from the "
-"top of it."
+"Return the sum of two 6-sided dice rolls, each in the range 1..6. However, "
+"if noDoubles is true, if the two dice show the same value, increment one die "
+"to the next value, wrapping around to 1 if its value was 6."
msgstr ""
-"Retourne les <code>quantité</code> premières crêpes de la pile, en partant "
-"du sommet de celle-ci."
-
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:17
-#, no-wrap
-msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estTriee() [!scala]:Boolean[/!]"
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:18
-msgid "Returns whether the pancake stack is correctly sorted."
-msgstr "Renvoie si la pile de crêpes est correctement triée."
-
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:20
-#, no-wrap
-msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]"
+"Renvoyez la somme du jet de deux dés à six faces. Cependant, si noDoubles "
+"est vrai et que les deux dés ont la même valeur, incrémentez l'un des dés à "
+"la valeur suivante, en le mettant à 1 si sa valeur était 6."
#. type: Content of: <h1>
-#: src/lessons/sort/pancake/Main.html:1
-#: src/lessons/sort/pancake/BasicPancake.html:1
-msgid "Pancake Sorting"
-msgstr "Trier des crêpes"
+#: src/lessons/bat/string1/Main.html:1
+msgid "String fun"
+msgstr "String fun"
#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:3
+#: src/lessons/bat/string1/Main.html:3
msgid ""
-"This activity is inspired by a problem first introduced in 1975 by Harry "
-"Dweighter in the American Mathematical Monthly. The question is not only to "
-"sort the pancakes, but to determine <code>f(n)</code> the <i>minimal</i> "
-"amount of flips mandated to sort any stack of size <code>n</code>."
+"Strings are the simplest of the complex data types :) They provide several "
+"operations, such as getting the length of the string, or a substring of it.."
msgstr ""
-"Cette activité est inspirée d'un problème introduit pour la première fois en "
-"1975 par Harry Dweighter dans le journal de mathématique «American "
-"Mathematical Monthly». La question n'est pas tant de trier les crêpes que de "
-"déterminer <code>f(n)</code>, le nombre <i>minimal</i> de retournements "
-"nécessaires pour trier n'importe quelle pile de taille <code>n</code>. "
+"Les chaînes de caractères (\"String\") sont les plus simples des types de "
+"données complexes :) Elles fournissent différentes opérations, comme obtenir "
+"la longueur de la chaîne ou une sous-chaîne..."
#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:7
+#: src/lessons/bat/string1/Main.html:7
msgid ""
-"This problem is now famous because Bill Gates authored (with C. "
-"Papadimitriou) his only scientific publication in 1979 on this topic, "
-"providing a faster algorithm and proving that <code>17n/16 ≤ f(n) ≤ (5n"
-"+5)/3</code>. This was the only publication of Bill Gates before he "
-"invented Windows and became rich."
+"A very good introduction to this type is available here: http://javabat.com/"
+"doc/string.html."
msgstr ""
-"Ce problème est maintenant célèbre car Bill Gates a publié son seul article "
-"scientifique sur ce sujet (avec C. Papadimitriou). Ils ont proposé un "
-"algorithme plus rapide et démontré ainsi que <code>17n/16 ≤ f(n) ≤ (5n+5)</"
-"code>. Ce fut la seule publication de Bill Gates avant qu'il n'invente "
-"Windows et devienne riche. "
+"Une très bonne introduction à ce type est disponible ici : http://javabat."
+"com/doc/string.html."
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:11
-msgid ""
-"Then, David X. Cohen, the inventor of the Futurama comics with many "
-"mathematical references, introduced the variant with burnt pancakes and "
-"studied its complexity with Manuel Blum in 1993."
-msgstr ""
-"Par la suite, David X. Cohen, l'inventeur du dessin animé Futurama aux "
-"nombreuses références mathématiques, introduit en 1993 la variante des "
-"crêpes brulées et étudie sa complexité avec Manuel Blum."
+#. type: Content of: <h3>
+#: src/lessons/bat/string1/short_desc.html:1
+msgid "Small exercises about strings"
+msgstr "Petits exercices sur les chaînes"
#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:14
+#: src/lessons/bat/string1/short_desc.html:3
msgid ""
-"An article of 2012 (by L. Bulteau, G. Fertin and I. Rusu) proved that "
-"determining the minimal amount of flips to sort the stack is a NP-complete "
-"problem. Naturally, the stack sorting problem is not NP-complete since it "
-"can be solved in 2n-3 steps with the naive algorithm and (5n+5)/3 steps with "
-"the Gates algorithm. That's determining the minimal amount of steps that is "
-"NP."
+"These are some training exercises around strings. But unfortunately, its "
+"integration within PLM is still ongoing."
msgstr ""
-"Un article de 2013 (par L. Bulteau, G. Fertin and I. Rusu) a prouvé que ce "
-"problème est NP-Complet, c'est à dire qu'il n'existe pas d'algorithme "
-"efficace pour déterminer le nombre minimal de retournements pour toute "
-"taille de pile. Naturellement, le problème du tri de la pile n'est pas NP-"
-"complet en lui-même puisqu'on peut le résoudre en 2n-3 étapes avec "
-"l'algorithme naïf et (5n+5)/3 étapes avec l'algorithme de Gates. C'est la "
-"détermination du nombre minimal de coups qui est NP."
+"Il s'agit d'exercices d'entraînement au sujet des chaînes de caractères. "
+"Mais malheureusement, leur intégration à PLM est encore en cours."
#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:19
-msgid "Further information can be found on the wikipedia page, as usual."
-msgstr ""
-"Pour plus d'information, référez vous à la page anglophone de wikipedia "
-"(http://en.wikipedia.org/wiki/Pancake_sorting) ou à cette page, très bien "
-"faite: http://eljjdx.canalblog.com/archives/2013/02/03/26309722.html"
+#: src/lessons/bat/string1/short_desc.html:6
+msgid "Please be patient with us."
+msgstr "Merci de votre patience."
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:22
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/AltPairs.html:1
+msgid "AltPairs"
+msgstr "Sans les paires"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/AltPairs.html:2
msgid ""
-"This activity is also integrated to CSIRL (my repository of <i>free</i> "
-"unplugged activities to introduce computer science, available at http://www."
-"loria.fr/~quinson/Mediation/SMN/), and it may be interesting to run the "
-"unplugged activities before implementing these algorithms in PLM."
+"Given a string, return a string made of the chars at indexes 0,1, 4,5, "
+"8,9 ... so \"kittens\" yields \"kien\"."
msgstr ""
-"Cette activité est également intégrée à SMN (mon dépot d'activités "
-"débranchées <i>libres</i> pour introduire la science informatique, "
-"disponible à l'adresse http://www.loria.fr/~quinson/Mediation/SMN/), et il "
-"peut être intéressant de faire les activités débranchées avant d'implémenter "
-"ces algorithmes dans PLM."
+"Soit une chaîne de caractères, renvoyez la chaîne composée des caractères "
+"aux index 0,1,4,5,8,9 ... par exemple \"kittens\" devient \"kien\"."
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/Main.html:33
-msgid "A temporal view similar to the sorting universe could be helpful"
-msgstr ""
-"Une vue temporelle comme celle de l'univers des tris pourraît être pratique."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/FrontTimes.html:1
+msgid "FrontTimes"
+msgstr "Multiplication de début"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/Main.html:34
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/FrontTimes.html:2
msgid ""
-"Other exercises, for example on the Cohen's algorithm, or on the other ones."
+"Given a string and a non-negative int n, we'll say that the front of the "
+"string is the first 3 chars, or whatever is there if the string is less than "
+"length 3. Return n copies of the front;"
msgstr ""
-"D'autres exercices, par exemple sur l'algorithme de Cohen ou sur d'autres."
-
-#. type: Content of: <h3>
-#: src/lessons/sort/pancake/short_desc.html:1
-msgid "The pancake problem"
-msgstr "Le crépier psychorigide"
+"Soit une chaîne de caractère et un entier n.\n"
+"On définit le début d'une chaîne de caractère comme les trois premiers "
+"caractères, ou tout ce qu'il y a si la chaîne a une longueur de moins de 3.\n"
+"Renvoyez n copies du début de la chaîne."
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/short_desc.html:3
-msgid "Help the poor psychorigid pancakes' chef to sort its pancake stack!"
-msgstr "Aidez le pauvre crépier psychorigide à trier sa pile de crêpes !"
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/Last2.html:1
+msgid "Last2"
+msgstr "Deux derniers"
#. type: Content of: <p>
-#: src/lessons/sort/pancake/short_desc.html:5
+#: src/lessons/bat/string1/Last2.html:3
msgid ""
-"This funny problem leads to algorithms that are somewhat more challenging to "
-"implement. You are supposed to master the bases of programming and some "
-"sorting algorithms to take this lesson."
+"Given a string, return the amount of times that the two last letters appear "
+"as a substring of the string. So \"hixxxhi\" yields 1 (we won't count the "
+"end substring) while \"aaaNaa\" yields 2 (substrings may overlap)."
msgstr ""
-"Ce problème amusant débouche sur des algorithmes un peu plus compliqués à "
-"implémenter. Vous devez maîtriser les bases de la programmation ainsi que "
-"quelques algorithmes de tri avant de tenter cette leçon."
+"Étant donné une chaîne de caractères, retournez le nombre de fois que les "
+"deux\n"
+"dernières lettres apparaissent. Par exemple, \"hixxxhi\" renvoie 1 (on ne "
+"compte pas la dernière sous-chaîne) tandis que \"aaaNaa\" renvoie 2 (les "
+"occurences peuvent se chevaucher partiellement)."
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:3
-msgid ""
-"The pancake sorting problem this is a simple puzzle where you have a set of "
-"pancakes, each of differing size. The chef cooking the pancake is a bit "
-"psychorigid: he hates when the pancakes are not correctly sorted on the "
-"plate. He loves when they are correctly ordered, with the small ones over "
-"the larger ones. As every pancake maker, he masters the pancake flipping "
-"with his spatula. He can flip the pancake on top of the stack, or even "
-"several pancakes at once. The thing is that he has only one plate and the "
-"table is too dirty to place pancakes on it, even temporary. The only allowed "
-"operation is to flip some pancakes that are on top of the stack."
-msgstr ""
-"Le problème du tri des crêpes est un puzzle simple où vous avez une pile de\n"
-"crêpes, toutes de taille différente. Le crêpier étant légèrement "
-"psychorigide,\n"
-"il déteste quand ses crêpes ne sont pas bien ordonnées dans l'assiette. Il "
-"ne se\n"
-"sent bien que quand elles sont bien rangées, avec les petites au dessus des\n"
-"grandes. Comme tous les crêpiers, il est passé maître dans l'art du "
-"retournement\n"
-"de crêpes à la spatule. Il peut retourner une crêpe au sommet de la pile, "
-"ou\n"
-"même plusieurs à la fois. Le truc est qu'il n'a qu'une seule assiette et que "
-"la\n"
-"table est trop sale pour poser des crêpes dessus, même temporairement. La "
-"seule\n"
-"opération autorisée est alors de retourner un certain nombre de crêpes au "
-"sommet\n"
-"de la pile."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringBits.html:1
+msgid "StringBits"
+msgstr "Éclats de chaîne"
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:12
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringBits.html:2
msgid ""
-"Your work is to help this poor guy sorting his stack by flipping the "
-"pancakes. Each pancake is defined by its radius and rank within the stack, "
-"where the bottom pancake is at rank 0, and the one above at rank 1."
+"Given a string, return a new string made of every other char starting with "
+"the first, so \"Hello\" yields \"Hlo\"."
msgstr ""
-"Vous devez aider ce pauvre homme à trier sa pile en retournant des\n"
-"crêpes. Chaque crêpe est définie par son rayon et son rang dans la pile. La "
-"pile\n"
-"la plus basse est de rang 0, et celle placée au dessus d'elle est de rang 1."
+"Étant donné une chaîne de caractères, retournez une nouvelle chaîne formée "
+"en\n"
+"prenant un caractère sur deux dans le paramètre, en commençant avec le "
+"premier\n"
+"caractère. Ainsi, \"Bonjour\" donne \"Bnor\"."
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:16
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringMatch.html:1
+msgid "StringMatch"
+msgstr "Comparaison de chaînes"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringMatch.html:2
msgid ""
-"Note that you can play physically with pieces of paper or wood at first to "
-"get the grasp on this problem. This is even one of the activities that I use "
-"in my CS-IRL (computer science in real life) project to introduce the "
-"concept of algorithm to absolute beginners that wonder about our science. "
-"More information at http://www.loria.fr/~quinson/Mediation/SMN/ (in French)."
+"Given 2 strings, a and b, return the number of the positions where they "
+"contain the same length 2 substring. So \"xxcaazz\" and \"xxbaaz\" yields 3, "
+"since the \"xx\", \"aa\", and \"az\" substrings appear in the same place in "
+"both strings."
msgstr ""
-"Il est conseillé de commencer par jouer physiquement avec des bouts de "
-"papier ou\n"
-"de carton pour bien comprendre le problème. C'est même l'une des activités "
-"que\n"
-"j'utilise dans mon projet SMN (Sciences Manuelles du Numérique) pour "
-"introduire\n"
-"le concept d'algorithme aux débutants curieux de notre science. Pour plus\n"
-"d'information, allez visiter le site du projet: http://www.loria.fr/~quinson/"
-"Mediation/SMN/ "
+"Soit deux chaînes de caractères a et b.\n"
+"Renvoyez le nombre de position où elles contiennent la même sous-chaîne de "
+"longueur 2.\n"
+"Ainsi, \"xxcaazz\" et \"xxbaaz\" renvoient 3, puisque les sous-chaînes \"xx"
+"\", \"aa\", et \"az\" apparaissent dans les mêmes emplacement dans les deux "
+"chaînes."
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:22
-msgid "I don't get it. I need some help."
-msgstr "Je suis perdu, j'ai besoin d'aide."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringSplosion.html:1
+msgid "StringSplosion"
+msgstr "Explosion de chaîne"
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:23
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringSplosion.html:2
msgid ""
-"You should try to first move the largest pancake to the bottom, and then the "
-"largest but one pancake on top of it, and then the one just smaller on top, "
-"and so on."
+"Given a non-empty string like \"Code\" return a string like \"CCoCodCode\"."
msgstr ""
-"Vous devez tout d'abord parvenir à placer la plus grande crêpe en bas de la "
-"pile et ensuite placer celle juste plus petite au dessus, puis celle plus "
-"petite et ainsi de suite."
+"Soit une chaîne de caractères non vide comme \"Code\".\n"
+"Renvoyez une chaîne de caractères comme \"CCoCodCode\"."
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:27
-msgid "The first tip was not enough. I need another one."
-msgstr "Ce premier indice n'était pas suffisant, j'ai besoin de plus d'aide."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringTimes.html:1
+msgid "StringTimes"
+msgstr "Multiplication de chaînes"
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:28
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringTimes.html:2
msgid ""
-"So first, you need to move the largest pancake at the bottom of the stack."
+"Given a string and a non-negative int n, return a larger string that is n "
+"copies of the original string."
msgstr ""
-"Il vous faut donc amener la plus grande des crêpes tout en bas de la pile."
+"Soit une chaîne et un entier n positif.\n"
+"Renvoyez une chaîne plus grande qui consiste en n copies de la chaîne "
+"originale."
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:29
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringX.html:1
+msgid "StringX"
+msgstr "Chaîne X"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringX.html:2
msgid ""
-"Can you imagine a situation in which you can easily bring this damn large "
-"pancake to the bottom?"
+"Given a string, return a version where all the \"x\" have been removed. "
+"Except an \"x\" at the very start or end should not be removed."
msgstr ""
-"Est ce que vous pouvez imaginer une situation où il est facile d'emener "
-"cette satanée grande crêpe tout en bas ?"
+"Soit une chaîne de caractère, renvoyez une version où tous les \"x\" ont été "
+"supprimés.\n"
+"Seuls les \"x\" au tout début ou en toute fin ne doivent pas être supprimés."
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:30
-msgid "How could you reach this situation from the current one?"
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringYak.html:1
+msgid "StringYak"
+msgstr "String Yak"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringYak.html:2
+msgid ""
+"Suppose the string \"yak\" is unlucky. Given a string, return a version "
+"where all the \"yak\" are removed, but the \"a\" can be any char. The \"yak"
+"\" strings will not overlap."
msgstr ""
-"Et comment pourriez vous parvenir à cette situation à partir de la situation "
-"courante?"
+"La chaîne \"yak\" n'a pas de chance. Soit une chaîne de caractères, renvoyez "
+"une version où tous les \"yak\" sont supprimées (quel que soit le caractère "
+"à la place du 'a'). Les différentes chaînes \"yak\" ne se chevauchent pas."
#. type: Content of: <h1>
-#: src/lessons/sort/pancake/BurnedPancake.html:1
-msgid "Burned Pancakes"
-msgstr "Crêpes brulées"
+#: src/lessons/welcome/array/basics/Array1.html:1
+msgid "[!java|scala]Arrays[/!][!python]Lists[/!] and Knotting"
+msgstr "[!java|scala]Tableaux[/!][!python]Listes[/!] et tricot"
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BurnedPancake.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/basics/Array1.html:3
msgid ""
-"Hard blow for the chef! The pancakes got burnt on one side! There is no way "
-"he can deliver a stack of pancakes with visibly burnt pancakes! You've got "
-"to help him ensuring that no pancake is upside-down while sorting his stack."
+"The goal of this exercise is to reproduce the pattern of the first row in "
+"the other rows with a shift of one cell (see the Objective tab for details). "
+"The biggest difference between this exercise and the others we had on "
+"patterns is that you have to read the pattern (on first row) before "
+"reproducing it. You cannot do otherwise because the same code will be "
+"executed on three different worlds, each of them having a specific pattern."
msgstr ""
-"Coup dur pour le crèpier! Les crêpes ont brulé sur une face! Il est "
-"strictement impossible qu'il serve une pile de crêpes où l'on voit la face "
-"brulée! Vous devez absolument l'aider à s'assurer qu'aucune face visible ne "
-"soit brulée tandis qu'il trie sa pile."
+"L'objectif de cet exercice est de reproduire le motif de la première colonne "
+"en le décalant d'une case (voir l'onglet «Objectif» pour plus de détails). "
+"La grande différence entre cet exercice et les précédents sur les motifs, "
+"c'est qu'il faut maintenant lire (sur la première colonne) le motif "
+"souhaité, puis le reproduire ensuite. Il est impossible de faire autrement "
+"car votre programme sera exécuté par trois buggles dans trois mondes "
+"différents, chacune ayant un motif propre à reproduire."
-#. type: Content of: <h1>
-#: src/lessons/sort/pancake/GatesPancake.html:1
-msgid "Faster Pancake Sorting"
-msgstr "Tri rapide de crêpes"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array1.html:11
+msgid ""
+"One solution is to read the next cell, and go copy it in position before "
+"coming back to read the second cell. But since it is forbidden to use the "
+"methods to teleport the buggle to a specific position (<code>setPos()</code> "
+"and similar), this approach will be a pain to implement."
+msgstr ""
+"Une possibilité est de lire la prochaine case, puis d'aller la recopier en "
+"position, avant de revenir lire la case suivante, etc. Mais comme vous "
+"n'avez pas le droit d'utiliser les méthodes permettant de téléporter la "
+"buggle à une case particulière (<code>setPos()</code> et autres), cette "
+"façon de faire va être très pénible à mettre en place."
#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:3
+#: src/lessons/welcome/array/basics/Array1.html:16
msgid ""
-"Unlike others sorting problem, the expensive operation is not the comparison "
-"of values, but the flipping of pancakes. In this exercise, we will explore "
-"another algorithm that attempt to reduce the amount of stack flipping. The "
-"funny side is that this algorithm was first introduced by Bill Gates, before "
-"invented Windows."
+"The simplest is to store the sequence of colors that constitute the whole "
+"pattern in an [!java|scala]<b>array</b>[/!][!python]<b>list</b>[/!]. But "
+"before we can do so, we should learn a bit what [!java|scala]arrays[/!][!"
+"python]lists[/!] are."
msgstr ""
-"Contrairement aux problèmes classiques de tri, l'opération coûteuse à "
-"économiser n'est pas la comparaison des valeurs, mais le retournement des "
-"crêpes. Dans cet exercice, nous allons explorer un autre algorithme "
-"permettant de réduire le nombre de retournements nécessaires pour trier la "
-"pile. Fait amusant, cet algorithme a été proposé pour la première fois par "
-"Bill Gates, avant qu'il n'invente Windows."
+"Le plus simple est de stocker l'enchainement de couleurs constituant le "
+"motif dans \n"
+"[!java|scala]un <b>tableau</b>[/!][!python]une <b>liste</b>[/!]. \n"
+"Mais avant de pouvoir faire cela, nous devons en apprendre un peu plus sur "
+"les [!java|scala]tableau[/!][!python]listes[/!]."
+
+#. type: Content of: <h2>
+#: src/lessons/welcome/array/basics/Array1.html:20
+msgid "[!java|scala]Arrays[/!][!python]List[/!]"
+msgstr "[!java|scala]Les tableaux[/!][!python]Les listes[/!]"
#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:8
+#: src/lessons/welcome/array/basics/Array1.html:22
msgid ""
-"The basic idea is to grow sequences of sorted pancakes, not necessarily "
-"starting from the bottom. We say that a sequence of ordered pancakes "
-"constitute a <b>bloc</b> while a pancake that is not part of a bloc is said "
-"to be <b>free</b>. The algorithm then considers the topmost pancake (of "
-"radius <code>t</code>) and search for the <code>t+1</code> or <code>t-1</"
-"code> pancakes (the considered neighbor is noted <code>t+o</code>). Eight "
-"cases may happen:"
+"[!java|scala]An array[/!][!python]A list[/!] is an ordered sequence of "
+"variables that go together. It is somehow similar to a shelve where each "
+"level can store a separate value. Each variable of the sequence is "
+"identified by its position, and can store a specific value. [!java|scala]All "
+"cells of the array must store values of the same type because arrays are "
+"homogeneous in [!thelang]. It is possible to trick this restriction by using "
+"the datatype <code>[!java]Object[/!][!scala]Any[/!]</code> that can contain "
+"[!java]almost[/!] any other datatype. [!java]Primitive types such as the "
+"ones we saw so far (int, boolean, double, char, etc) cannot be stored in an "
+"Object variable, but their objectified counter-part (Integer, Boolean, "
+"Double, Char, Boolean, etc) can.[/!] It is however a good practice to make "
+"the type of an array as specific as possible, i.e., if you plan to store "
+"some integers in your array, make it an array of integers, not of [!"
+"java]Object[/!][!scala]Any[/!].[/!] [!python]Lists can even mix values of "
+"differing types, such as integer values in some cells and colors in other "
+"cells.[/!]"
msgstr ""
-"L'idée de base est de faire grandir des séquences de crêpes triées, pas "
-"forcément en commençant du bas de la pile. On dira qu'un ensemble de crêpes "
-"dans l'ordre constitue un <b>block</b> tandis qu'une crêpe qui n'est pas "
-"dans un bloc est dite <b>libre</b>. L'algorithme considère la crêpe tout en "
-"haut de la pile, dont la taille est notée <code>t</code>, et cherche les "
-"deux crêpes de taille <code>t-1</code> et <code>t+1</code> (le voisin ainsi "
-"considéré est noté <code>t+o</code>). Huit cas sont possibles alors :"
+"[!java|scala]Un tableau[/!][!python]Une liste[/!] est une séquence ordonnée "
+"de variables qui marchent ensemble. \n"
+"C'est un peu similaire à une commode dont les différents tiroirs peuvent "
+"stocker des valeurs différentes. \n"
+"Chaque variable de la séquence est identifiée par sa position et peut "
+"stocker une valeur spécifique.\n"
+"[!java|scala]Toutes les cellules d'un tableau doivent stocker des valeurs du "
+"même type de données parce que les tableaux sont homogènes en [!thelang]. \n"
+"Il est cependant possible de contourner cette restriction en utilisant le "
+"type de données <code>[!java]Object[/!][!scala]Any[/!]</code> qui peut "
+"contenir [!java]presque[/!] tous les autres type de données[!scala] («any» "
+"veut dire «n'importe» en anglais)[/!].\n"
+"[!java]Les types primitifs comme ceux que nous avons utilisé jusqu'à présent "
+"(int, boolean, double, char, etc) ne peuvent pas être stockés dans une "
+"variable Object, mais leurs variantes objectifiées (Integer, Boolean, "
+"Double, Char, Boolean, etc) peuvent l'être.[/!] \n"
+"Il est cependant raisonnable de rendre ses tableaux aussi spécifiques que "
+"possible. Si vous avez l'intention de stocker des entiers, faites en un "
+"tableau de [!java]integer[/!][!scala]Int[/!], pas de [!java]Object[/!][!"
+"scala]Any[/!].[/!] \n"
+"[!python]Les listes peuvent contenir des données de différents types, en "
+"mélangeant par exemple quelques valeurs entières dans certaines cellules "
+"avec des entiers dans d'autres cellules.[/!]"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:15
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:38
msgid ""
-"<b>Case a</b>: Both <code>t</code> and <code>t+o</code> are free. They are "
-"then merged in one flip."
+"T is the [!java|scala]array[/!][!python]list[/!]'s name, [!java|python]T[0]"
+"[/!][!scala]T(0)[/!] is the name of the first cell, [!java|python]T[1][/!][!"
+"scala]T(1)[/!] the name of the second cell, [!java|python]T[2][/!][!"
+"scala]T(2)[/!] the third one, etc. And yes, the first cell is numbered [!"
+"java|python]T[0][/!][!scala]T(0)[/!] while the last one of [!java|scala]an "
+"array[/!][!python]a list[/!] of size N is [!java|python]T[N-1][/!][!"
+"scala]T(N-1)[/!]. It may seem funny to count starting from 0 and not from 1 "
+"as usual, but some historical reasons make it unavoidable here."
msgstr ""
-"<b>Cas a</b>: <code>t</code> et <code>t+o</code> sont tous les deux libres. "
-"Ils sont alors fusionnés en un retournement."
+"T est le nom [!python]de la liste[/!][!scala|java]du tableau[/!], \n"
+"[!java|python]T[0][/!][!scala]T(0)[/!] est le nom de la première case, \n"
+"[!java|python]T[1][/!][!scala]T(1)[/!] de la deuxième case, \n"
+"[!java|python]T[2][/!][!scala]T(2)[/!] de la troisième case, etc... \n"
+"Et oui, la première case est [!java|python]T[0][/!][!scala]T(0)[/!] et la "
+"dernière case\n"
+"[!python]d'une liste[/!][!scala|java]d'un tableau[/!] de taille N est \n"
+"[!java|python]T[N-1][/!][!scala]T(N-1)[/!]. \n"
+"Cela peut sembler étrange de commencer à compter à partir de 0 et non de 1, "
+"mais c'est ainsi (et cela s'explique par des raisons historiques obscures)."
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:19
+#. type: Content of: <p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:46
+msgid "Basic usage"
+msgstr "Usage de base"
+
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:48
msgid ""
-"<b>Case b</b>: <code>t</code> is free, and <code>t+o</code> is the first of "
-"a block. They are merged in one flip."
+"We can use an integer variable <i>i</i> to access with [!java|python]T[i][/!]"
+"[!scala]T(i)[/!] to the cells: when the value of <i>i</i> is 0, then [!java|"
+"python]T[i][/!][!scala]T(i)[/!] accesses [!java|python]T[0][/!][!scala]T(0)"
+"[/!]; when the value of <i>i</i> is 10, then [!java|python]T[i][/!][!"
+"scala]T(i)[/!] accesses [!java|python]T[10][/!][!scala]T(10)[/!]. <i>i</i> "
+"is said to be the <b>index</b> in T. <code>[!java|python]T[i][/!][!"
+"scala]T(i)[/!]</code> can be used just like any variable. We can set a new "
+"value:"
msgstr ""
-"<b>Cas b</b>: <code>t</code> est libre, et <code>t+o</code> est le premier "
-"élément d'un bloc. Ils sont fusionnés en un bloc."
+"On peut utiliser une variable entière <i>i</i> pour accéder avec [!java|"
+"python]T[i][/!][!scala]T(i)[/!] aux cases.\n"
+"Quand <i>i</i> vaut 0 alors [!java|python]T[i][/!][!scala]T(i)[/!] dénote la "
+"case [!java|python]T[0][/!][!scala]T(0)[/!]; \n"
+"lorsque <i>i</i> vaut 10, [!java|python]T[i][/!][!scala]T(i)[/!] dénote [!"
+"java|python]T[10][/!][!scala]T(10)[/!].\n"
+"On dit alors que <i>i</i> est un <b>indice</b> dans [!java|scala]le "
+"tableau[/!][!python]la liste[/!] T.\n"
+"<code>[!java|python]T[i][/!][!scala]T(i)[/!]</code> peut être utilisé comme "
+"n'importe quelle variable.\n"
+"On peut lui affecter une nouvelle valeur:"
+
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:56
+#, no-wrap
+msgid "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
+msgstr "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
+
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:58
+msgid "We can retrieve and use its value:"
+msgstr "On peut réutiliser et tester cette valeur :"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:24
-msgid ""
-"<b>Case c</b>: <code>t</code> is free but both <code>t-1</code> and <code>t"
-"+1</code> are the last elements of blocks. Both blocs and <code>t</code> "
-"are merged all together in 4 flips. Beware, if either <code>t-1</code> or "
-"<code>t+1</code> does not exist (because <code>t</code> is 0 or max), only "
-"two flips are mandated."
-msgstr ""
-"<b>Cas c</b>: <code>t</code> est libre, mais <code>t-1</code> et <code>t+1</"
-"code> sont tous les deux les derniers éléments de blocs. Ces deux blocs "
-"ainsi que <code>t</code> sont tous fusionnés en 4 retournements. Prenez "
-"garde, si <code>t-1</code> ou <code>t+1</code> n'existe pas (parce que "
-"<code>t</code> est 0 ou max), seulement deux de ces retournements sont "
-"nécessaires."
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:59
+#, no-wrap
+msgid "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
+msgstr "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:32
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:61
+msgid "We can test this value:"
+msgstr "On peut tester cette valeur :"
+
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:62
+#, no-wrap
msgid ""
-"<b>Case d</b>: <code>t</code> is in a block but <code>t+o</code> is free. "
-"They are merged in one flip."
+"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) [!scala|java]{[/!][!python]:[/!]\n"
+" [!java|scala]//[/!][!python]#[/!] instructions...\n"
+"[!java|scala]}[/!]"
msgstr ""
-"<b>Cas d</b>: <code>t</code> est dans un bloc, mais <code>t+o</code> est "
-"libre. Ils sont fusionnés en un retournement."
+"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) [!scala|java]{[/!][!python]:[/!]\n"
+" [!java|scala]//[/!][!python]#[/!] instructions...\n"
+"[!java|scala]}[/!]"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:37
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:66
msgid ""
-"<b>Case e</b>: <code>t</code> is in a block and <code>t+o</code> is the "
-"first element of a block. They are merged in one flip."
+"It is very easy to traverse the whole [!scala|java]array[/!][!"
+"python]list[/!], for example to initialize each cells."
msgstr ""
-"<b>Cas e</b>: <code>t</code> est dans un bloc, et <code>t+o</code> est le "
-"premier élément d'un bloc. Ils sont fusionnés en un retournement."
+"Il est également très simple de parcourir [!java|scala]tout le tableau[/!][!"
+"python]toute la liste[/!], par exemple pour initialiser chaque cellule."
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:41
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:69
+#, no-wrap
msgid ""
-"<b>Case f</b>: <code>t</code> is in a block and <code>t+o</code> is the last "
-"element of another block. They are merged in 3 flips as follows."
+"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
+" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
+"[!java|scala]}[/!]"
msgstr ""
-"<b>Cas f</b>: <code>t</code> est dans un bloc, et <code>t+o</code> est le "
-"dernier élément d'un autre bloc. Ils sont fusionnés en trois retournements "
-"comme suit."
+"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
+" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
+"[!java|scala]}[/!]"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:45
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:73
msgid ""
-"<b>Case g</b>: <code>t</code> is in a block of length k+1 (the last element "
-"is <code>t+ko</code>), <code>t+(k+1)o</code> is either free or the last "
-"element of another block. Both blocks are merged in 2 flips:"
+"[!java|scala]The notation <code>T.length</code> retrieves the length of the "
+"array T,[/!] [!python]The function <code>len()</code> retrieves the length "
+"of the list T,[/!] allowing to build a classical for loop easily. [!"
+"python]Actually, the <code>len()</code> function is much more generic and "
+"can be used to retrieve the length of many objects. Applied to strings for "
+"example, it returns the amount of chars in this string.[/!] [!scala]Don't "
+"forget to start at <code>0</code> and stop at <code>T.length-1</code> "
+"instead of <code>1 to T.length</code> however.[/!]"
msgstr ""
-"<b>Cas g</b>: <code>t</code> est dans un bloc de taille k+1 (le dernier "
-"élément est <code>t+ko</code>), <code>t+(k+1)o</code> est soit libre soit le "
-"dernier élément d'un autre bloc. Les deux blocs sont fusionnés en deux "
-"retournements:"
+"[!java|scala]La notation <code>T.length</code> permet d'accéder à la taille "
+"(«length» en anglais) du tableau T,[/!]\n"
+"[!python]La fonction <code>len()</code> renvoie la longueur de la liste T,"
+"[/!] \n"
+"ce qui permet de construire facilement la boucle.\n"
+"[!python]En fait, la fonction <code>len()</code> est bien plus générique et "
+"peut être utilisée pour calculer la taille de nombreux objets. Appliquée à "
+"une chaîne de caractères par exemple, elle retourne le nombre de caractères "
+"composant cette chaîne.[/!]\n"
+"[!scala]N'oubliez pas de commencer à <code>0</code> pour terminer à <code>T."
+"length-1</code> au lieu de <code>1 to T.length</code>![/!]"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:48
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:81
msgid ""
-"<b>Case h</b>: <code>t</code> is in a block of length k+1 (the last element "
-"is <code>t+ko</code>), <code>t+(k+1)o</code> is the first element of another "
-"block (the difference with case g is that <code>t+(k+1)o</code> is now the "
-"<i>first</i> element of its block). Both blocks are merged in 2 flips:"
+"If you just want to iterate over the values of T without keeping track of "
+"their index, you can simply write:"
msgstr ""
-"<b>Cas h</b>: <code>t</code> est dans un bloc de taille k+1 (le dernier "
-"élément est <code>t+ko</code>), <code>t+(k+1)o</code> est le premier élément "
-"d'un autre bloc (la différence avec le cas g est que <code>t+(k+1)o</code> "
-"est maintenant le <i>premier</i> élément de son bloc). Les deux blocs sont "
-"fusionnés en deux retournements:"
+"Si vous souhaitez simplement parcourir les valeurs de T sans avoir besoin de "
+"l'index de chaque valeur, vous pouvez écrire simplement :"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:54
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:82
+#, no-wrap
msgid ""
-"<b>Case i</b>: <code>t</code> is in a block of length <code>n</code> (this "
-"block contains all pancakes). If <code>t</code> is not 1, the whole stack "
-"is fliped. The algorithm then stops."
+"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in T:[/!]\n"
+" action()[!java];[/!]\n"
+"[!java|scala]}[/!]"
msgstr ""
-"<b>Cas i</b>: <code>t</code> est dans un bloc de taille <code>n</code>, qui "
-"contient donc toutes les crêpes. Si <code>t</code> n'est pas 1, toute la "
-"pile est retournée. Ensuite, l'algorithme s'arrête."
+"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in T:[/!]\n"
+" action()[!java];[/!]\n"
+"[!java|scala]}[/!]"
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:57
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:85
msgid ""
-"Each iteration increases the size of the blocks, so the algorithm eventually "
-"halts in all cases. A finer analysis would show that it takes at most "
-"<code>(5n+5)/3</code> steps to sort the stack. That's better than the naïve "
-"algorithm, that requires 2n-3 steps."
+"[!java]This construct is called an <i>extended loop</i> in Java. The "
+"variable <i>i</i> takes all values of the set located to the right of the "
+"colon (:), one after the other.[/!] [!python|scala]This is actually very "
+"similar to the previous construct. Simply, <code>[!python]range(n)[/!][!"
+"scala]i to j[/!]</code> returns a set of integers over which the for "
+"construct iterates. Actually, [!thelang] offers much more elegant ways to "
+"traverse [!python]lists[/!][!scala]arrays[/!] and other data collections, "
+"but this should be the topic of a specific set of exercises (that are still "
+"to be written in PLM).[/!]"
msgstr ""
-"Chaque itération augmente la taille des blocs, donc la terminaison de "
-"l'algorithme est certaine. Une analyse plus fine montre qu'il prend au plus "
-"<code>(5n+5)/3</code> étapes pour trier la pile. C'est mieux que "
-"l'algorithme naïf, qui nécessite <code>2n-3</code> étapes pour cela."
+"[!java]Cette construction s'appelle une boucle <code>for</code> étendue en "
+"Java. \n"
+"La variable <i>i</i> prend successivement toutes les valeurs de l'ensemble "
+"placé à droite des deux-points (:).[/!] \n"
+"[!python|scala]Cette écriture est finalement très semblable à la "
+"précédente. \n"
+"Simplement, <code>[!python]range(n)[/!][!scala]i to j[/!]</code> retourne un "
+"ensemble d'entiers sur lequel la boucle <code>for</code> itère.\n"
+"En fait, [!thelang] offre d'autres moyens très élégants de traverser des [!"
+"python]listes[/!][!scala]tableaux[/!] \n"
+"et d'autres collections de données. Mais cela devrait être le sujet "
+"d'exercices spécifiques (qui restent à écrire dans PLM).[/!]"
-#. type: Content of: <h2>
-#: src/lessons/sort/pancake/GatesPancake.html:60
-msgid "Your turn"
-msgstr "À vous de jouer"
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:96
+msgid "Declaring [!python]a list[/!][!java|scala]an array[/!]"
+msgstr "Declarer [!python]une liste[/!][!java|scala]un tableau[/!]"
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:61
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:99
msgid ""
-"You now have almost enough information to implement this algorithm on your "
-"own. We just have to remove the last remaining ambiguities to ensure that "
-"you implement exactly the same algorithm that the correction. If several "
-"cases apply to your situation, then you should use the first given one. For "
-"example, if both cases a and b apply (e.g., with <code>t-1</code> on case "
-"<b>a</b> and <code>t+1</code> on case <b>b</b>), then you should apply the "
-"flips of case <b>a</b>. If a given case applies for both <code>t+1</code> "
-"and <code>t-1</code>, then you should apply it to <code>t+1</code>."
+"If you know beforehand the content of your list, you can affect these values "
+"all together. Just put them between square braces and separated by commas "
+"as follows:"
msgstr ""
-"Vous avez maintenant quasi assez d'informations pour implémenter cet "
-"algorithme par vous-même. Il faut juste lever les dernières ambiguïtés pour "
-"que vous implémentiez exactement le même algorithme que la correction. Si "
-"plusieurs cas s'appliquent à la situation courante, appliquez le premier. "
-"Par exemple, si les cas a et b s'appliquent (avec <code>t-1</code> pour le "
-"cas a et <code>t+1</code> pour le cas b), vous devez appliquer les "
-"instructions du cas <b>a</b>. Si un cas donné s'applique à la fois pour "
-"<code>t+1</code> et <code>t-1</code>, appliquez le pour <code>t+1</code>."
+"Si vous connaissez à l'avance le contenu de votre liste, vous pouvez "
+"affecter ces valeurs directement. Placez-les simplement entre crochets et "
+"séparées par des virgules comme ceci :"
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:67
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:102
+#, no-wrap
msgid ""
-"Note that it is somehow harder than the other exercises we did so far, so "
-"don't be surprised if you need more time to achieve this. But do not give "
-"hope, you can do it!"
+"L = [1, 3, 5, 7, 9] \n"
+"<span class=\"comment\"># L is now an array of 5 values, all of them being integers</span>"
msgstr ""
-"Cet exercice est plus difficile que ceux que nous avons fait jusque là, et "
-"il ne serait pas choquant que vous ayez besoin d'un peu plus de temps que "
-"les autres pour le résoudre. Mais n'abandonnez pas, vous pouvez le faire !"
-
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:70
-msgid "Well, I need some help to start."
-msgstr "Heu, j'ai besoin d'un peu d'aide pour commencer."
+"L = [1, 3, 5, 7, 9] \n"
+"<span class=\"comment\"># L est maintenant une liste de 5 valeurs, toutes des entiers</span>"
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:71
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:104
msgid ""
-"First write some helper functions such as <code>isFirst()</code> or "
-"<code>isFree()</code>. This will simplify your main algorithm afterward, "
-"that can be written very similarly to the explication above with a bunch of "
-"if conditions. Factorizing code this way often helps making your code more "
-"readable."
+"Otherwise, you probably want to create an empty list and then append each "
+"values separately to the list:"
msgstr ""
-"Commencez par écrire des fonctions d'aide, comme <code>estLibre()</code> ou "
-"<code>estPremier()</code>. Cela simplifiera l'écriture de votre algorithme, "
-"qui peut être écrit sous une forme très similaire à l'énoncé si vous faites "
-"les bonnes fonctions d'aide. Factoriser ainsi votre code aide très souvent à "
-"améliorer la lisibilité du code."
+"Dans le cas contraire, le plus simple est de créer une liste vide puis "
+"d'ajouter chaque valeur séparément à la liste :"
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:78
-msgid "My code keeps failing and I don't know how to debug it."
-msgstr "Mon code ne fonctionne pas, et je ne sais pas comment le débugger"
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:106
+#, no-wrap
+msgid ""
+"L2 = [] \n"
+"<span class=\"comment\"># L2 is now an empty list</span>\n"
+"L2.append(1)\n"
+"L2.append(3)\n"
+"L2.append(5)\n"
+"L2.append(7)\n"
+"L2.append(9) \n"
+"<span class=\"comment\"># Its content is now the same as L previously</span>"
+msgstr ""
+"L2 = [] \n"
+"<span class=\"comment\"># L2 est maintenant une liste vide</span>\n"
+"L2.append(1)\n"
+"L2.append(3)\n"
+"L2.append(5)\n"
+"L2.append(7)\n"
+"L2.append(9) \n"
+"<span class=\"comment\"># Son contenu est maintenant le même que celui de L ci-dessus</span>"
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:79
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:117
msgid ""
-"To debug one world after the other and avoid that the messages of all worlds "
-"get intermixed, you can write your debug function only if the method "
-"<code>isSelected()</code> returns true. It will be so only for the entity "
-"that is currently selected in the graphical interface, that is probably the "
-"world you are currently debugging. This will help breaking the difficulty in "
-"parts by debugging the situation on after the other."
+"To declare a variable named <b>T</b> that can store arrays of integers, one "
+"should write:"
msgstr ""
-"Pour débugger un monde après l'autre, il est préférable d'éviter que les "
-"affichages de tous les mondes se mélangent. Le plus simple pour cela est "
-"d'utiliser la méthode <code>isSelected()</code> qui ne renvoi vrai que si le "
-"monde courant est celui sélectionné dans l'interface. Cela aidera à réduire "
-"la complexité en résolvant les problèmes les uns après les autres."
+"Pour créer une variable nommée <b>T</b> pouvant contenir un tableau "
+"d'entiers, on écrira :"
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:85
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:118
+#, no-wrap
+msgid "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
+msgstr "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
+
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:120
msgid ""
-"In particular, it may help to print textually the state of the world each "
-"time you enter the main loop."
+"[!java]<code>int</code> means that the elements of the array are of type "
+"integer; <code>[]</code> means that we are speaking of an array and <code>T</"
+"code> is the name of the variable. For historical reasons, this can also be "
+"written as <code>int T[]</code> (with the [] after the variable name), but "
+"this is less readable and should probably be avoided.[/!] [!scala]The "
+"<code>[Int]</code> notation specializes the Array type (that is generic), "
+"specifying that each cell of this array is an integer. An array of booleans "
+"would simply by written <code>Array[Boolean]</code>.[/!]"
msgstr ""
-"En particulier, afficher l'état du monde sous forme textuelle à chaque fois "
-"que vous rentrez dans la boucle principale peut aider. "
+"[!java]<code>int</code> indique que les éléments du tableau sont de type "
+"entier;\n"
+"<code>[]</code> indique que nous parlons d'un tableau tandis que <code>T</"
+"code> est le nom de la variable. \n"
+"Pour des raisons historiques, cela peut également être écrit sous la forme "
+"<code>int T[]</code> (avec [] à droite du nom de la variable), \n"
+"mais cette forme est moins lisible et devrait probablement être évitée.[/!]\n"
+"[!scala]La notation <code>[Int]</code> spécialise le type <code>Array</code> "
+"(«tableau» en anglais), qui est générique. Cela spécifie que chaque case du "
+"tableau est un entier. Le type d'un tableau de booleens s'écrirait "
+"simplement <code>Array[Boolean]</code>.[/!]"
-#. type: Content of: <h1>
-#: src/lessons/sort/baseball/Main.html:1
-msgid "The Rainbow Baseball Game"
-msgstr "Le jeu du baseball multicolore"
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:128
+msgid "Allocating an array"
+msgstr "Allocation d'un tableau"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:3
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:130
msgid ""
-"This activity is inspired from the orange game, from the \"Computer Science "
-"Unplugged\" activities repository. It was however heavily since then, first "
-"for the CSIRL (my repository of <i>free</i> unplugged activities to "
-"introduce computer science, available at http://www.loria.fr/~quinson/"
-"Mediation/SMN/) and now for PLM."
+"Declaring a variable <code>T</code> that stores an array only reserve the "
+"<b>name</b> <code>T</code> for later use, but not the memory area to store "
+"the cells. The array is not initialized yet: it does not have any value. "
+"What would <code>[!java]T[4][/!][!scala]T(4)[/!]</code> mean if we didn't "
+"say that the array is 5 cells long?"
msgstr ""
-"Cette activité est inspirée du jeu de l'orange dans le recueil d'activités "
-"«Computer Science Unplugged». Elle a cependant été profondément réarrangée "
-"depuis, d'abord pour SMN (mon recueil d'activités <i>libres</i> pour "
-"introduire la science informatique, disponible depuis http://www.loria.fr/"
-"~quinson/Mediation/SMN/), et maintenant pour PLM."
+"Déclarer un tableau <code>T</code> nous réserve juste le nom <code>T</code> "
+"pour l'utiliser plus tard, mais pas la place en mémoire pour stocker les "
+"cases. Le tableau n'est pas initialisé : il n'a pas de valeur. Que voudrait "
+"dire <code>T[4]</code> si nous n'avons pas encore dit que <code>T</code> est "
+"un tableau de 5 éléments ?"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:7
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:135
+msgid "First and foremost, we have to give a value to <code>T</code>:"
+msgstr "Avant tout, il faut donc lui affecter une valeur à <code>T</code>:"
+
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:136
+#, no-wrap
+msgid "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
+msgstr "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
+
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:138
msgid ""
-"In the literature, the generalized form of this problem is known as the "
-"pebble motion problem (the bases can be connected by any kind of graph, and "
-"the affinity of pebbles with bases may be different). Another variant of "
-"this problem is the well known 15-puzzle, with one player per base, and a "
-"two dimensional square grid. Much more information about these problems can "
-"be found on wikipedia, as usual."
+"<code>new</code> means that we want to create something, and <code>[!"
+"java]int[10][/!][!scala]Array[Int](10)[/!]</code> means that it is an array "
+"of 10 integer values. In return, an array of 10 integer cells is created in "
+"memory, and the <code>T</code> variable <b>references</b> this array."
msgstr ""
-"Dans la littérature scientifique, la forme généralisée de ce problème se "
-"nomme «le problème du déplacement des galets» (Pebble motion problem). Les "
-"bases peuvent être connectées par un graphe quelconque, et les affinités "
-"entre les galets et les bases peuvent être différentes. La plus connue des "
-"variantes de ce problème est le jeu du taquin, avec un seul joueur par base "
-"et une grille carrée à deux dimensions. On trouve énormément d'informations "
-"sur ces problèmes sur les pages wikipédia anglophones, comme d'habitude."
+"<code>new</code> indique qu'il faut créer quelque chose, et \n"
+"<code>[!java]int[10][/!][!scala]Array[Int](10)[/!]</code> indique qu'il "
+"s'agit d'un tableau de 10 valeur entières. En réponse, un tableau d'entiers "
+"de longueur 10 est crée en mémoire, et la variable <code>T</code> "
+"<b>référence</b> ce tableau."
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/Main.html:12
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:143
msgid ""
-"How do you know that the naive algorithm won't loop on that initial "
-"situation?"
+"The size of an array is fixed and cannot be changed after the creation of "
+"the array. The size of a <code>T</code> array can be retrieve by consulting "
+"the variable <code>T.length</code>."
msgstr ""
-"Comment pouvez vous être sûr que l'algorithme naïf ne boucle pas sur cette "
-"situation initiale? "
+"La taille d'un tableau est fixée et ne peut plus être changée après la "
+"création du tableau. Pour connaître la taille d'un tableau <code>T</code>, "
+"on peut consulter la variable <code>T.length</code>."
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:14
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:147
msgid ""
-"Well, we simply tested all possible situations to see when this algorithm "
-"loops and when it finds the correct solution. We found that it works for all "
-"situations where no player is at home (there is 84 such situations for 4 "
-"bases, once you take the symmetries into account). It obviously works for "
-"some situations that do not respect this criteria (such as all situations it "
-"encounters from one of those 84 boards to the final state), but that's "
-"another story. Having such a criteria allows us to generate pseudo-random "
-"initial situations for the first exercise for which the algorithm we propose "
-"is guarenteed to work."
+"While allocating, you can specify the size with a variable: <code>[!"
+"java]int[] T = new int[i];[/!][!scala]var T = new Array[Int](i);[/!]</code> "
+"In this case, the array's size will be set to the value of <code>i</code> "
+"<i>when <code>new</code> gets called</i>. The size of the array still "
+"cannot be modified : even if the variable <code>i</code> changes afterward, "
+"the size remains to the value given when it was allocated. [!java]Also, it "
+"is forbidden to write something like <code>int T[10];</code> when declaring "
+"the variable. You are required to use the <code>new</code> instruction to "
+"allocate it, as in <code>int[] T = new int[10];</code> [/!]"
msgstr ""
-"Et bien, nous avons testé toutes les situations initiales possibles pour "
-"étudier les cas où l'algorithme boucle et ceux où l'algorithme termine "
-"correctement. Nous avons trouvé qu'il fonctionne pour toutes les situations "
-"où aucun joueur ne se trouve dans sa base (il y a 84 situations de ce genre "
-"pour 4 bases, si on élimine les symétries). Bien entendu, l'algorithme "
-"fonctionne correctement pour de nombreuses situations ne respectant pas ce "
-"critère (telles que toutes les situations rencontrées quand on commence de "
-"l'une de ces 84 situations), mais c'est une autre histoire. Avoir un tel "
-"critère nous permet de générer des situations initiales pour ce premier "
-"exercice de manière pseudo-aléatoire tout en étant sûrs que l'algorithme "
-"proposé se comportera correctement."
+"Lors de l'allocation, vous pouvez spécifier la taille à utiliser avec une "
+"variable: \n"
+"<code>[!java]int[] T = new int[i];[/!][!scala]var T = new Array[Int](i);"
+"[/!]</code> \n"
+"Dans ce cas, la taille du tableau est fixée à la valeur de <code>i</code> "
+"<i>quand <code>new</code> a été appelé</i>. \n"
+"La taille du tableau ne peut toujours pas être modifiée. Même si la valeur "
+"de <code>i</code> est modifiée ensuite, la taille reste la même.\n"
+"[!java]Enfin, il est interdit d'écrire quelque chose comme <code>int T[10];</"
+"code> pour déclarer la variable. Il faut absolument utiliser <code>new</"
+"code> pour l'allouer, comme dans <code>int[] T = new int[10];</code> [/!]"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:21
+#. type: Content of: <p><p><p><h4>
+#: src/lessons/welcome/array/basics/Array1.html:155
+msgid "Declaration and initialization"
+msgstr "Déclaration et initialisation"
+
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:156
msgid ""
-"We also explored bigger instances of the problem, and unfortunately, we have "
-"no such criteria for them. With 5 bases, the algorithm wrongly loops for 24 "
-"of the 1824 possible boards where no player is home (that's 1.31%). With 6 "
-"bases, it fails on 1251 of the 58860 such boards (2.12%). With 7 bases, it "
-"fails for 84444 out of 2633940 (that's 3.2%). I am still looking for a "
-"criteria ensuring that the algorithm won't loop. If you discover one, please "
-"report it. Ideally, it would be simple to enforce manually so that we can "
-"use it during our unplugged activities."
+"If you know beforehand the content of your array, you can declare, allocate "
+"and initialize it in one shoot:"
msgstr ""
-"Nous avons également exploré des instances plus grande de ce problème, et "
-"malheureusement, nous ne connaissons pas de critère sûr dans ce cas. Avec 5 "
-"bases, l'algorithme part en boucle infinie pour 24 des 1824 plateaux "
-"possibles où aucun joueur n'est à la maison (cela représente 1,31%). Avec 6 "
-"bases, il boucle pour 1251 des 58860 plateaux respectant ce critère (2,12%). "
-"Avec 7 bases, il boucle dans 84444 cas sur 2633940 (càd 3,2%). Nous "
-"cherchons encore un critère permettant de garantir que l'algorithme ne "
-"bouclera pas. Si vous en découvrez un, merci de nous l'indiquer. Ce serait "
-"encore mieux s'il était possible de vérifier le critère de tête afin que les "
-"animateurs puissent s'en servir pendant les activités débranchées."
+"Si vous connaissez le contenu de votre tableau à l'avance, vous pouvez le "
+"déclarer, l'allouer et l'initialiser en un coup:"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/baseball/Main.html:31
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:157
+#, no-wrap
+msgid "[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
+msgstr "[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
+
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:159
msgid ""
-"Other graphical representations could be proposed, such as a linear one (for "
-"the existing exercises) or other ones (such as a grid or a tree, if an "
-"exercise on this kind of graph proves interesting)."
+"To know the size of the array to allocate, the compiler counts the provided "
+"values. This code is equivalent to:"
msgstr ""
-"D'autres représentations graphiques pourraient être proposées, comme une "
-"représentation linéaire (pour les exercices proposés) ou d'autres comme une "
-"grille ou un arbre, si un exercice sur ce type de graphe s'avère intéressant."
+"Pour connaître la taille du tableau à allouer, le compilateur compte les "
+"valeurs données. Ce code est équivalent à :"
-#. type: Content of: <ul><li>
-#: src/lessons/sort/baseball/Main.html:33
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:161
+#, no-wrap
msgid ""
-"Other exercises on other algorithms on this variant, or on other variants "
-"such as the 15-puzzle."
+"[!java]int[] T = new int[10];\n"
+"T[0] = 1;\n"
+"T[1] = 2;\n"
+"...\n"
+"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
+"T(0) = 1\n"
+"T(1) = 2\n"
+"...\n"
+"T(9) = 10[/!]"
msgstr ""
-"D'autres exercices à propos d'autres algorithmes pour cette variante du "
-"problème, ou bien d'autres variantes comme le jeu du taquin."
+"[!java]int[] T = new int[10];\n"
+"T[0] = 1;\n"
+"T[1] = 2;\n"
+"...\n"
+"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
+"T(0) = 1\n"
+"T(1) = 2\n"
+"...\n"
+"T(9) = 10[/!]"
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/short_desc.html:1
-msgid "Rainbow baseball"
-msgstr "Baseball multicolore"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:171
+msgid "It is also equivalent to:"
+msgstr "C'est aussi équivalent au code :"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/short_desc.html:3
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:172
+#, no-wrap
msgid ""
-"This is another funny variation on the sorting problem, adapting the main "
-"sorting algorithms on an unusual context."
+"[!java]int[] T = new int[10];\n"
+"for (int i=0; i<T.length; i++) {\n"
+" T[i] = i+1;\n"
+"}[/!][!scala]var T = new Array[Int](10);\n"
+"for (i <- 0 to T.length-1) {\n"
+" T(i) = i+1\n"
+"}[/!]"
msgstr ""
-"Il s'agit d'un autre problème amusant autour des algorithmes de tri, "
-"adaptant les principaux algorithmes de tri à un contexte inhabituel."
-
-#. type: Content of: <h1>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:1
-msgid "Rainbow Baseball"
-msgstr "Baseball multicolore"
+"[!java]int[] T = new int[10];\n"
+"for (int i=0; i<T.length; i++) {\n"
+" T[i] = i+1;\n"
+"}[/!][!scala]var T = new Array[Int](10);\n"
+"for (i <- 0 to T.length-1) {\n"
+" T(i) = i+1\n"
+"}[/!]"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:2
-msgid ""
-"The colors are represented by integers, between <code>0</code> and "
-"<code>amount of bases -1</code>. The hole is represented by the special "
-"value <code>-1</code>. The color of each base is its rank. So base <code>1</"
-"code> is of color <code>1</code>. In the graphical interface, the base "
-"<code>0</code> is the dark blue one while the base <code>1</code> is the "
-"fuscia one."
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:183
+msgid "[!python]Lists[/!][!scala|java]Arrays[/!] and method parameters"
msgstr ""
-"Les couleurs sont représentées comme des entiers, entre <code>0</code> et "
-"<code>nombre de bases - 1</code>. Le trou est représenté par la valeur "
-"spéciale <code>-1</code>. La couleur de chaque base est son rang, ce qui "
-"fait que la base <code>1</code> est de couleur <code>1</code>. Dans "
-"l'interface graphique, la base <code>0</code> est la bleue foncée tandis que "
-"la base <code>1</code> est celle fuscia."
+"Les [!python]listes[/!][!scala|java]tableaux[/!] et les paramètres de "
+"méthodes"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:8
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:184
msgid ""
-"Once every players on the field are in their home base, the hole should be "
-"in the last base, that is of rank <code>getBasesAmount()-1</code>."
+"It is perfectly OK to pass [!python]a list[/!][!java|scala]an array[/!] to a "
+"method as a parameter. This method can then use this parameter as if it "
+"were defined locally:"
msgstr ""
-"Une fois que tous les joueurs du terrain sont chez eux, le trou se trouve "
-"dans la dernière base, celle de rang <code>getNombreBases()-1</code>."
-
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:11
-msgid "Functions to retrieve the world's dimensions"
-msgstr "Fonctions pour découvrir les dimensions du monde"
+"On peut tout à fait passer [!java|scala]un tableau[/!][!python]une liste[/!] "
+"en paramètre d'une méthode. La méthode peut alors l'utiliser comme si la "
+"variable avait été définie localement:"
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:13
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:186
#, no-wrap
-msgid "[!java]int [/!]getBasesAmount() [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getNombreBases() [!scala]:Int[/!]"
+msgid ""
+"[!java]boolean has42First(int[] array) {\n"
+" return array[0] == 42;\n"
+"}[/!][!python]def has42First(list):\n"
+" return list[0] == 42[/!][!scala]def has42First(array:Array[Int]):Boolean = {\n"
+" return array(0) == 42\n"
+"}[/!]"
+msgstr ""
+"[!java]boolean a42Premier(int[] tableau) {\n"
+" return tableau[0] == 42;\n"
+"}[/!][!python]def a42Premier(liste):\n"
+" return liste[0] == 42[/!][!scala]def a42Premier(tableau:Array[Int]):Boolean = {\n"
+" return tableau(0) == 42\n"
+"}[/!]"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:14
-msgid "Returns the amount of bases on this field."
-msgstr "Retourne le nombre de bases dans le terrain."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:193
+msgid "On the caller side, that also very simple:"
+msgstr "Coté appelant, c'est aussi simple :"
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:16
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:194
#, no-wrap
-msgid "[!java]int [/!]getPositionsAmount() [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getNombrePositions() [!scala]:Int[/!]"
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:17
-msgid "Returns the amount of player's positions per base on this field."
-msgstr "Retourne le nombre de positions disponibles par base."
+msgid ""
+"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] (10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
+"[!java|scala]<span class=\"comment\">// Values initialization omitted</span>\n"
+"[/!]if (has42First(tab))[!java|scala] {[/!][!python]:[/!]\n"
+" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] do something</span>\n"
+"[!java|scala]}[/!]"
+msgstr ""
+"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] (10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
+"[!java|scala]<span class=\"comment\">// Initialisation des valeurs omise</span>\n"
+"[/!]if (a42Premier(tab))[!java|scala] {[/!][!python]:[/!]\n"
+" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] faire des choses</span>\n"
+"[!java|scala]}[/!]"
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:19
-msgid "Functions to retrieve the world's state"
-msgstr "Fonctions pour découvrir l'état du monde"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:201
+msgid ""
+"If you want to allocate and initialize the array in one shoot, that's a bit "
+"more complicated as the compiler has to know the type of the parameter you "
+"are creating. For that, use the following (ugly) construct:"
+msgstr ""
+"Si vous voulez allouer et initialiser le tableau au vol lors du passage de "
+"paramètre, c'est un peu plus compliqué car il faut dire au compilateur le "
+"type du paramètre que vous construisez. Il faut alors utiliser la "
+"construction suivante, même si elle n'est pas très belle."
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:21
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:204
#, no-wrap
-msgid "[!java]int [/!]getHoleBase() [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getTrouBase() [!scala]:Int[/!]"
+msgid ""
+"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
+" <span class=\"comment\">// do something</span>\n"
+"}"
+msgstr ""
+"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
+" <span class=\"comment\">// faire des choses</span>\n"
+"}"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:22
-msgid "Returns the base in which the hole is located."
-msgstr "Retourne l'index de la base où se trouve le trou."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:209
+msgid ""
+"Methods can also return [!java|scala]arrays[/!][!python]lists[/!] as result "
+"without any complication. Here is a method that returns [!java|scala]an "
+"array[/!][!python]a list[/!] of the requested size, filled with 42s."
+msgstr ""
+"Les méthodes peuvent également retourner des [!java|scala]tableaux[/!][!"
+"python]listes[/!] comme résultat sans aucun problème.\n"
+"Voici une méthode retournant [!java|scala]un tableau[/!][!python]une "
+"liste[/!] de la taille demandée après avoir initialisé toutes les cases à la "
+"valeur 42."
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:24
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:212
#, no-wrap
-msgid "[!java]int [/!]getHolePosition() [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getTrouPosition() [!scala]:Int[/!]"
+msgid ""
+"[!java]int[] fill42(int size) {\n"
+" int[] res = new int[size];\n"
+" for (int i=0; i<size; i++) \n"
+" res[i] = 42;\n"
+" return res;\n"
+"}[/!][!scala]def fill42(size:Int):Array[Int] = {\n"
+" var res = new Array[int] (size)\n"
+" for (i <- 0 to size -1) {\n"
+" res(i) = 42;\n"
+" }\n"
+" return res;\n"
+"}[/!][!python]def fill42(size):\n"
+" res = []\n"
+" for i in range(size):\n"
+" res.append(42)\n"
+" return res[/!]"
+msgstr ""
+"[!java]int[] remplir42(int taille) {\n"
+" int[] res = new int[taille];\n"
+" for (int i=0; i<taille; i++) \n"
+" res[i] = 42;\n"
+" return res;\n"
+"}[/!][!scala]def remplir42(taille:Int):Array[Int] = {\n"
+" var res = new Array[int] (taille)\n"
+" for (i <- 0 to taille -1) {\n"
+" res(i) = 42;\n"
+" }\n"
+" return res;\n"
+"}[/!][!python]def remplir42(taille):\n"
+" res = []\n"
+" for i in range(taille):\n"
+" res.append(42)\n"
+" return res[/!]"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:25
-msgid "Returns the hole position within its base"
-msgstr "Retourne la position du trou dans sa base."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:231
+msgid ""
+"At least! After this long explanation, we can come back to the exercise."
+msgstr ""
+"Enfin ! Après toutes ces explications, nous pouvons revenir à l'exercice."
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:27
-#, no-wrap
-msgid "[!java]int [/!]getPlayerColor([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
-msgstr "[!java]int [/!]getCouleurJoueur([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:232
+msgid ""
+"Your mission is rather simple actually. Your code should save the color "
+"pattern observed on the first row into [!java|scala]an array[/!][!python]a "
+"list[/!]. [!python]The easiest is to create an empty list, and then "
+"<code>append()</code> the colors one after the others as you read them (with "
+"<code>getGroundColor()</code>).[/!] [!java|scala]For that, you should "
+"declare and allocate an array of <code>Color</code>. Beware, there is "
+"several worlds, of differing size; use <code>getWorldHeight()</code> to "
+"retrieve the size of the current world. Once the array allocated, fill it "
+"by reading the ground color in each locations (with <code>getGroundColor()</"
+"code>).[/!]"
+msgstr ""
+"Votre mission est plutôt simple au fond. Votre code doit sauvegarder le "
+"motif de couleurs observé sur la première colonne. Il faut bien entendu "
+"sauvegarder ces valeurs dans [!java|scala]un tableau[/!][!python]une "
+"liste[/!]. \n"
+"[!python]Le plus simple pour cela est de créer une liste vide puis d'y "
+"adjoindre (avec <code>append()</code> les différentes couleurs lues sur le "
+"sol de la première colonne (avec <code>getCouleurSol()</code>).[/!] \n"
+"[!java|scala]Pour cela, il faut déclarer et créer un tableau de variables de "
+"type <code>Color</code>. Attention, les différents mondes ne sont pas tous "
+"de la même taille et il faut utiliser <code>getMondeHauteur()</code> pour "
+"trouver la taille du monde courant. Une fois créé, remplissez le tableau en "
+"lisant les couleurs au sol de la première colonne (avec "
+"<code>getCouleurSol()</code>).[/!]"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:28
-msgid "Returns the color of the player at a given location."
-msgstr "Retourne la couleur d'un joueur donné à partir de sa position."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:240
+msgid ""
+"Once you managed to read and save the pattern on the first row, you have to "
+"reapply the pattern on every rows, for example by executing "
+"<code>getWorldHeight()</code> times a method written specifically for this."
+msgstr ""
+"Une fois le motif de la première colonne lu et sauvegardé, il faut le "
+"répliquer sur toutes les colonnes, par exemple en exécutant "
+"<code>getMondeLargeur()</code> fois une méthode écrite tout exprès."
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:30
-#, no-wrap
-msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estTrie() [!scala]:Boolean[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/basics/Array2.html:1
+msgid "[!java|scala]Arrays[/!][!python]Lists[/!], Knotting and Modulos"
+msgstr "[!java|scala]Tableaux[/!][!python]Listes[/!], tricot et modulo"
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:31
-msgid "Returns whether all players of the field are at home."
-msgstr "Retourne si tous les joueurs présents sur le terrain sont chez eux."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:3
+msgid ""
+"This exercise is similar to the previous one: you have to reproduce the "
+"color pattern of the first cell into the other ones."
+msgstr ""
+"Cet exercice ressemble au précédent : il faut reproduire le motif de "
+"couleurs de la première colonne dans les colonnes suivantes."
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:33
-#, no-wrap
-msgid "[!java]boolean [/!]isBaseSorted([!java]int [/!]base) [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estBaseTriee([!java]int [/!]base) [!scala]:Boolean[/!]"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:6
+msgid ""
+"The first difference is that the world is bordered of walls: you thus have "
+"to slightly modify your trajectory to ensure that the buggle does not crash "
+"into a wall. The simpler for that is to handle the first cell out of the "
+"<code>for</code> loop and do only <code>getWorldHeight()-1</code> steps in "
+"the loop."
+msgstr ""
+"La première différence est que le monde est entouré d'un mur : il faut donc "
+"modifier légèrement les parcours pour s'assurer que la buggle ne se cogne "
+"pas sur les bords. Le plus simple est de traiter la première case de la "
+"colonne en dehors de la boucle <code>for</code> (avant la boucle), et faire "
+"seulement <code>getWorldHeight()-1</code> pas dans la boucle."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:34
-msgid "Returns whether all players of a given base are at home."
-msgstr "Retourne si tous les joueurs d'une base donnée sont chez eux."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:12
+msgid ""
+"The other difference is that the offset to apply between columns is not "
+"fixed, but written on the first cell of each column. To get the info as an "
+"integer, we can use:"
+msgstr ""
+"La seconde différence est que le décalage à effectuer entre les colonnes "
+"n'est pas fixe, mais écrit sur la première case de chaque colonne. Pour "
+"obtenir l'information sous forme d'un entier, on peut utiliser:"
#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:36
+#: src/lessons/welcome/array/basics/Array2.html:16
#, no-wrap
-msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
-msgstr "[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]"
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:37
-msgid "Returns whether the current world is selected in the interface."
-msgstr "Renvoi si le monde actuel est sélectionné dans l'interface graphique."
-
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:38
-msgid "Functions to change the world"
-msgstr "Fonctions pour changer le monde"
+msgid "[!java]int offset = Integer.parseInt(readMessage())[/!][!python]offset = int( readMessage() )[/!][!scala]val offset = readMessage().toInt[/!]"
+msgstr "[!java]int decalage = Integer.parseInt(litMessage())[/!][!python]decalage = int( litMessage() )[/!][!scala]val decalage = litMessage().toInt[/!]"
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:40
-#, no-wrap
-msgid "[!java]void [/!]move([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!])"
-msgstr "[!java]void [/!]deplace([!java]int [/!]base[!scala]:Int[/!], [!java]int [/!]position[!scala]:Int[/!])"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:18
+msgid ""
+"<code>readMessage()</code> gets the message on the ground as a [!java|"
+"scala]String[/!][!python]string[/!], while <code>[!java]Integer.parseInt(str)"
+"[/!][!scala]str.toInt[/!][!python]int(str)[/!]</code> transforms the string "
+"<code>str</code> into an integer by <i>reading</i> it."
+msgstr ""
+"<code>litMessage()</code> lit l'indication au sol sous forme d'une chaîne de "
+"caractères, \n"
+"tandis que <code>[!java]Integer.parseInt(ch)[/!][!scala]ch.toInt[/!][!"
+"python]int(ch)[/!]</code> \n"
+"transforme la chaîne <code>ch</code> en un entier en la <i>lisant</i>."
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:41
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:22
msgid ""
-"Moves a given player into the hole. This throws an IllegalArgumentException "
-"if the specified player is not near the hole (at most one base away)."
+"Then, to pick the right color, the easier is to use the <code>%</code> "
+"(modulo) operator. For example, <code>(i + 5) % size</code> allows to "
+"retrieve the <code>i</code>th cell of an array of size <code>size</code> "
+"with an offset of <code>5</code>."
msgstr ""
-"Déplace un joueur dans le trou. Une exception IllegalArgumentException est "
-"levée si le joueur indiqué n'est pas suffisamment près du trou. Il peut être "
-"au plus à une base du trou."
+"Ensuite, pour trouver la bonne couleur à utiliser, le plus simple est "
+"d'utiliser l'opérateur <code>%</code> (modulo). Par exemple, <code>(i + 5) % "
+"taille</code> permet de trouver la <code>i</code>ieme case d'un tableau de "
+"taille <code>taille</code> quand on applique un décalage de <code>5</code> "
+"cases."
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:27
+msgid "You're up."
+msgstr "À vous de jouer."
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/NaiveBaseball.html:1
-msgid "Naive Rainbow Baseball"
-msgstr "Baseball multicolore naïf"
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:1
+msgid "Searching for a given value"
+msgstr "Chercher une valeur donnée"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:3
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:3
msgid ""
-"Today, the buggles decided to play a baseball game, but they are rather out "
-"of luck, actually. First, kinda forgot the rules, and ... well ... they "
-"cannot find the ball and bats again. So they decided to \"adapt a bit\" the "
-"rules. As the are no ball, the buggles can only running around the field, "
-"what they do happily: for a while, all attending buggle run at full speed in "
-"all directions around the field."
+"The goal of this exercise is to search the cell of a given value, and return "
+"its position."
msgstr ""
-"Aujourd'hui, les buggles ont décidé de faire une partie de baseball, mais il "
-"faut avouer que ce n'est pas très bien engagé : elles ne se souviennent plus "
-"très bien des règles, et ... euh ... elles ont perdu les battes et les "
-"balles. Elles ont donc décidé «d'adapter un peu» les règles. Comme il n'y a "
-"plus de balle, la seule chose qu'elles peuvent faire est de courir sur le "
-"terrain. C'est d'ailleurs ce qu'elles ont fait pendant un moment : toutes "
-"les buggles présentes se sont mises à courir en tous sens sur le terrain."
+"L'objectif de cet exercice est de chercher la case contenant une valeur "
+"donnée, et de retourner sa position."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:9
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:5
msgid ""
-"But after a few collisions, they decide to invent new rules to organize a "
-"bit the game: They make one team per base and two players per team. One of "
-"the teams has only one player so that its base has an empty location. Then, "
-"the players are dispatched randomly around the bases, and the game for them "
-"is to reach their home base. The whole game stops when all players are "
-"home. There is no winning team: either all players win, or they all lose. "
-"Actually, this game is very different from the original baseball. The only "
-"rule that remains is that you can only run around the field, from one base "
-"to the next one, without crossing middle of the field."
+"To that extend, you should fill the method <code>indexOf()</code>, which "
+"parameters are the array to explore, and the value to search. If the value "
+"<code>lookingFor</code> is not in the array <code>tab</code>, the method "
+"should return -1."
msgstr ""
-"Mais après quelques collisions plus ou moins douloureuses, elles décident "
-"d'inventer de nouvelles règles pour organiser la partie. Elles décident de "
-"faire une équipe par base sur le terrain et deux joueurs par équipes. L'une "
-"des équipes n'a qu'un seul joueur pour que l'une des bases ait un "
-"emplacement vide. Ensuite, les joueurs se répartissent aléatoirement sur les "
-"bases, et le jeu est de faire en sorte que chaque joueur retourne sur sa "
-"base. La partie s'arrềte quand tous les joueurs sont chez eux. Il n'y a pas "
-"d'équipe gagnante : soit tous les joueurs remportent la partie, soit ils la "
-"perdent tous. Oui, c'est vrai, ce jeu est très différent du baseball "
-"habituel. La seule règle qui reste est qu'il faut courir autour du terrain, "
-"de base en base, sans jamais passer au centre du terrain."
+"Pour cela, il vous faut remplir le corps de la méthode <code>indexOf()</"
+"code>. Ses paramètres sont le tableau <code>tab</code> à explorer et la "
+"valeur <code>lookingFor</code> à chercher. Si la valeur <code>lookingFor</"
+"code> n'est pas dans le tableau <code>tab</code>, la méthode doit renvoyer "
+"-1."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:17
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:9
msgid ""
-"Now, they are asking you to help them deciding who and when should move so "
-"that each player returns to its base. Only one buggle can move at each "
-"round, from its position to the empty spot. The maximal distance that a "
-"buggle can cover in one round is of one base."
+"The idea of the algorithm is to sweep over the whole array, checking the "
+"value of each cell. If it's the searched value, you should return the index "
+"of the cell currently checked."
msgstr ""
-"Maintenant, les buggles ont besoin de vous pour décider qui doit bouger à "
-"quel moment de façon à ce que chacune rejoigne sa base. Une seule buggle "
-"peut bouger à chaque tour, de sa position jusqu'à l'emplacement vide. De "
-"plus, la distance maximale qu'une buggle peut parcourir en un tour est de "
-"une seule base."
+"L'idée de l'algorithme est de parcourir tout le tableau en vérifiant la "
+"valeur\n"
+"contenue dans chaque case. S'il s'agit de la valeur cherchée, vous devez\n"
+"renvoyer l'indice de la case actuellement explorée."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:21
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:13
msgid ""
-"So, at each round, the empty spot is on one base (say <code>B</code>), and "
-"you should decide which buggle enters that empty spot. There is four "
-"candidates (two from base <code>B-1</code> and two from base <code>B+1</"
-"code>). Actually, there is a fifth candidate since the buggle that is on the "
-"same base than the empty spot can change its position, but that's not really "
-"helping."
+"Remember that indices begin at 0 and not at 1. So, if there is 3 cells, "
+"their indices will be 0, 1 and 2. There would not be any cell numbered 3."
msgstr ""
-"Ainsi, à chaque tour, l'emplacement vide se trouve sur une base (disons "
-"<code>B</code>), et vous devez décider quelle buggle occupera cette place. "
-"Il y a quatre candidates : deux de la base <code>B-1<code>, et deux de la "
-"base <code>B+1</code>. En fait, il y a une cinquième candidate puisque la "
-"buggle qui se trouve sur la même base que le trou peut aller l'occuper, mais "
-"ça ne fait pas vraiment avancer le problème."
+"N'oubliez pas que les cases sont sont numérotées à partir de 0. Donc, si "
+"vous avez 3 cases, leurs indices seront 0, 1 et 2. Il n'y aura pas de case "
+"numérotée 3."
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/NaiveBaseball.html:26
-msgid "The Naïve algorithm"
-msgstr "Algorithme naïf"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:16
+msgid ""
+"Remember also that the amount of cells in an array can be retrieved using "
+"the <code>length</code> attribute. So, if your array is called <code>tab</"
+"code>, its size can be retrieved as <code>tab.length</code>. Note that "
+"there is no () after <code>length</code>. An attribute is a sort of variable "
+"embedded in another object (here, the array)."
+msgstr ""
+"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être "
+"retrouvé\n"
+"grâce à l'attribut <code>length</code>. Donc, si votre tableau s'appelle\n"
+"<code>tableau</code>, sa taille sera <code>tableau.length</code>. Notez "
+"qu'il\n"
+"n'y a pas de () après <code>length</code>. Un attribut est une sorte de\n"
+"variable embarquée dans un autre objet (ici, le tableau)."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:28
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:21
msgid ""
-"In this exercise, we will first explore a very simple algorithm. To decide "
-"which of the four candidate buggles should enter the empty spot, we first "
-"restrict ourselves and decide that buggles can only turn clockwise. Then, "
-"from the two remaining candidates, we pick the one that has the largest "
-"distance to cover to reach its base (turning clockwise). Click on the demo "
-"button: this works rather well in practice."
+"So, the last value of an array is given by <code>tab[tab.length - 1]</code>."
msgstr ""
-"Dans cet exercice, nous allons explorer un premier algorithme très simple. "
-"Pour décider laquelle des quatre candidates doit aller occuper l'emplacement "
-"vide, nous commençons par nous restreindre à tourner dans le sens des "
-"aiguilles d'une montre. Ensuite, parmi les deux candidates restantes, nous "
-"prenons celle qui a encore le plus de chemin à parcourir jusqu'à sa base "
-"(dans le sens des aiguilles d'une montre). Essayez la démonstration : cela "
-"marche plutôt bien en pratique."
+"Donc, la dernière valeur d'un tableau est donnée par <code>tab[tab.length "
+"-1]</code>."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:34
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:23
msgid ""
-"It's hard to find a simpler algorithm for this problem: While it's not "
-"sorted, search for the base containing the candidate buggles: if the hole is "
-"in base <code>B</code>, it's the base <code>B+1</code>, modulo the amount of "
-"bases. Then, compute the distance that each buggle of that base still has to "
-"run to reach its base (0 if it's already home). Once you found the buggle "
-"that should enter the empty spot, just use the <code>move</code> method on "
-"it, and iterate."
+"Remember also that the amount of cells in an array can be retrieved with the "
+"<code>len()</code> function. So, if your array is called <code>tab</code>, "
+"its size can be retrieved as <code>len(tab)</code>."
msgstr ""
-"Il est difficile d'imaginer un algorithme plus simple pour ce problème : "
-"tant que ce n'est pas trié, chercher la base contenant les candidates. Si le "
-"trou est sur la base <code>B</code>, il s'agit de la base <code>B+1</code> "
-"(modulo le nombre de bases). Ensuite, il faut calculer la distance que "
-"chacune des buggles de cette base doit encore parcourir (0 si elle est déjà "
-"chez elle). Une fois que vous avez sélectionné l'heureuse élue, utilisez la "
-"méthode <code>deplace</code> pour la faire bouger, avant de passer à "
-"l'itération suivante."
+"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être "
+"retrouvé\n"
+"grâce à la fonction <code>len()</code>. Donc, si votre tableau s'appelle\n"
+"<code>tableau</code>, sa taille sera <code>len(tableau)</code>."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:40
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:27
msgid ""
-"The main difficulty should be to get the few equations right: determining "
-"the base next to the hole should be easy, but determining the distance that "
-"a player has to cover may reveal a bit more challenging. Don't hesitate to "
-"draw pictures on a paper to cover all possible cases. It should not be that "
-"difficult either: there is not that many cases after all."
+"So, the last value of an array is given by <code>tab[ len(tab) - 1]</code>."
msgstr ""
-"La principale difficulté est peut-être d'écrire les quelques équations "
-"nécessaires sans se tromper. Trouver quelle est la base après le trou "
-"devrait être assez facile, mais calculer la distance que chaque joueur doit "
-"encore parcourir peut s'avérer plus problématique. N'hésitez pas à faire des "
-"dessins pour vérifier que votre équation marche dans tous les cas, il n'y a "
-"pas tant de cas possibles que cela après tout."
+"Donc, la dernière valeur d'un tableau est donnée par <code>tab[ len(tab) "
+"-1]</code>."
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/SelectBaseball.html:1
-msgid "Selection Baseball"
-msgstr "Baseball par selection"
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:1
+msgid "Index of the maximum value"
+msgstr "Indice de la valeur maximale"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:3
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:3
msgid ""
-"The previous algorithm is very pleasant: it's rather simple and rather fast "
-"to implement, but unfortunately, it is also rather wrong! In some cases, it "
-"never stops, which is obviously bad. If you don't believe it, just copy "
-"paste your previous code, and hit the run button. The first world of this "
-"exercise is one of these unfortunate situations that drives our previous "
-"algorithm crazy."
+"In this exercise, you must compute the index of the tab cell containing the "
+"biggest value."
msgstr ""
-"L'algorithme précédent est très plaisant : il est plutôt simple, assez "
-"rapide à implémenter, mais malheureusement, il est également carrément faux. "
-"Dans certains cas, il ne s'arrête jamais, ce qui n'est pas très bon. Si vous "
-"ne le croyez pas, copie/collez votre code et appuyez sur le bouton "
-"«Exécuter». Le premier monde de cet exercice est l'un de ces cas malheureux "
-"où notre algorithme devient fou."
+"Dans cet exercice, vous devez calculer l'indice de la case contenant la plus "
+"grande valeur du tableau."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:9
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:5
msgid ""
-"So we have to find another algorithm, preferably one that works in all cases."
+"For that, fill the <code>indexOfMaximum()</code> method. Its parameter is "
+"the array to explore. Should the array contain the searched value several "
+"times, you should return the index of the first occurrence."
msgstr ""
-"Il nous faut donc trouver un autre algorithme. De préférence un qui marche "
-"dans tous les cas."
+"Pour cela, remplissez la méthode <code>indexOfMaximum()</code> dont le "
+"paramètre est le tableau à explorer. Si jamais la plus grande des valeurs du "
+"tableau est répétée plusieurs fois, votre méthode doit renvoyer la position "
+"de la première occurence."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:11
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:9
msgid ""
-"For that, the best solution is to start from a well known algorithm instead "
-"of trying to invent a new one from scratch as we just did. When you think a "
-"bit about this problem, this can is very similar to a sorting problem: Just "
-"make sure that the players are sorted by their colors and you're set. And "
-"while we are at it, let's generalize the game to allow more that 4 bases."
+"To solve this exercise, you should sweep over the whole array. For each "
+"value, if it's bigger than the biggest value you saw so far, you must save "
+"this new champion and its position. You will thus need 2 extra variables; "
+"the initial value of the champion could be the value of the first cell."
msgstr ""
-"Pour cela, la meilleure solution est d'adapter un algorithme connu au lieu "
-"de tenter de partir de zéro comme nous venons de faire. Quand on réfléchi un "
-"peu à ce problème, on reconnaît un certain air de famille avec le problème "
-"du tri : il suffit de <b>trier</b> les joueurs en fonction de leur couleur "
-"pour le résoudre. Et tant que nous y sommes, nous pouvons généraliser un peu "
-"le problème en utilisant plus de quatre bases."
+"Pour résoudre cet exercice, vous devez parcourir le tableau. Pour chaque "
+"case,\n"
+"si sa valeur est plus grande que la plus grande des valeurs que vous avez\n"
+"rencontré jusque là, sauvegardez cette nouvelle championne et sa position. "
+"Il\n"
+"vous faut donc deux nouvelles variables; la valeur initiale de la "
+"championne\n"
+"pourrait être la valeur rangée dans la première case."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:1
+msgid "Average value"
+msgstr "Valeur moyenne"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:17
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:4
msgid ""
-"Let's adapt the selection sort to our situation. The big lines of the "
-"algorithm is then \"for each base, select the players that should occupy "
-"this base and make sure that they come to their position\". This way, we "
-"will grow an sorted area where all players are already sorted (and never "
-"changed) while the unsorted area shrinks."
+"The objective of this exercise is to compute the average value of the "
+"integer values stored in an array."
msgstr ""
-"Adaptons le tri par sélection à notre situation. Les grandes lignes de cet "
-"algorithme sont les suivantes : «pour chaque base, trouver dans la zone pas "
-"encore triée les joueurs qui doivent occuper cette base, puis les y placer». "
-"De la sorte, on va faire grandir une zone triée qu'on ne modifie plus "
-"jamais, tout en faisant réduire la taille de la zone pas encore triée."
+"L'objectif de cet exercice est de calculer la valeur moyenne d'un tableau de "
+"valeur entière."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:23
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:6
msgid ""
-"Selecting the player should be no problem; Do not hesitate to define some "
-"methods such as <code>findPlayer()</code> or <code>findPlayerBase()</code>. "
-"This will ensure that your code remains understandable."
+"You have to fill the body of the method <code>average()</code> which takes "
+"as parameter the array of integers of which it computes and returns the "
+"average value. Please note that this method must return an integer."
msgstr ""
-"Choisir les joueurs à déplacer ne devrait pas poser de problème. N'hésitez "
-"pas à définir quelques fonctions comme <code>trouveJoueur</code> ou "
-"<code>trouveBaseJoueur()</code>. Cela améliorera la lisibilité de votre "
-"code, ce qui est toujours une bonne chose."
+"Vous devez donc remplir le corps de la méthode <code>average()</code> qui "
+"prend en paramètre le tableau, et qui retourne en résultat la valeur "
+"moyenne. Notez bien que cette méthode doit renvoyer un entier."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:27
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:8
msgid ""
-"The most problematic aspect is to move the selected players into position. "
-"For that, you have to move the hole to the position where the player is, and "
-"then move both the player and the hole to the base that is next to the "
-"player's goal (probably in a loop), and finally put the player in the right "
-"position of its target base."
+"To compute the average value of an integer, it is necessary to traverse the "
+"whole array and to compute the sum of all its values (so you will need a "
+"variable to store this temporary result), then you have to divide this sum "
+"by the size of the array."
msgstr ""
-"L'aspect le plus problématique est de déplacer les joueurs sélectionnés "
-"jusqu'à leur position. Pour cela, il vous faut déplacer le trou jusqu'à la "
-"base où se trouve le joueur, puis bouger ensuite le trou et le joueur de "
-"base en base jusqu'à celle avant la cible (au moyen d'une boucle). Enfin, on "
-"peut mettre le joueur dans la bonne case de sa base de prédilection."
+"Pour calculer la valeur moyenne d'un tableau, il faut parcourir l'ensemble "
+"des valeurs du tableau, en faire la somme (vous aurez donc besoin d'une "
+"variable pour conserver le résultat intermédiaire), puis diviser cette somme "
+"par le nombre de valeur contenu dans le tableau."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:32
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:10
msgid ""
-"As often in programming, the devil is in the details: there is a bunch of "
-"corner cases that you should detect and deal with correctly, such as the "
-"cases where the player is already in the base (but not in the position that "
-"you would like), or when the hole is on the right of the player (probably "
-"when you sort the first base). But you will find and hunt these while "
-"debugging your code."
+"In Java, you can get the size of an array <code>myarray</code> by consulting "
+"its <code>length</code> attribute (in other words, <code>myarray.length</"
+"code>). Notice that there is no parenthesis after <code>length</code>."
msgstr ""
-"Comme souvent en programmation, le diable est dans les détails, et il y a un "
-"certain nombre de cas particuliers à détecter et à gérer correctement, comme "
-"quand le joueur est déjà dans sa base de prédilection (mais pas dans la "
-"bonne position), ou quand le trou se trouve en fait à droite du joueur "
-"(probablement quand vous triez la première base). Mais vous allez trouver et "
-"résoudre ces problèmes quand vous débugguerez votre code."
+"En Java, vous pouvez retrouver la taille d'un tableau <code>monTableau</"
+"code> en consultant son attribut <code>length</code> (autrement dit, "
+"<code>monTableau.length</code>). Notez qu'il n'y a pas de parenthèses après "
+"<code>length</code>."
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:15
+msgid ""
+"In python, retrieving the size of an array <code>myarray</code> is as easy "
+"as calling <code>len(myarray)</code>."
+msgstr ""
+"En python, retrouver la taille d'un tableau est aussi simple qu'appeller "
+"<code>len(monTableau)</code>."
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/InsertBaseball.html:1
-msgid "Insertion Baseball"
-msgstr "Baseball par insertion"
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:1
+msgid "Maximal value"
+msgstr "Valeur maximale"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:3
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:3
msgid ""
-"The good point of adapting the selection sort to the baseball problem is "
-"that we know that it works (provided that our adaptation is correct). That's "
-"much better than the first naive algorithm, that was unable to converge to "
-"the solution in some situations. But actually, the selection sort is not "
-"perfect either as it requires a lot of swaps: we have to bring the hole to "
-"the selected player and then both the player and hole in position, and more. "
-"We can do better."
+"In this exercise, you must compute the maximal value contained in an array. "
+"For that, fill the <code>maximum()</code> method, which parameter is the "
+"array to explore."
msgstr ""
-"Le coté positif d'adapter le tri par sélection à notre problème est que nous "
-"savons que cela fonctionne (à condition que notre adaptation soit correcte). "
-"C'est bien mieux que notre premier algorithme naïf, qui était incapable de "
-"converger vers la solution dans certains cas. Cependant, le tri par "
-"sélection n'est pas parfait non plus, puisqu'il requiert beaucoup "
-"d'échanges : il faut amener le trou jusqu'au joueur sélectionné puis amener "
-"le joueur ET le trou vers la bonne base. On doit pouvoir faire mieux."
+"Dans cet exercice, vous devez retrouver le maximum des valeurs stockées dans "
+"un tableau. Pour cela, remplissez le corps de la méthode <code>maximum()</"
+"code>, dont le paramètre est le tableau à explorer."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:9
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:7
msgid ""
-"For example, each player can run quite a long way from its initial position "
-"to its target solution. Instead, it may be more interesting to split the "
-"field in two parts: one on the left where all players are sorted relatively "
-"to each others, and one on the right where the players are still at their "
-"initial positions. Then, at each iteration, we take the player at the border "
-"between the sorted and unsorted areas (that is, the left-most player of the "
-"unsorted area) and move it to the left (within the sorted area) until it "
-"reaches its position (that is, until the position where it's bigger that its "
-"left neighbor). This would at least reduce the travel of players to the "
-"sorted area as we use the first one on the border."
+"To compute this value, sweep over the whole parameter. For each value, if "
+"it's bigger than the biggest value you saw so far, you must save this value "
+"somewhere to remember it afterward. You thus need an extra variable, which "
+"can be initialized to the value of the first array cell."
msgstr ""
-"Par exemple, chaque joueur peut avoir à parcourir un chemin relativement "
-"long pour arriver à sa position finale. Au lieu de cela, il serait peut-être "
-"intéressant de couper le terrain en deux parties : l'une à gauche où tous "
-"les joueurs sont triés relativement les uns aux autres, et une autre à "
-"droite où les joueurs n'ont pas encore bougé de leur position de départ. "
-"Ensuite, à chaque itération, on prend le joueur à la frontière entre les "
-"deux zones (c'est à dire, le joueur le plus à gauche de la zone non triée) "
-"et on le déplace vers la gauche jusqu'à sa position dans la zone triée "
-"(c'est à dire, jusqu'à ce qu'il soit plus grand que son voisin de gauche). "
-"Cela réduirait au moins la distance que les joueurs doivent parcourir pour "
-"rentrer dans la zone triée, puisqu'on prend systématiquement le joueur à la "
-"frontière."
+"Pour résoudre cet exercice, parcourez le tableau. Pour chaque case, si sa\n"
+"valeur est plus grande que la plus grande des valeurs que vous avez "
+"rencontré\n"
+"jusque là, sauvegardez cette nouvelle championne pour retrouver sa valeur "
+"plus\n"
+"tard. Il vous faut donc une nouvelle variable, dont la valeur initiale peut "
+"être\n"
+"la valeur de la première case du tableau."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:1
+msgid "Occurrence of a value"
+msgstr "Occurrences d'une valeur"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:18
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:3
msgid ""
-"Actually, that's exactly what an insertion sort would do: maintain a sorted "
-"area on the left, and put iteratively the player on the border to its "
-"position within the sorted area. This is good, as we know that our algorithm "
-"is not inherently flawed since we adapt a well known one."
+"In this exercise, you must compute the amount of occurrences of a given "
+"value in an array (that is, the amount of time that this value appears in "
+"the array). For that, fill the <code>occurrences()</code> method, which "
+"returns the number of occurrence of <code>lookingFor</code> in <code>tab</"
+"code>."
msgstr ""
-"En fait, c'est exactement ce qu'un tri par insertion ferait: maintenir une "
-"zone triée à gauche, et y insérer à chaque itération l'élément qui se trouve "
-"à la frontière en le décalant vers la gauche jusqu'à sa position dans la "
-"zone triée. C'est une bonne chose, car cela veut dire que notre algorithme "
-"n'est pas fondamentalement faux, puisqu'il s'agit d'une adaptation d'un "
-"algorithme connu. "
+"Dans cet exercice, il vous faut calculer le nombre d'occurrences d'une "
+"valeur donnée, c'est à dire le nombre de fois que cette valeur apparaît dans "
+"le tableau. Pour cela, remplissez le corps de la méthode "
+"<code>occurrences()</code>, qui retourne le nombre d'occurrences de la "
+"valeur <code>lookingFor</code> dans le tableau <code>tab</code>."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:22
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:8
msgid ""
-"The easiest to adapt the insertion sort to the baseball problem is to "
-"consider all positions as adjacent and forget about bases. For that, we "
-"define the methods <code>getColor(pos)</code>, <code>move(pos)</code> and "
-"<code>getHole()</code> that all use a unique integer to designate a given "
-"position. These functions simply convert between the way to specify a "
-"position and then call the usual functions to interact with the world. If "
-"you have an <code>index</code> and want to convert it into a <code>base,pos</"
-"code>, then <code>base=index/2</code> and <code>pos=index%2</code>. To "
-"compute the reverse, <code>index=base*2+pos</code> (this works because "
-"<code>getPositionsAmount()</code> always returns 2)."
+"To compute this value, simply sweep over the array counting for the amount "
+"of cells containing the searched value. You thus need an extra variable for "
+"that."
msgstr ""
-"Le plus simple pour adapter le tri par insertion au problème du baseball est "
-"de considérer toutes les positions comme adjacentes sans tenir compte des "
-"différentes bases. Pour cela, il faut définir les méthodes "
-"<code>couleurJoueur(pos)</code>, <code>deplace(pos)</code> et "
-"<code>trouveTrou()</code> qui utilisent un seul entier pour désigner une "
-"position donnée et appellent les fonctions de base de cet univers pour faire "
-"leur travail. Pour convertir une position encodée sur un seul entier "
-"<code>index</code> en une position encodée sur deux entiers <code>base,pos</"
-"code>, il faut appliquer les formules suivantes: <code>base=index/2</code> "
-"et <code>pos=index%2</code>. Pour faire le calcul inverse, il faut utiliser "
-"<code>index=base*2+pos</code> (qui fonctionne car il y a deux positions par "
-"base)."
+"Pour calculer cette valeur, parcourez simplement le tableau en comptant le\n"
+"nombre de cases contenant la valeur cherchée que vous rencontrez. Il vous "
+"faut\n"
+"donc un paramètre supplémentaire pour cela."
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:31
-msgid ""
-"For the algorithm itself, you should first move the hole to the position 1. "
-"The position 0 is considered to be the sorted area (of size 1 for now) while "
-"the area above 2 is the unsorted area. Then comes an iteration to sort each "
-"element of the unsorted area. Since this iteration is a bit complex, you "
-"should think of its loop invariant, that is, the condition that is true "
-"before and after the loop and which explains that the loop fulfills its "
-"goal. Here, the loop invariant is twofold: First, the hole is between the "
-"sorted area and the unsorted area, and then, the every elements of the "
-"sorted area are ... well sorted relatively to their neighbors."
-msgstr ""
-"Pour l'algorithme lui-même, vous devriez tout d'abord bouger le trou en "
-"position 1. On considère alors que la zone triée se limite pour l'instant à "
-"la position 0 (elle est alors de taille 1) tandis que la zone non triée "
-"commence à partir de la position 2. Ensuite, on fait une itération par "
-"élément à trier. Comme le corps de cet itération est un peu plus compliqué "
-"que ce que nous avons écrit jusque là, vous devriez réfléchir à l'invariant "
-"de cette boucle, c'est à dire à la condition qui est vraie avant et après un "
-"passage dans la boucle, et qui fait que la boucle fait son travail. Ici, "
-"l'invariant a deux parties : tout d'abord, l'emplacement vide se trouve "
-"entre les parties triées et non triées, et ensuite, la zone triée est ... "
-"triée, c'est à dire que tous les éléments de cette zone sont bien triés par "
-"rapport à leurs voisins."
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/array123/Array123.html:1
+msgid "Array123"
+msgstr "Tableau123"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:39
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/array123/Array123.html:2
msgid ""
-"Then, the loop body to sort an element should first descend the hole and the "
-"elements within the sorted area until the element is larger than the element "
-"before in the sorted area (2 moves per position to travel), and then move "
-"the hole back to its position between the sorted and unsorted areas (1 move "
-"per position)."
+"Given an array of integers, return true if .. 1, 2, 3, .. appears in the "
+"array somewhere."
msgstr ""
-"Ensuite, le corps de la boucle devrait trier un élément en descendant cet "
-"élément et le trou dans la zone triée jusqu'au point où l'élément est à sa "
-"place dans la zone triée (cela demande deux déplacements par case à "
-"parcourir), avant de remonter le trou à sa place à la frontière (un "
-"déplacement par case à parcourir)."
+"Soit un tableau d'entiers, renvoyez vrai si .. 1, 2, 3, .. apparaissent "
+"quelquepart dans le tableau."
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:43
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/array667/Array667.html:1
+msgid "Array667"
+msgstr "Tableau667"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/array667/Array667.html:2
msgid ""
-"Once you insert the last element within the sorted area, your whole set is "
-"sorted and you're done. I preserve the surprise of the border cases that "
-"will require some little adjustments to your algorithm to make it work "
-"properly :)"
+"Given an array of integers, return the number of times that two 6's are next "
+"to each other in the array. Also count instances where the second \"6\" is "
+"actually a 7."
msgstr ""
-"Une fois que vous avez inséré le dernier élément dans la zone triée, tout "
-"votre ensemble est trié et vous avez fini. Je vous laisse la surprise des "
-"cas limites nécessitant de petits ajustements à votre algorithme pour lui "
-"permettre de fonctionner dans tous les cas :)"
+"Soit un tableau d'entiers, renvoyez le nombre de fois que deux 6 sont l'un à "
+"la suite de l'autre dans le tableau. Comptez également le nombre de fois où "
+"le deuxième \"6\" est en fait un 7."
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/BubbleBaseball.html:1
-msgid "Bubble Baseball"
-msgstr "Baseball à bulle"
+#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:1
+msgid "ArrayCount9"
+msgstr "Comptage de 9"
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:2
+msgid "Given an array of integers, return the number of 9's in the array."
+msgstr "Soit un tableau d'entiers, renvoyez le nombre de 9 dans ce tableau."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:1
+msgid "ArrayFront9"
+msgstr "Tableau commençant par 9"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:2
msgid ""
-"Crap, we adapted the insertion sort because our selection sort required too "
-"much moves to get the selected players to their position, but the insertion "
-"sort requires an inordinate amount of changes to get the border elements to "
-"their position within the sorted area without mixing the already sorted "
-"elements. At the end of the day, our selection variant was more efficient "
-"with at most <code>3*amountOfBase</code> moves to sort one element (1 to get "
-"the hole alongside with the player, and 2 to get the hole+player in "
-"position) while our insertion variant requires at most "
-"<code>3*amountOfPlayers</code> to sort one element (2 to descend the hole "
-"and player in position, 1 to get the hole back to its position). That's "
-"twice as bad as there is two players per base. It may be possible to improve "
-"the insertion sort by moving by more than one element when descending, but "
-"it seems uneasy (at least, while not mixing the already sorted elements) and "
-"it would probably only ensure that our insertion variant becomes as "
-"efficient as our selection variant, not dramatically better."
+"Given an array of integers, return true if one of the first 4 elements in "
+"the array is a 9. The array length may be less than 4."
msgstr ""
-"Zut, nous avions adapté le tri par insertion parce que notre tri par "
-"sélection nécessitait trop de déplacements pour mener les joueurs "
-"sélectionnés à leur position, mais le tri par insertion impose une quantité "
-"déraisonnable de déplacements pour déplacer les joueurs de la frontière "
-"jusqu'à leur place dans la section triée. Au final, notre variante par "
-"sélection était plus efficace, avec au pire <code>3*nombre de bases</code> "
-"déplacement par élément à trier (1 pour apporter le trou jusqu'au joueur à "
-"bouger, et 2 pour amener le joueur et le trou jusqu'à leur position "
-"finale). De son coté, notre variante par insertion nécessite au pire "
-"<code>3*nombre de joueurs</code> déplacements pour trier un élément (2 pour "
-"descendre le joueur et le trou à leur place, et 1 pour remonter le trou). "
-"C'est deux fois pire puisqu'il y a deux joueurs par base. Il serait "
-"probablement possible d'améliorer un peu notre variante par insertion en "
-"descendant plus vite le trou et le joueur, mais cela semble assez difficile "
-"(il ne faut pas mélanger les éléments déjà triés pendant la descente), et "
-"cela ne permettrait que de rendre cette variante aussi efficace que celle "
-"par sélection, pas de faire vraiment mieux. "
+"Soit un tableau d'entiers, renvoyez vrai si l'un des 4 premiers éléments "
+"dans ce tableau est un 9. Le tableau peut contenir moins de 4 éléments."
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:15
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/notriples/NoTriples.html:1
+msgid "NoTriples"
+msgstr "Pas de triplet"
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/notriples/NoTriples.html:2
msgid ""
-"If we cannot make the sort faster, we can make it easier. If you think about "
-"it, it seems rather natural to adapt the bubble sort to this problem: the "
-"hole becomes the bubble that moves up and down, sorting a bit the array "
-"during each traversal. The big lines are simply: \"while it's not sorted, "
-"move the hole down to base 0 (moving the biggest player of each base at each "
-"step) and then back to the maximal base (moving the smallest player of each "
-"base)\". After a while, <code>isSorted()</code> will return true and your "
-"algorithm will stop."
+"Given an array of integers, we'll say that a triple is a value appearing 3 "
+"times in a row in the array. Return true if the array does not contain any "
+"triples."
msgstr ""
-"Si nous ne pouvons pas rendre ce tri plus rapide, au moins nous pouvons le "
-"faire plus simplement. Quand on y pense, il semble assez naturel d'adapter "
-"le tri à bulle à ce problème : le trou devient la bulle qui monte et qui "
-"descend, en sortant peu à peu le tableau. Les grandes lignes de l'algorithme "
-"sont très simples : «tant que ce n'est pas trier, déplacer le trou vers le "
-"bas puis vers le haut. À chaque pas, c'est le plus petit des deux joueurs de "
-"la base qui descend, et le plus grand des deux qui monte (en fonction du "
-"sens de déplacement).». Après un moment, <code>estTrie()</code> devient "
-"vrai, et votre algorithme s'arrête."
+"Soit un tableau d'entiers, on dira qu'un triplet est une valeur qui apparait "
+"3 fois à la suite dans le tableau. Renvoyez vrai si le tableau ne contient "
+"pas de triplet."
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/has271/Has271.html:1
+msgid "Has271"
+msgstr "Contient 271"
#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:21
+#: src/lessons/welcome/array/has271/Has271.html:2
msgid ""
-"This is so easy that we introduce another variant of the problem, with more "
-"than two players per base. But actually, that shouldn't block you very "
-"long, should it?"
+"Given an array of integers, return true if it contains a 2, 7, 1 pattern -- "
+"a value, followed by the value plus 5, followed by the initial value minus "
+"1. So, 2,7,1 is such a pattern because 7 is 5+2 and 1 is 2-1. 3,8,2 is also "
+"such a pattern."
msgstr ""
-"C'est tellement simple que nous pouvons nous payer le luxe d'une autre "
-"variante du problème, avec plus de deux joueurs par base. Mais cela ne va "
-"pas vous ralentir longtemps, n'est ce pas?"
+"Soit un tableau d'entiers, renvoyez vrai si il contient un motif 2,7,1 -- "
+"une valeur, suivie de cette valeur plus 5, suivie par cette valeur moins "
+"1. \n"
+"Par exemple, 2,7,1 est un tel motif car 7=5+2 et 1=2-1. 3,8,2 est un autre "
+"motif correspondant."
#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:24
+#: src/lessons/welcome/array/has271/Has271.html:6
msgid ""
-"Surprisingly, the bubble sort variant requires ways less moves than the "
-"other variants. This is astonishing because usually, the bubble sort "
-"performs much worse than the others sorts, but it comes from the very good "
-"match between its big lines and the baseball universe. It actually happens "
-"rather often that a pleasantly written algorithm performs very decently. But "
-"this is not an universal rule either, as demonstrated by the naive algorithm "
-"of the first exercise, that was nice, simple and wrong ;)"
+"Additionally the 271 counts even if the \"1\" differs by 2 or less from the "
+"correct value."
msgstr ""
-"De manière étonnante, la variante à bulle semble nécessiter beaucoup moins "
-"de déplacements que les autres variantes. C'est assez surprenant car "
-"habituellement, le tri à bulle est la pire des variantes possibles, mais "
-"cela s'explique sans peine par les analogies entre cet algorithme et le "
-"problème du baseball multicolore. Il est relativement courant qu'un "
-"algorithme écrit simplement et naturellement se comporte bien en pratique. "
-"Il ne s'agit cependant pas d'une règle absolue, comme prouvé par "
-"l'algorithme simple et faux du premier exercice !"
+"De plus, le 271 compte même si le \"1\" diffère de 2 ou moins de la valeur "
+"correcte.<"
#. type: Content of: <h3>
#: src/lessons/turtleart/Main.html:1 src/lessons/turtleart/short_desc.html:1
@@ -14341,7 +14855,7 @@ msgstr ""
"en jouant."
#. type: Content of: <p>
-#: src/lessons/turtleart/short_desc.html:4
+#: src/lessons/turtleart/short_desc.html:5
msgid ""
"You should know the basic syntax of the programming language you will "
"choose, but no exhaustive programming practice is required to take this "
diff --git a/lib/l10n/plm.pot b/lib/l10n/plm.pot
index c8a969b..bf6098f 100644
--- a/lib/l10n/plm.pot
+++ b/lib/l10n/plm.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2013-09-30 12:10+0300\n"
+"POT-Creation-Date: 2013-11-13 15:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -359,7 +359,7 @@ msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/sort/SortingWorld.html:30 src/lessons/recursion/hanoi/universe/HanoiWorld.html:24 src/lessons/sort/pancake/universe/PancakeWorld.html:21
+#: src/plm/universe/sort/SortingWorld.html:30 src/lessons/sort/pancake/universe/PancakeWorld.html:21 src/lessons/recursion/hanoi/universe/HanoiWorld.html:27
msgid "Returns whether the current world is selected in the graphical interface."
msgstr ""
@@ -514,198 +514,231 @@ msgstr ""
#. type: Content of: <pre>
#: src/plm/universe/turtles/TurtleWorld.html:36
#, no-wrap
-msgid "[!java]void [/!]clear()"
+msgid "[!java]void [/!]hide()"
msgstr ""
#. type: Content of: outside any tag (error?)
#: src/plm/universe/turtles/TurtleWorld.html:37
-msgid "Removes any trail on the sheet."
+msgid "Hides the turtle."
msgstr ""
#. type: Content of: <pre>
#: src/plm/universe/turtles/TurtleWorld.html:39
#, no-wrap
-msgid "[!java]double [/!]getHeading()[!scala]:Double[/!]"
+msgid "[!java]void [/!]show()"
msgstr ""
#. type: Content of: outside any tag (error?)
#: src/plm/universe/turtles/TurtleWorld.html:40
-msgid "Returns the current heading of the turtle (in degrees)."
+msgid "Shows the turtle back."
msgstr ""
#. type: Content of: <pre>
#: src/plm/universe/turtles/TurtleWorld.html:42
#, no-wrap
-msgid "[!java]void [/!]setHeading([!java]double [/!]angle[!scala]:Double[/!])"
+msgid "[!java]boolean [/!]isVisible()[!scala]:Boolean[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
#: src/plm/universe/turtles/TurtleWorld.html:43
+msgid "Returns whether the turtle is currently visible."
+msgstr ""
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:45
+#, no-wrap
+msgid "[!java]void [/!]clear()"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:46
+msgid "Removes any trail on the sheet."
+msgstr ""
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:48
+#, no-wrap
+msgid "[!java]double [/!]getHeading()[!scala]:Double[/!]"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:49
+msgid "Returns the current heading of the turtle (in degrees)."
+msgstr ""
+
+#. type: Content of: <pre>
+#: src/plm/universe/turtles/TurtleWorld.html:51
+#, no-wrap
+msgid "[!java]void [/!]setHeading([!java]double [/!]angle[!scala]:Double[/!])"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/turtles/TurtleWorld.html:52
msgid "Sets a new heading to the turtle (in degrees)."
msgstr ""
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:45
+#: src/plm/universe/turtles/TurtleWorld.html:54
msgid "Functions about the pen"
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:47
+#: src/plm/universe/turtles/TurtleWorld.html:56
#, no-wrap
msgid "[!java]void [/!]penUp()"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:48
+#: src/plm/universe/turtles/TurtleWorld.html:57
msgid ""
"Moves the pen up (turtles have pens, not brushes as buggles). The turtle "
"will not leave any trace during its subsequent moves."
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:51
+#: src/plm/universe/turtles/TurtleWorld.html:60
#, no-wrap
msgid "[!java]void [/!]penDown()"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:52
+#: src/plm/universe/turtles/TurtleWorld.html:61
msgid ""
"Moves the pen down. The turtle will leave a trace during its subsequent "
"moves."
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:54
+#: src/plm/universe/turtles/TurtleWorld.html:63
#, no-wrap
msgid "[!java]boolean [/!]isPenDown()[!scala]:Boolean[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:55
+#: src/plm/universe/turtles/TurtleWorld.html:64
msgid "Returns the current pen position as a boolean."
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:57
+#: src/plm/universe/turtles/TurtleWorld.html:66
#, no-wrap
msgid "[!java]Color [/!]getColor()[!scala]:Color[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:58
+#: src/plm/universe/turtles/TurtleWorld.html:67
msgid "Returns the current pen color."
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:60
+#: src/plm/universe/turtles/TurtleWorld.html:69
#, no-wrap
msgid "[!java]void [/!]setColor([!java]Color [/!]color[!scala]:Color[/!])"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:61
+#: src/plm/universe/turtles/TurtleWorld.html:70
msgid "Changes the pen color."
msgstr ""
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:63
+#: src/plm/universe/turtles/TurtleWorld.html:72
msgid "Other functions"
msgstr ""
#. type: Content of: <pre>
-#: src/plm/universe/turtles/TurtleWorld.html:65 src/plm/universe/bugglequest/BuggleWorld.html:35 src/lessons/recursion/hanoi/universe/HanoiWorld.html:23
+#: src/plm/universe/turtles/TurtleWorld.html:74 src/plm/universe/bugglequest/BuggleWorld.html:35 src/lessons/recursion/hanoi/universe/HanoiWorld.html:26
#, no-wrap
msgid "[!java]boolean [/!]isSelected()[!scala]:Boolean[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/turtles/TurtleWorld.html:66
+#: src/plm/universe/turtles/TurtleWorld.html:75
msgid "Returns whether the current turtle is selected in the graphical interface."
msgstr ""
#. type: Content of: <h2>
-#: src/plm/universe/turtles/TurtleWorld.html:68 src/plm/universe/bugglequest/BuggleWorld.html:65
+#: src/plm/universe/turtles/TurtleWorld.html:77 src/plm/universe/bugglequest/BuggleWorld.html:65
msgid "Valid colors"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:70 src/plm/universe/bugglequest/BuggleWorld.html:67
+#: src/plm/universe/turtles/TurtleWorld.html:79 src/plm/universe/bugglequest/BuggleWorld.html:67
msgid "Name"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:70 src/plm/universe/bugglequest/BuggleWorld.html:67
+#: src/plm/universe/turtles/TurtleWorld.html:79 src/plm/universe/bugglequest/BuggleWorld.html:67
msgid "Color"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:71 src/plm/universe/bugglequest/BuggleWorld.html:68
+#: src/plm/universe/turtles/TurtleWorld.html:80 src/plm/universe/bugglequest/BuggleWorld.html:68
msgid "Color.black"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:71 src/plm/universe/turtles/TurtleWorld.html:72 src/plm/universe/turtles/TurtleWorld.html:73 src/plm/universe/turtles/TurtleWorld.html:74 src/plm/universe/turtles/TurtleWorld.html:75 src/plm/universe/turtles/TurtleWorld.html:76 src/plm/universe/turtles/TurtleWorld.html:77 src/plm/universe/turtles/TurtleWorld.html:78 src/plm/universe/turtles/TurtleWorld.html:79 src/plm/universe/turtles/TurtleWorld.html:80 src/plm/universe/turtles/TurtleWorld.ht [...]
+#: src/plm/universe/turtles/TurtleWorld.html:80 src/plm/universe/turtles/TurtleWorld.html:81 src/plm/universe/turtles/TurtleWorld.html:82 src/plm/universe/turtles/TurtleWorld.html:83 src/plm/universe/turtles/TurtleWorld.html:84 src/plm/universe/turtles/TurtleWorld.html:85 src/plm/universe/turtles/TurtleWorld.html:86 src/plm/universe/turtles/TurtleWorld.html:87 src/plm/universe/turtles/TurtleWorld.html:88 src/plm/universe/turtles/TurtleWorld.html:89 src/plm/universe/turtles/TurtleWorld.ht [...]
msgid " "
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:72 src/plm/universe/bugglequest/BuggleWorld.html:69
+#: src/plm/universe/turtles/TurtleWorld.html:81 src/plm/universe/bugglequest/BuggleWorld.html:69
msgid "Color.blue"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:73 src/plm/universe/bugglequest/BuggleWorld.html:70
+#: src/plm/universe/turtles/TurtleWorld.html:82 src/plm/universe/bugglequest/BuggleWorld.html:70
msgid "Color.cyan"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:74 src/plm/universe/bugglequest/BuggleWorld.html:71
+#: src/plm/universe/turtles/TurtleWorld.html:83 src/plm/universe/bugglequest/BuggleWorld.html:71
msgid "Color.darkGray"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:75 src/plm/universe/bugglequest/BuggleWorld.html:72
+#: src/plm/universe/turtles/TurtleWorld.html:84 src/plm/universe/bugglequest/BuggleWorld.html:72
msgid "Color.gray"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:76 src/plm/universe/bugglequest/BuggleWorld.html:73
+#: src/plm/universe/turtles/TurtleWorld.html:85 src/plm/universe/bugglequest/BuggleWorld.html:73
msgid "Color.green"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:77 src/plm/universe/bugglequest/BuggleWorld.html:74
+#: src/plm/universe/turtles/TurtleWorld.html:86 src/plm/universe/bugglequest/BuggleWorld.html:74
msgid "Color.lightGray"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:78 src/plm/universe/bugglequest/BuggleWorld.html:75
+#: src/plm/universe/turtles/TurtleWorld.html:87 src/plm/universe/bugglequest/BuggleWorld.html:75
msgid "Color.magenta"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:79 src/plm/universe/bugglequest/BuggleWorld.html:76
+#: src/plm/universe/turtles/TurtleWorld.html:88 src/plm/universe/bugglequest/BuggleWorld.html:76
msgid "Color.orange"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:80 src/plm/universe/bugglequest/BuggleWorld.html:77
+#: src/plm/universe/turtles/TurtleWorld.html:89 src/plm/universe/bugglequest/BuggleWorld.html:77
msgid "Color.pink"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:81 src/plm/universe/bugglequest/BuggleWorld.html:78
+#: src/plm/universe/turtles/TurtleWorld.html:90 src/plm/universe/bugglequest/BuggleWorld.html:78
msgid "Color.red"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:82 src/plm/universe/bugglequest/BuggleWorld.html:79
+#: src/plm/universe/turtles/TurtleWorld.html:91 src/plm/universe/bugglequest/BuggleWorld.html:79
msgid "Color.white"
msgstr ""
#. type: Content of: <table><tr><td>
-#: src/plm/universe/turtles/TurtleWorld.html:83 src/plm/universe/bugglequest/BuggleWorld.html:80
+#: src/plm/universe/turtles/TurtleWorld.html:92 src/plm/universe/bugglequest/BuggleWorld.html:80
msgid "Color.yellow"
msgstr ""
@@ -1104,6 +1137,44 @@ msgid ""
msgstr ""
#. type: Content of: <h1>
+#: src/plm/universe/bat/BatWorld.html:1
+msgid "BatWorld"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:3
+msgid ""
+"This world is a simplistic testing environment largely inspired from the "
+"http://codingbat.com invented by Nick Parlente."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:6
+msgid ""
+"The typical exercises are very short ones, aiming at improving the tactical "
+"programming abilities of the students. That is to say that you will be "
+"presented a quite long list of very little exercises about rather simple "
+"things. The idea is to train you on these issues until they become automatic "
+"to you."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:12
+msgid ""
+"In contrary to the other worlds, the BatWorld does not provide any fancy "
+"abstraction nor visualization. You have to fill a function, which gets "
+"called for a bunch of parameter sets, and that's it."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/plm/universe/bat/BatWorld.html:16
+msgid ""
+"For more information, you should refer to the CodingBat.com documentation, "
+"which contains for example a very useful documentation on boolean operators: "
+"http://codingbat.com/doc/ifboolean.html"
+msgstr ""
+
+#. type: Content of: <h1>
#: src/lessons/backtracking/Main.html:1
msgid "Backtracking lesson"
msgstr ""
@@ -5107,12 +5178,12 @@ msgid ""
msgstr ""
#. type: Content of: <h3>
-#: src/lessons/turmites/Main.html:21 src/lessons/sort/pancake/Main.html:29 src/lessons/sort/baseball/Main.html:27 src/lessons/turtleart/Main.html:11
+#: src/lessons/turmites/Main.html:21 src/lessons/sort/dutchflag/Main.html:8 src/lessons/sort/pancake/Main.html:29 src/lessons/sort/baseball/Main.html:27 src/lessons/turtleart/Main.html:11
msgid "What can I do to improve this PLM universe?"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/turmites/Main.html:23 src/lessons/sort/pancake/Main.html:31 src/lessons/sort/baseball/Main.html:29 src/lessons/turtleart/Main.html:13
+#: src/lessons/turmites/Main.html:23 src/lessons/sort/dutchflag/Main.html:10 src/lessons/sort/pancake/Main.html:31 src/lessons/sort/baseball/Main.html:29 src/lessons/turtleart/Main.html:13
msgid ""
"As usual, there are several things that could be done in the code of this "
"universe to improve it:"
@@ -6337,4081 +6408,4418 @@ msgid ""
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/recursion/Main.html:1
-msgid "Recursive algorithms"
-msgstr ""
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/Main.html:2
-msgid "This lesson allows to experiment with recursive algorithms."
+#: src/lessons/sort/dutchflag/Main.html:1 src/lessons/sort/dutchflag/short_desc.html:1 src/lessons/sort/dutchflag/DutchFlagAlgo.html:1 src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:1
+msgid "The Dutch Flag Problem"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/Main.html:4
+#: src/lessons/sort/dutchflag/Main.html:3
msgid ""
-"If you need more recursive algorithms, an exercise on recursive sorting "
-"algorithms (in particular QuickSort and MergeSort) is planned in the future "
-"within the sorting lesson."
+"This problem was first proposed by E.W Dijkstra in 1976 (in the chapter 14 "
+"of his book \"A Discipline of Programming\"). It is a very classical "
+"variation of the sorting algorithms since then. It is sometimes useful in "
+"real life, but it became famous for its pedagogical properties: its "
+"complexity is not trivial, but not complex either. It can easily be "
+"formally proven, but it's not absolutely trivial either."
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/recursion/short_desc.html:1
-msgid "Bases of recursion"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:12
+msgid "A temporal view could be welcomed."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/short_desc.html:2
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:13
msgid ""
-"Discover the recursive way of thinking by drawing trees and other figures "
-"with the Logo turtle."
+"Other exercises, for example with 2 colors only or with more than 3 colors, "
+"could generalize the proposed approach."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/square/FourSquare.html:1
-msgid "The small cousines of Buggles"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/dutchflag/Main.html:14
+msgid "This problem could be solved recursively."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:3
+#: src/lessons/sort/dutchflag/short_desc.html:3
msgid ""
-"Today, we will meet the small cousines of the buggles: the turtles. In fact, "
-"turtles are much olders than the buggles. They were invented in the 70's by "
-"a scientific from MIT called Seymour Papert to help teaching programming, "
-"and the buggles are a variation on the idea invented by Lyn Turbak from "
-"Wellesley College later."
+"This is a classical sorting problem, constituting a variation over the "
+"insertion sort."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:9
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:3
msgid ""
-"Turtles are thus a bit like buggles, but smaller. Just like buggles, you can "
-"order them to move forward, to turn, to move backward, etc. Just like "
-"buggles, they leave a line on their path when they move (but the line is "
-"much smaller)."
+"Your work is to sort all the colors of the Dutch flag, and the only provided "
+"primitive is to exchange two given lines. In addition, you should not "
+"create any additional variables (but a few indices)."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:14
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:6
msgid ""
-"The main difference is that where buggles can only move of right angles, "
-"turtles can move of any arbitrary angles specified by a real number (a "
-"double). This gives them much more liberty in their movings. The buggles can "
-"do several other tricks, like reading and writting messages, picking or "
-"dropping objects, and there is sometimes walls in their worlds (but all this "
-"is completely above the capacities of turtles)."
+"If you think carefully, this can be done in linear time, where you sort a "
+"line at each iteration of the loop. You may want to check again the <a "
+"href=\"plm://lessons.sort.basic/insertion.AlgInsertionSort\">insertion "
+"sort</a>, of which the Dutch Flag sort is a variation. The main difference "
+"is that you have 3 insertion points, not only one..."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:21
-msgid ""
-"From a practical point of view, most of the methods you knew about buggles "
-"still work with turtles, with some minor adaptations. In particular, the "
-"<code>forward()</code> method takes the amount of steps to do not as an "
-"integer, but as a [!python]point number[/!][!java|scala]double[/!] (see "
-"\"About this world\" for more details)."
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:10
+msgid "I need an hint to start"
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/recursion/square/FourSquare.html:28
-msgid "Doubles? But what is it?"
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:11
+msgid "Do a traversal over your data, saving 3 indices:"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/square/FourSquare.html:29
-msgid "It's simply a point number. Example:"
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:13
+msgid ""
+"<code>afterBlue</code> is initialized to 0. Make sure that every cell below "
+"<code>afterBlue</code> is filled with blue elements."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/square/FourSquare.html:31
-#, no-wrap
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:14
msgid ""
-"double x = 3.72;\n"
-"x + 1.234 // Value = 4.954\n"
-"x + 2. // Value = 5.72 (2. means 2.0)\n"
-"x + 2 // [!java]Value = 5.72 (2 automatically converted to "
-"2.0)[/!][!scala]Type error (+ operator don't mix Double and Int); manual "
-"conversion mandatory[/!]\n"
-"x * 2. // Value = 7.44 \n"
-"x / 2. // Value = 1.86 \n"
-"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Value = 1 (“casting to "
-"int”, converted to integer by truncating)\n"
-"Math.round(x) // Value = 2 (1.86 rounded to nearest integer)\n"
-"Math.floor(x) // Value = 1 (1.86 rounded toward minus infinity)\n"
-"Math.floor(-5.12) // Value = -6 (rounded toward minus infinity)\n"
-"Math.ceiling(x) // Value = 2 (1.86 rounded toward plus infinity)\n"
-"Math.ceiling(-5.12) // Value = -5 (rounded toward plus infinity)\n"
-"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 "
-"(“casted to double”, converted to double)\n"
+"<code>whiteRed</code> is initialized to size-1. Make sure that every cell "
+"after <code>whiteRed</code> is filled with red elements."
msgstr ""
-#. type: Content of: <p><p><p><h2>
-#: src/lessons/recursion/square/FourSquare.html:47 src/lessons/recursion/hanoi/HanoiBoard.html:20 src/lessons/welcome/array/basics/Array1.html:229
-msgid "Goal of this exercise"
+#. type: Content of: <div><ul><li>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:15
+msgid ""
+"<code>beforeWhite</code> is initialized to size-1. Make sure that every cell "
+"after <code>beforeWhite</code> and before <code>whiteRed</code> is filled "
+"with while elements."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:48
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:17
msgid ""
-"Even if this is the first exercise on the recursivity lesson, the code you "
-"have to write is not recursive. The goal is to get familiar with the turtle "
-"world before getting on serious matter."
+"Note that the unsorted cells are always between <code>afterBlue</code> and "
+"<code>beforeWhite</code>."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/square/FourSquare.html:52
+#. type: Content of: <div>
+#: src/lessons/sort/dutchflag/DutchFlagAlgo.html:19
msgid ""
-"You must reproduce a simple geometrical painting constituted of four 100 "
-"steps long squares (see the objective world for more details). It is "
-"obviously a good idea to write a method to draw a square, and then use it in "
-"your code."
+"At each step of your traversal, check the color of the cell at "
+"<code>afterBlue</code> and do the required exchanges. The loop ending "
+"condition is when <code>afterBlue</code> becomes larger than "
+"<code>beforeWhite</code>."
msgstr ""
#. type: Content of: <h2>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:1
-msgid "Fractal of polygons"
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:3
+msgid "Provided values"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:3
+#. type: Content of: <p>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:5
msgid ""
-"The fractal we will now draw is formed of a polygon, with little polygons on "
-"each corner. The prototype of the method drawing it is the following:"
+"The colors are represented through the following constants: BLUE, WHITE and "
+"RED. You can use them directly in your code."
+msgstr ""
+
+#. type: Content of: <h2>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:8
+msgid "Provided functions"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:10
+msgid "This world is very simple, with only 5 provided functions."
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:5
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:12
#, no-wrap
msgid ""
-"[!java]void [/!]polygonFractal ([!java]int [/!]levels[!scala]:Int[/!], "
-"[!java]int [/!]sides[!scala]:Int[/!], [!java]double "
-"[/!]length[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
+"[!java]void [/!]swap([!java]int [/!]x[!scala]:Int[/!], [!java]int "
+"[/!]y[!scala]:Int[/!])"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/polygonfractal/PolygonFractal.html:7 src/lessons/recursion/dragoncurve/DragonCurve1.html:25 src/lessons/recursion/dragoncurve/DragonCurve2.html:44
-msgid ""
-"Have a look at each world's objective view to understand how to write the "
-"function."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:13
+msgid "Swap the lines number <code>x</code> and <code>y</code>."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/koch/Koch.html:1
-msgid "Snow flake"
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:15
+#, no-wrap
+msgid "[!java]int [/!]getSize() [!scala]:Int[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/koch/Koch.html:3
-msgid ""
-"We will now draw snow flakes using the Koch fractal. A fractal is a "
-"geometric pattern repeated at every scale."
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:16
+msgid "Returns the amount of lines on this flag."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/koch/Koch.html:6
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:18
+#, no-wrap
msgid ""
-"The general form is a triangle, with each side given by several recursive "
-"calls. Your work is only to write the code of the <code>snowSide</code> "
-"method so that it draws one side of the triangle. To make it easier, each "
-"sides are represented in a specific color. Just draw the red things (without "
-"changing your pen color), and the other colors will be drawn automatically."
+"[!java]int [/!]getColor([!java]int [/!]line[!scala]:Int[/!]) "
+"[!scala]:Int[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/koch/Koch.html:12
-msgid ""
-"Observe the drawing in each world's objective to understand the pattern's "
-"logic, and then reproduce it. You must write the <code>snowSide()</code> "
-"method, which is recursive but <b>do not call snowFlake from snowSide</b>, "
-"or you will get very strange unexpected behaviors."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:19
+msgid "Returns the color of the given line."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/tree/Tree.html:1
-msgid "Trees"
+#. type: Content of: <pre>
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:21 src/lessons/sort/baseball/universe/BaseballWorld.html:30
+#, no-wrap
+msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/tree/Tree.html:3
-msgid ""
-"We will now draw trees. For that, we will write a method using double "
-"recursion following this prototype"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:22
+msgid "Returns whether the flag is sorted."
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/recursion/tree/Tree.html:5
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:24 src/lessons/sort/baseball/universe/BaseballWorld.html:36
#, no-wrap
-msgid ""
-"[!java]void [/!]tree([!java]int [/!]steps[!scala]:Int[/!], [!java]double "
-"[/!]length[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], "
-"[!java]double [/!]shrink[!scala]:Double[/!])"
+msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/tree/Tree.html:7
-msgid ""
-"To draw a tree of four levels, you have to draw a trunk of the given length, "
-"turn right of the given angle, draw a tree of level 3, turn left twice of "
-"the given angle, draw another tree of level 3, and come back to your initial "
-"location. Don't forget to come back to the initial location!"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/dutchflag/universe/DutchFlagWorld.html:25 src/lessons/sort/baseball/universe/BaseballWorld.html:37
+msgid "Returns whether the current world is selected in the interface."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/recursion/tree/Tree.html:12
-msgid ""
-"If a tree's trunk is of length 'len', the trunk of the next level tree will "
-"be of length 'len*shrink'."
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:1
+msgid "PancakeWorld"
msgstr ""
-#. type: Content of: <p><p><p><p><p>
-#: src/lessons/recursion/tree/Tree.html:15
-msgid ""
-"As you can see, each recursion level is represented by a distinctive "
-"color. For that, you have to call the <code>current(step)</code>, passing "
-"the current recursion level as a parameter. This will pick the right color "
-"for you. Don't erase your great colors when you move back to your initial "
-"location."
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:3
+msgid "This universe is very simple, with only five functions provided."
msgstr ""
-#. type: Content of: <p><p><p><p><p>
-#: src/lessons/recursion/tree/Tree.html:19
-msgid ""
-"If you get your function wrong, this can easily become hairly to debug as "
-"your errors will appear at each level of the recursion, completely changing "
-"the drawing. For debugging purpose, you can use the <code>subtree()</code> "
-"that will draw a correct subtree. This function is then very similar to the "
-"one you are trying to write. The only difference is that "
-"<code>subtree()</code> only draws in black. So, you can use it instead of a "
-"recursive call to debug your code, but you have to change for a proper "
-"recursive call to your own code (once it works) to get the colors right, "
-"and pass the exercise."
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:5
+#, no-wrap
+msgid "[!java]int [/!]getStackSize() [!scala]:Int[/!]"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:1
-msgid "Sierpinski's Triangle"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:6
+msgid "Returns the size of the stack, that is the amount of pancakes it contains."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:3
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:8
+#, no-wrap
msgid ""
-"The fractal we will now draw is formed of a big triangle inside which "
-"several smaller triangles are embedded. The prototype of the function to "
-"draw it is the following:"
+"[!java]int [/!]getPancakeRadius([!java]int [/!]rank[!scala]:Int[/!]) "
+"[!scala]:Int[/!]"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:9
+msgid ""
+"Returns the radius of the pancake passed as argument, with the rank of the "
+"top-most pancake being 0."
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:6
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:11
#, no-wrap
msgid ""
-"[!java]void [/!]sierpinski([!java]int [/!]level[!scala]:Int[/!], "
-"[!java]double [/!]length[!scala]:Double[/!])"
+"[!java]boolean [/!]isPancakeUpsideDown([!java]int [/!]rank[!scala]:Int[/!]) "
+"[!scala]:Boolean[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/sierpinski/Sierpinski.html:8
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:12
msgid ""
-"Have a look at each world's objective view to understand how to write the "
-"function. To draw one side of the triangle, draw a smaller recursive "
-"triangle (halve the length) and move forward by the requested length. "
-"Globally, you have to draw 3 such sides and turn by 120 between each side."
+"Returns whether the pancake passed as argument upside-down, that is, if its "
+"burned side is on top. As usual, the top-most pancake is of rank 0."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/spiral/Spiral.html:1
-msgid "Spirals"
+#. type: Content of: <pre>
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:14
+#, no-wrap
+msgid "[!java]void [/!]flip([!java]int [/!]amount[!scala]:Int[/!])"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/spiral/Spiral.html:3
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:15
msgid ""
-"We will now draw our first recursive function with the turtle. The goal is "
-"to draw different kind of spirals with the same function, which prototype is "
-"the following:"
+"Flips the <code>amount</code> first pancakes composing the stack, from the "
+"top of it."
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/recursion/spiral/Spiral.html:6
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:17
#, no-wrap
-msgid ""
-"[!java]void [/!]spiral([!java]int [/!]steps[!scala]:Int[/!], [!java]int "
-"[/!]angle[!scala]:Int[/!], [!java]int [/!]length[!scala]:Int[/!], [!java]int "
-"[/!]increment[!scala]:Int[/!])"
+msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/spiral/Spiral.html:8
-msgid ""
-"To help you understanding how to write it, here is an example of how the "
-"parameters change during one specific call:"
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:18
+msgid "Returns whether the pancake stack is correctly sorted."
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/recursion/spiral/Spiral.html:11
+#: src/lessons/sort/pancake/universe/PancakeWorld.html:20
#, no-wrap
-msgid ""
-"spiral(5, 90, 0, 3);\n"
-" forward(0);\n"
-" left(90);\n"
-" spiral(4,90,3,3);\n"
-" forward(3);\n"
-" left(90);\n"
-" spiral(3,90,6,3);\n"
-" forward(6);\n"
-" left(90);\n"
-" spiral(2,90,9,3);\n"
-" forward(9);\n"
-" left(90);\n"
-" spiral(1,90,12,3);\n"
-" forward(12);\n"
-" left(90);\n"
-" spiral(0,90,12,3);\n"
+msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/spiral/SpiralUse.html:1
-msgid "Drawing spirals"
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/Main.html:1 src/lessons/sort/pancake/BasicPancake.html:1
+msgid "Pancake Sorting"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:3
+#: src/lessons/sort/pancake/Main.html:3
msgid ""
-"This exercise is not really an exercise in that sense that you just have to "
-"click on the Execute button to get the reward: All the needed code is "
-"already provided. Instead, you can here explore the possibilities of the "
-"code you just wrote by changing the parameters of the call to the "
-"<code>spiral</code> function. You can move on to the next exercise if you "
-"are short on time, and come back later to play around."
+"This activity is inspired by a problem first introduced in 1975 by Harry "
+"Dweighter in the American Mathematical Monthly. The question is not only to "
+"sort the pancakes, but to determine <code>f(n)</code> the <i>minimal</i> "
+"amount of flips mandated to sort any stack of size <code>n</code>."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:9
+#: src/lessons/sort/pancake/Main.html:7
msgid ""
-"Here are some of the figures that you can produce with your "
-"<code>Spiral</code> function, provided that you come with the right "
-"parameters. You can switch to the creative mode (from the Session menu) to "
-"disable the world comparison when you explore with these spirals."
+"This problem is now famous because Bill Gates authored (with "
+"C. Papadimitriou) his only scientific publication in 1979 on this topic, "
+"providing a faster algorithm and proving that <code>17n/16 ≤ f(n) ≤ "
+"(5n+5)/3</code>. This was the only publication of Bill Gates before he "
+"invented Windows and became rich."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/spiral/SpiralUse.html:18
+#: src/lessons/sort/pancake/Main.html:11
msgid ""
-"If you discover a cool figure, don't forget to send your parameters (menu "
-"Help/feedback) so that we can add it to the list!"
+"Then, David X. Cohen, the inventor of the Futurama comics with many "
+"mathematical references, introduced the variant with burnt pancakes and "
+"studied its complexity with Manuel Blum in 1993."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:1
-msgid "Dragon curve (1)"
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/Main.html:14
+msgid ""
+"An article of 2012 (by L. Bulteau, G. Fertin and I. Rusu) proved that "
+"determining the minimal amount of flips to sort the stack is a NP-complete "
+"problem. Naturally, the stack sorting problem is not NP-complete since it "
+"can be solved in 2n-3 steps with the naive algorithm and (5n+5)/3 steps with "
+"the Gates algorithm. That's determining the minimal amount of steps that is "
+"NP."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:3
-msgid "The dragon curve is a classical example of recursive method."
+#: src/lessons/sort/pancake/Main.html:19
+msgid "Further information can be found on the wikipedia page, as usual."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:5
-msgid "The definition of this curve is the following:"
+#: src/lessons/sort/pancake/Main.html:22
+msgid ""
+"This activity is also integrated to CSIRL (my repository of <i>free</i> "
+"unplugged activities to introduce computer science, available at "
+"http://www.loria.fr/~quinson/Mediation/SMN/), and it may be interesting to "
+"run the unplugged activities before implementing these algorithms in PLM."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:6
-msgid "the dragon curve of order 1 is a vector between to arbitrary points P and Q,"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/Main.html:33
+msgid "A temporal view similar to the sorting universe could be helpful"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:7
-msgid ""
-"the dragon curve of order n is the dragon curve of order n-1 between P and "
-"R, followed by the same curve of order n-1 between R and Q (reverse side), "
-"where PRQ is an isoscele triangle with angle R being a right angle, and R "
-"being at the right of the PQ vector. Thus, if P and Q coordinates are (x, y) "
-"and (z, t), the coordinate (u, v) of R are given by:"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/Main.html:34
+msgid "Other exercises, for example on the Cohen's algorithm, or on the other ones."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:13 src/lessons/recursion/dragoncurve/DragonCurve2.html:26
-#, no-wrap
-msgid ""
-"u = (x + z)/2 + (t - y)/2\n"
-"v = (y + t)/2 - (z - x)/2\n"
+#. type: Content of: <h3>
+#: src/lessons/sort/pancake/short_desc.html:1
+msgid "The pancake problem"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:17
-msgid "The prototype of the method drawing the curve is the following:"
+#: src/lessons/sort/pancake/short_desc.html:3
+msgid "Help the poor psychorigid pancakes' chef to sort its pancake stack!"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:18 src/lessons/recursion/dragoncurve/DragonCurve2.html:22
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/short_desc.html:5
msgid ""
-"[!java]void [/!]dragon([!java]int [/!]order[!scala]:Int[/!], [!java]double "
-"[/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], "
-"[!java]double [/!]z[!scala]:Double[/!], [!java]double "
-"[/!]t[!scala]:Double[/!])"
+"This funny problem leads to algorithms that are somewhat more challenging to "
+"implement. You are supposed to master the bases of programming and some "
+"sorting algorithms to take this lesson."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve1.html:21
+#: src/lessons/sort/pancake/BasicPancake.html:3
msgid ""
-"You should use the method <code>setPos(x,y)</code> to put your turtle at "
-"coordinates (x,y) and the method <code>moveTo(z,t)</code> to draw a line "
-"between the turtle position and the point(z,t)."
-msgstr ""
-
-#. type: Content of: <h2>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:1
-msgid "The dragon curve (2)"
+"The pancake sorting problem this is a simple puzzle where you have a set of "
+"pancakes, each of differing size. The chef cooking the pancake is a bit "
+"psychorigid: he hates when the pancakes are not correctly sorted on the "
+"plate. He loves when they are correctly ordered, with the small ones over "
+"the larger ones. As every pancake maker, he masters the pancake flipping "
+"with his spatula. He can flip the pancake on top of the stack, or even "
+"several pancakes at once. The thing is that he has only one plate and the "
+"table is too dirty to place pancakes on it, even temporary. The only allowed "
+"operation is to flip some pancakes that are on top of the stack."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:3
+#: src/lessons/sort/pancake/BasicPancake.html:12
msgid ""
-"Previous solution induce that the turtle teleports to other location, or at "
-"the very least, that it moves its pen up during the drawing. Indeed, the end "
-"of the drawing of the first recursive call does not match the begining of "
-"the second recursive call. That is why we had to use the method "
-"<code>setPos()</code>"
+"Your work is to help this poor guy sorting his stack by flipping the "
+"pancakes. Each pancake is defined by its radius and rank within the stack, "
+"where the bottom pancake is at rank 0, and the one above at rank 1."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:9
+#: src/lessons/sort/pancake/BasicPancake.html:16
msgid ""
-"In this lesson, you will write a recursive method allowing to draw the "
-"dragon curve without taking the pen up. For that, we need another recursive "
-"method drawing the mirror side of the curve."
+"Note that you can play physically with pieces of paper or wood at first to "
+"get the grasp on this problem. This is even one of the activities that I use "
+"in my CS-IRL (computer science in real life) project to introduce the "
+"concept of algorithm to absolute beginners that wonder about our "
+"science. More information at http://www.loria.fr/~quinson/Mediation/SMN/ (in "
+"French)."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:13
-msgid ""
-"The method <code>dragon()</code> is then recursively defined using itself "
-"and <code>dragonReverse()</code>. Likewise, the method "
-"<code>dragonReverse()</code> is defined recursively using itself and "
-"<code>dragon()</code>. This is thus an example of <i>mutual recursion</i>."
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:22
+msgid "I don't get it. I need some help."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:20
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:23
msgid ""
-"The prototype of the <code>dragon()</code> method remains unchanged from "
-"previous exercise:"
+"You should try to first move the largest pancake to the bottom, and then the "
+"largest but one pancake on top of it, and then the one just smaller on top, "
+"and so on."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:24
-msgid ""
-"The new point's coordinate (u, v) introduced by the <code>dragon()</code> "
-"are:"
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:27
+msgid "The first tip was not enough. I need another one."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:30
-msgid "The prototype of the method <code>dragonReverse</code> is similar:"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:28
+msgid "So first, you need to move the largest pancake at the bottom of the stack."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:31
-#, no-wrap
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:29
msgid ""
-"[!java]void [/!]dragonReverse([!java]int [/!]order[!scala]:Int[/!], "
-"[!java]double [/!]x[!scala]:Double[/!], [!java]double "
-"[/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], "
-"[!java]double [/!]t[!scala]:Double[/!])"
+"Can you imagine a situation in which you can easily bring this damn large "
+"pancake to the bottom?"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:33
-msgid ""
-"The new point's coordinate (u, v) introduced by the "
-"<code>dragonReverse()</code> are:"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/BasicPancake.html:30
+msgid "How could you reach this situation from the current one?"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:35
-#, no-wrap
-msgid ""
-"u = (x + z)/2 - (t - y)/2\n"
-"v = (y + t)/2 + (z - x)/2\n"
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/BurnedPancake.html:1
+msgid "Burned Pancakes"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/dragoncurve/DragonCurve2.html:39
+#: src/lessons/sort/pancake/BurnedPancake.html:3
msgid ""
-"To make the work of each method recursiv more visible, the line painted by "
-"the <code>dragon()</code> must be red (<code>Color.red</code>) while the "
-"line painted by the <code>dragonReverse()</code> must be blue "
-"(<code>Color.blue</code>)."
+"Hard blow for the chef! The pancakes got burnt on one side! There is no way "
+"he can deliver a stack of pancakes with visibly burnt pancakes! You've got "
+"to help him ensuring that no pancake is upside-down while sorting his stack."
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/recursion/hanoi/Main.html:1 src/lessons/recursion/hanoi/short_desc.html:1
-msgid "Hanoi towers"
+#. type: Content of: <h1>
+#: src/lessons/sort/pancake/GatesPancake.html:1
+msgid "Faster Pancake Sorting"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/Main.html:2
+#: src/lessons/sort/pancake/GatesPancake.html:3
msgid ""
-"Here comes the super classical exercise on recursion. It's not very "
-"developped here, I'm not sure of what I could add to this lesson. If you "
-"have any idea, please submit them."
+"Unlike others sorting problem, the expensive operation is not the comparison "
+"of values, but the flipping of pancakes. In this exercise, we will explore "
+"another algorithm that attempt to reduce the amount of stack flipping. The "
+"funny side is that this algorithm was first introduced by Bill Gates, before "
+"invented Windows."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/short_desc.html:2
-msgid "Here comes the super classical exercise on recursion."
+#: src/lessons/sort/pancake/GatesPancake.html:8
+msgid ""
+"The basic idea is to grow sequences of sorted pancakes, not necessarily "
+"starting from the bottom. We say that a sequence of ordered pancakes "
+"constitute a <b>bloc</b> while a pancake that is not part of a bloc is said "
+"to be <b>free</b>. The algorithm then considers the topmost pancake (of "
+"radius <code>t</code>) and search for the <code>t+1</code> or "
+"<code>t-1</code> pancakes (the considered neighbor is noted "
+"<code>t+o</code>). Eight cases may happen:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/short_desc.html:4
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:15
msgid ""
-"This is an application exercise of recursion, that you should master to take "
-"this lesson."
+"<b>Case a</b>: Both <code>t</code> and <code>t+o</code> are free. They are "
+"then merged in one flip."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:1
-msgid "Tower of Hanoi"
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:19
+msgid ""
+"<b>Case b</b>: <code>t</code> is free, and <code>t+o</code> is the first of "
+"a block. They are merged in one flip."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:3
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:24
msgid ""
-"The Tower of Hanoi or Towers of Hanoi, also called the Tower of Brahma or "
-"Towers of Brahma, is a mathematical game or puzzle. It consists of three "
-"pegs, and a number of disks of different sizes which can slide onto any "
-"peg. The puzzle starts with the disks in a neat stack in ascending order of "
-"size on one peg, the smallest at the top, thus forming a pyramid."
+"<b>Case c</b>: <code>t</code> is free but both <code>t-1</code> and "
+"<code>t+1</code> are the last elements of blocks. Both blocs and "
+"<code>t</code> are merged all together in 4 flips. Beware, if either "
+"<code>t-1</code> or <code>t+1</code> does not exist (because <code>t</code> "
+"is 0 or max), only two flips are mandated."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/HanoiBoard.html:9
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:32
msgid ""
-"The objective of the puzzle is to move the entire stack to another peg, "
-"obeying the following rules:"
+"<b>Case d</b>: <code>t</code> is in a block but <code>t+o</code> is "
+"free. They are merged in one flip."
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:11
-msgid "Only one disk may be moved at a time."
+#: src/lessons/sort/pancake/GatesPancake.html:37
+msgid ""
+"<b>Case e</b>: <code>t</code> is in a block and <code>t+o</code> is the "
+"first element of a block. They are merged in one flip."
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:13
+#: src/lessons/sort/pancake/GatesPancake.html:41
msgid ""
-"Each move consists of taking the upper disk from one of the pegs and sliding "
-"it onto another peg, on top of the other disks that may already be present "
-"on that peg."
+"<b>Case f</b>: <code>t</code> is in a block and <code>t+o</code> is the last "
+"element of another block. They are merged in 3 flips as follows."
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:17
-msgid "No disk may be placed on top of a smaller disk."
+#: src/lessons/sort/pancake/GatesPancake.html:45
+msgid ""
+"<b>Case g</b>: <code>t</code> is in a block of length k+1 (the last element "
+"is <code>t+ko</code>), <code>t+(k+1)o</code> is either free or the last "
+"element of another block. Both blocks are merged in 2 flips:"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/HanoiBoard.html:22
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:48
msgid ""
-"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
-"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
-"[/!]other[!scala]:Int[/!], [!java]int [/!]height[!scala]:Int[/!])</code>"
+"<b>Case h</b>: <code>t</code> is in a block of length k+1 (the last element "
+"is <code>t+ko</code>), <code>t+(k+1)o</code> is the first element of another "
+"block (the difference with case g is that <code>t+(k+1)o</code> is now the "
+"<i>first</i> element of its block). Both blocks are merged in 2 flips:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:25
+#. type: Content of: <ul><li>
+#: src/lessons/sort/pancake/GatesPancake.html:54
msgid ""
-"This method will recursively solve the presented problem. The first "
-"parameter named <code>src</code> is the index of the initial tower, the "
-"second parameter <code>dst</code> is the index of the expected final tower, "
-"the third parameter <code>other</code> is the index of the unused peg while "
-"the fourth parameter <code>height</code> is the height of the tower."
+"<b>Case i</b>: <code>t</code> is in a block of length <code>n</code> (this "
+"block contains all pancakes). If <code>t</code> is not 1, the whole stack "
+"is fliped. The algorithm then stops."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:31
+#: src/lessons/sort/pancake/GatesPancake.html:57
msgid ""
-"A key to solving this puzzle is to recognize that it can be solved by "
-"breaking the problem down into a collection of smaller problems and further "
-"breaking those problems down into even smaller problems until a solution is "
-"reached."
-msgstr ""
-
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:35
-msgid "I don't get it, please give me some extra indications"
+"Each iteration increases the size of the blocks, so the algorithm eventually "
+"halts in all cases. A finer analysis would show that it takes at most "
+"<code>(5n+5)/3</code> steps to sort the stack. That's better than the naïve "
+"algorithm, that requires 2n-3 steps."
msgstr ""
-#. type: Content of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:36
-msgid "Here is the pseudo-code of the solution:"
+#. type: Content of: <h2>
+#: src/lessons/sort/pancake/GatesPancake.html:60
+msgid "Your turn"
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:38
-msgid "label the pegs A, B, C (these labels may move at different steps)"
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/GatesPancake.html:61
+msgid ""
+"You now have almost enough information to implement this algorithm on your "
+"own. We just have to remove the last remaining ambiguities to ensure that "
+"you implement exactly the same algorithm that the correction. If several "
+"cases apply to your situation, then you should use the first given one. For "
+"example, if both cases a and b apply (e.g., with <code>t-1</code> on case "
+"<b>a</b> and <code>t+1</code> on case <b>b</b>), then you should apply the "
+"flips of case <b>a</b>. If a given case applies for both <code>t+1</code> "
+"and <code>t-1</code>, then you should apply it to <code>t+1</code>."
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:39
-msgid "let n be the total number of discs (the height of the initial tower)"
+#. type: Content of: <p>
+#: src/lessons/sort/pancake/GatesPancake.html:67
+msgid ""
+"Note that it is somehow harder than the other exercises we did so far, so "
+"don't be surprised if you need more time to achieve this. But do not give "
+"hope, you can do it!"
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:40
-msgid "number the discs from 1 (smallest, topmost) to n (largest, bottommost)"
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:70
+msgid "Well, I need some help to start."
msgstr ""
-#. type: Content of: <div>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:43
-msgid "To move n discs from peg A to peg C:"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:71
+msgid ""
+"First write some helper functions such as <code>isFirst()</code> or "
+"<code>isFree()</code>. This will simplify your main algorithm afterward, "
+"that can be written very similarly to the explication above with a bunch of "
+"if conditions. Factorizing code this way often helps making your code more "
+"readable."
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:45
-msgid "move n−1 discs from A to B. This leaves disc number n alone on peg A"
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:78
+msgid "My code keeps failing and I don't know how to debug it."
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:46
-msgid "move disc number n from A to C"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:79
+msgid ""
+"To debug one world after the other and avoid that the messages of all worlds "
+"get intermixed, you can write your debug function only if the method "
+"<code>isSelected()</code> returns true. It will be so only for the entity "
+"that is currently selected in the graphical interface, that is probably the "
+"world you are currently debugging. This will help breaking the difficulty in "
+"parts by debugging the situation on after the other."
msgstr ""
-#. type: Content of: <div><ul><li>
-#: src/lessons/recursion/hanoi/HanoiBoard.html:47
-msgid "move n−1 discs from B to C so they sit on disc number n"
+#. type: Content of: <p><div>
+#: src/lessons/sort/pancake/GatesPancake.html:85
+msgid ""
+"In particular, it may help to print textually the state of the world each "
+"time you enter the main loop."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:1
-msgid "HanoiWorld"
+#: src/lessons/sort/baseball/Main.html:1
+msgid "The Rainbow Baseball Game"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:4
+#: src/lessons/sort/baseball/Main.html:3
msgid ""
-"This world implements the ultra-classical Hanoi problem. You are asked to "
-"move the disk pile from the stick where they are to the target stick (given "
-"as second parameter in the world's name -- number 1 for the default "
-"world). There is some extra constraint: you can only move one disk at a "
-"time, and you cannot move a big disk over a smaller one."
+"This activity is inspired from the orange game, from the \"Computer Science "
+"Unplugged\" activities repository. It was however heavily since then, first "
+"for the CSIRL (my repository of <i>free</i> unplugged activities to "
+"introduce computer science, available at "
+"http://www.loria.fr/~quinson/Mediation/SMN/) and now for PLM."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:11
-msgid "Only 3 functions are provided:"
+#: src/lessons/sort/baseball/Main.html:7
+msgid ""
+"In the literature, the generalized form of this problem is known as the "
+"pebble motion problem (the bases can be connected by any kind of graph, and "
+"the affinity of pebbles with bases may be different). Another variant of "
+"this problem is the well known 15-puzzle, with one player per base, and a "
+"two dimensional square grid. Much more information about these problems can "
+"be found on wikipedia, as usual."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:13
-#, no-wrap
-msgid "[!java]void [/!]move([!java]int [/!]src, [!java]int [/!]dst)"
+#. type: Content of: <h3>
+#: src/lessons/sort/baseball/Main.html:12
+msgid ""
+"How do you know that the naive algorithm won't loop on that initial "
+"situation?"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:15
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/Main.html:14
msgid ""
-"Moves one disk from the stick <code>src</code> onto the stick "
-"<code>dst</code>. If you try to do an invalid move (like laying a disk over "
-"a smaller one), an IllegalArgumentException is thrown."
+"Well, we simply tested all possible situations to see when this algorithm "
+"loops and when it finds the correct solution. We found that it works for all "
+"situations where no player is at home (there is 84 such situations for 4 "
+"bases, once you take the symmetries into account). It obviously works for "
+"some situations that do not respect this criteria (such as all situations it "
+"encounters from one of those 84 boards to the final state), but that's "
+"another story. Having such a criteria allows us to generate pseudo-random "
+"initial situations for the first exercise for which the algorithm we propose "
+"is guarenteed to work."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:19
-#, no-wrap
-msgid "[!java]int [/!]getSlotSize([!java]int [/!]slot)[!scala]:Int[/!]"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/Main.html:21
+msgid ""
+"We also explored bigger instances of the problem, and unfortunately, we have "
+"no such criteria for them. With 5 bases, the algorithm wrongly loops for 24 "
+"of the 1824 possible boards where no player is home (that's 1.31%). With 6 "
+"bases, it fails on 1251 of the 58860 such boards (2.12%). With 7 bases, it "
+"fails for 84444 out of 2633940 (that's 3.2%). I am still looking for a "
+"criteria ensuring that the algorithm won't loop. If you discover one, please "
+"report it. Ideally, it would be simple to enforce manually so that we can "
+"use it during our unplugged activities."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:20
+#. type: Content of: <ul><li>
+#: src/lessons/sort/baseball/Main.html:31
msgid ""
-"Returns the amount of disks placed on the specified slot. This is mainly "
-"used to initialize the recursion and set the amount of recursive call to "
-"execute."
+"Other graphical representations could be proposed, such as a linear one (for "
+"the existing exercises) or other ones (such as a grid or a tree, if an "
+"exercise on this kind of graph proves interesting)."
+msgstr ""
+
+#. type: Content of: <ul><li>
+#: src/lessons/sort/baseball/Main.html:33
+msgid ""
+"Other exercises on other algorithms on this variant, or on other variants "
+"such as the 15-puzzle."
msgstr ""
#. type: Content of: <h3>
-#: src/lessons/maze/Main.html:1 src/lessons/maze/short_desc.html:1
-msgid "Labyrinths"
+#: src/lessons/sort/baseball/short_desc.html:1
+msgid "Rainbow baseball"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/Main.html:3 src/lessons/maze/short_desc.html:3
-msgid "This lesson proposes several exercises about labyrinths in the buggle world."
+#: src/lessons/sort/baseball/short_desc.html:3
+msgid ""
+"This is another funny variation on the sorting problem, adapting the main "
+"sorting algorithms on an unusual context."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:1
-msgid "The crazy mouse"
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:1
+msgid "Rainbow Baseball"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:3
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:2
msgid ""
-"The day of your buggle starts badly. Out of luck, it got trapped into a "
-"maze. Help it finding its path out of there."
+"The colors are represented by integers, between <code>0</code> and "
+"<code>amount of bases -1</code>. The hole is represented by the special "
+"value <code>-1</code>. The color of each base is its rank. So base "
+"<code>1</code> is of color <code>1</code>. In the graphical interface, the "
+"base <code>0</code> is the dark blue one while the base <code>1</code> is "
+"the fuscia one."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:8
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:8
msgid ""
-"The exit is represented by a baggle and you need to pick this baggle in "
-"order to exit the maze."
+"Once every players on the field are in their home base, the hole should be "
+"in the last base, that is of rank <code>getBasesAmount()-1</code>."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:13
-msgid ""
-"Since the maze is so small, we can write the dumbest possible algorithm to "
-"do so. It relies on randomness and proves quite inefficient."
+#. type: Content of: <h2>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:11
+msgid "Functions to retrieve the world's dimensions"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:18
-msgid ""
-"While the buggle didn't find the path to the escape, it must proceed the "
-"following way: pick a random integer between 0 and 2 by using the provided "
-"<code>random3()</code> method and make one of the following actions: moving "
-"forward if possible, turn left or turn right."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:13
+#, no-wrap
+msgid "[!java]int [/!]getBasesAmount() [!scala]:Int[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/randommouse/RandomMouseMaze.html:24
-msgid ""
-"You don't believe that it could work? Well, give it a try, you will see... "
-"Don't forget to pick up the baggle once you've reached it."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:14
+msgid "Returns the amount of bases on this field."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:1
-msgid "Following the walls"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:16
+#, no-wrap
+msgid "[!java]int [/!]getPositionsAmount() [!scala]:Int[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:3
-msgid ""
-"This time, the maze is a bit more complicated. Random won't be enough, we "
-"ough to be smart!"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:17
+msgid "Returns the amount of player's positions per base on this field."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:6
-msgid ""
-"The good news is that this maze is simpler that it seems at the first "
-"glance: every wall are connected to each other. To get out of this kind of "
-"maze, the buggle only have to follow a wall (the one on its left or the one "
-"on its right, it doesn't matter). While keeping a paw on the wall, the "
-"buggle must move forward until it finds the maze exit and this biscuit it "
-"loves so much."
+#. type: Content of: <h2>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:19
+msgid "Functions to retrieve the world's state"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:13
-msgid ""
-"This works here because there is no island of isolated walls, so our buggle "
-"cannot loop around for ever without encountering its baggle."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:21
+#, no-wrap
+msgid "[!java]int [/!]getHoleBase() [!scala]:Int[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:17
-msgid ""
-"The goal of this exercise is to write an algorithm allowing the buggle to "
-"get out of this maze."
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:22
+msgid "Returns the base in which the hole is located."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:20
-msgid ""
-"As said earlier, it does not matter whether you decide to follow the left "
-"wall or the right one. Simply, the demo follows the left one, so you should "
-"do the same in your solution to ease the comparison of your solution and the "
-"demo."
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:24
+#, no-wrap
+msgid "[!java]int [/!]getHolePosition() [!scala]:Int[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:25
-msgid ""
-"Write a method <code>keepHandOnSideWall()</code> which lets the buggle move "
-"one step forward while keeping the paw on the wall of the selected side. You "
-"must ensure that the buggle always keep the paw on the wall, but also that "
-"it won't crash into a wall. You can check the tip for more info on this, but "
-"only do so if you're stuck. Try to do it without the tip first."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:25
+msgid "Returns the hole position within its base"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:32
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:27
+#, no-wrap
msgid ""
-"Then, write the whole algorithm to traverse the maze step by step (using "
-"<code>keepHandOnSideWall()</code>) until it finds the biscuit and the "
-"exit. Don't forget to pick the baggle up once you've found it."
+"[!java]int [/!]getPlayerColor([!java]int [/!]base[!scala]:Int[/!], "
+"[!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
msgstr ""
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:37
-msgid "I'm lost, please give me some extra indications"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:28
+msgid "Returns the color of the player at a given location."
msgstr ""
-#. type: Content of: <div><p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:38
-msgid ""
-"When your buggle has a wall on the left, there is three situations to "
-"consider, depending on the surrounding walls. The following table depicts "
-"each initial situation, and where you should let your buggle end after one "
-"step."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:31
+msgid "Returns whether all players of the field are at home."
msgstr ""
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:45
-msgid "Case 1"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:33
+#, no-wrap
+msgid "[!java]boolean [/!]isBaseSorted([!java]int [/!]base) [!scala]:Boolean[/!]"
msgstr ""
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:46
-msgid "Case 2"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:34
+msgid "Returns whether all players of a given base are at home."
msgstr ""
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:47
-msgid "Case 3"
+#. type: Content of: <h2>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:38
+msgid "Functions to change the world"
msgstr ""
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:49
-msgid "Initial situation"
+#. type: Content of: <pre>
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:40
+#, no-wrap
+msgid ""
+"[!java]void [/!]move([!java]int [/!]base[!scala]:Int[/!], [!java]int "
+"[/!]position[!scala]:Int[/!])"
msgstr ""
-#. type: Content of: <div><table><tr><td>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:54
-msgid "Where is the next step"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/sort/baseball/universe/BaseballWorld.html:41
+msgid ""
+"Moves a given player into the hole. This throws an IllegalArgumentException "
+"if the specified player is not near the hole (at most one base away)."
msgstr ""
-#. type: Content of: <div><p>
-#: src/lessons/maze/wallfollower/WallFollowerMaze.html:60
-msgid ""
-"If you do a <code>right()</code> in any case at the end of your function, "
-"it's possible to write it in 3 lines with a <code>while</code> loop."
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/NaiveBaseball.html:1
+msgid "Naive Rainbow Baseball"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/pledge/PledgeMaze.html:1
-msgid "Pledge algorithm"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/NaiveBaseball.html:3
+msgid ""
+"Today, the buggles decided to play a baseball game, but they are rather out "
+"of luck, actually. First, kinda forgot the rules, and ... well ... they "
+"cannot find the ball and bats again. So they decided to \"adapt a bit\" the "
+"rules. As the are no ball, the buggles can only running around the field, "
+"what they do happily: for a while, all attending buggle run at full speed in "
+"all directions around the field."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:3
+#: src/lessons/sort/baseball/NaiveBaseball.html:9
msgid ""
-"Once again, you thought that your algorithm were good enough to escape the "
-"maze, and once again, you buggle is now in a maze where your previous "
-"algorithm fails. Just give it a try: copy/paste your code and hit the "
-"\"Run\" button and see your creation fail. The trap is shaped like an upper "
-"case \"G\". The buggle enters the trap and follows the inner border. At some "
-"point, it finds the north direction free, run into that direction, and falls "
-"again in the trap."
+"But after a few collisions, they decide to invent new rules to organize a "
+"bit the game: They make one team per base and two players per team. One of "
+"the teams has only one player so that its base has an empty location. Then, "
+"the players are dispatched randomly around the bases, and the game for them "
+"is to reach their home base. The whole game stops when all players are "
+"home. There is no winning team: either all players win, or they all "
+"lose. Actually, this game is very different from the original baseball. The "
+"only rule that remains is that you can only run around the field, from one "
+"base to the next one, without crossing middle of the field."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:13
+#: src/lessons/sort/baseball/NaiveBaseball.html:17
msgid ""
-"The Pledge's algorithm (named after Jon Pledge of Exeter) can solve this "
-"maze."
+"Now, they are asking you to help them deciding who and when should move so "
+"that each player returns to its base. Only one buggle can move at each "
+"round, from its position to the empty spot. The maximal distance that a "
+"buggle can cover in one round is of one base."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:16
+#: src/lessons/sort/baseball/NaiveBaseball.html:21
msgid ""
-"This algorithm is a modification of the previous one thought to avoid "
-"obstacles. It randomly picks a heading and let the buggle move in that "
-"direction. When it encounters an obstacle, a paw (for example the left one) "
-"is kept on the wall following the obstacle while counting the turns. When "
-"the buggle is back to its original heading and when the sum of the turns is "
-"0, the buggle leaves the obstacle and continues keeping its original "
-"heading."
+"So, at each round, the empty spot is on one base (say <code>B</code>), and "
+"you should decide which buggle enters that empty spot. There is four "
+"candidates (two from base <code>B-1</code> and two from base "
+"<code>B+1</code>). Actually, there is a fifth candidate since the buggle "
+"that is on the same base than the empty spot can change its position, but "
+"that's not really helping."
+msgstr ""
+
+#. type: Content of: <h3>
+#: src/lessons/sort/baseball/NaiveBaseball.html:26
+msgid "The Naïve algorithm"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:24
+#: src/lessons/sort/baseball/NaiveBaseball.html:28
msgid ""
-"Note that the use of \"total turning\" rather than just the \"current "
-"direction\" allows the algorithm to avoid G-shapped traps. If one proceeds "
-"left into the trap, one gets turned around a full 360 degrees by the "
-"walls. As we said before, the naive \"current direction\" algorithm gets "
-"into a limit cycle as it leaves the lower rightmost wall heading left and "
-"runs into the curved section on the left again."
+"In this exercise, we will first explore a very simple algorithm. To decide "
+"which of the four candidate buggles should enter the empty spot, we first "
+"restrict ourselves and decide that buggles can only turn clockwise. Then, "
+"from the two remaining candidates, we pick the one that has the largest "
+"distance to cover to reach its base (turning clockwise). Click on the demo "
+"button: this works rather well in practice."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:31
+#: src/lessons/sort/baseball/NaiveBaseball.html:34
msgid ""
-"The Pledge's algorithm does not leave the rightmost wall due to the total "
-"turning not being zero at that point. It follows the wall all the way "
-"around, finally leaving it heading left on the bottom outside"
+"It's hard to find a simpler algorithm for this problem: While it's not "
+"sorted, search for the base containing the candidate buggles: if the hole is "
+"in base <code>B</code>, it's the base <code>B+1</code>, modulo the amount of "
+"bases. Then, compute the distance that each buggle of that base still has to "
+"run to reach its base (0 if it's already home). Once you found the buggle "
+"that should enter the empty spot, just use the <code>move</code> method on "
+"it, and iterate."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:38
+#: src/lessons/sort/baseball/NaiveBaseball.html:40
msgid ""
-"<a name=\"Objective\"/>You now have to modify your solution to implement the "
-"Pledge algorithm to escape this maze."
+"The main difficulty should be to get the few equations right: determining "
+"the base next to the hole should be easy, but determining the distance that "
+"a player has to cover may reveal a bit more challenging. Don't hesitate to "
+"draw pictures on a paper to cover all possible cases. It should not be that "
+"difficult either: there is not that many cases after all."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/SelectBaseball.html:1
+msgid "Selection Baseball"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:41
+#: src/lessons/sort/baseball/SelectBaseball.html:3
msgid ""
-"Change your <code>keepHandOnSideWall()</code> method to count the amount of "
-"turns done by the buggle (+1 when it turns left, and -1 when it turns "
-"right). This counting may require the addition of an <code>angleSum</code> "
-"integer value in your program."
+"The previous algorithm is very pleasant: it's rather simple and rather fast "
+"to implement, but unfortunately, it is also rather wrong! In some cases, it "
+"never stops, which is obviously bad. If you don't believe it, just copy "
+"paste your previous code, and hit the run button. The first world of this "
+"exercise is one of these unfortunate situations that drives our previous "
+"algorithm crazy."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:46
+#: src/lessons/sort/baseball/SelectBaseball.html:9
msgid ""
-"Write a boolean method <code>isDirectionFree(dir)</code> indicating if the "
-"provided direction is free, ie, if you can move in that direction (Note that "
-"the demo uses the NORTH direction for that). You can retrieve the current "
-"direction of the buggle using the method <code>getDirection()</code>. You "
-"can change your direction (without moving) using "
-"<code>setDirection(dir)</code>. Don't forget to store the previous direction "
-"of your buggle (in a dedicated variable) before checking if your favorite "
-"direction is free in order to restore your state afterward."
+"So we have to find another algorithm, preferably one that works in all "
+"cases."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:55
+#: src/lessons/sort/baseball/SelectBaseball.html:11
msgid ""
-"You may have to change the rest of your code also, but these changes should "
-"remain limited."
+"For that, the best solution is to start from a well known algorithm instead "
+"of trying to invent a new one from scratch as we just did. When you think a "
+"bit about this problem, this can is very similar to a sorting problem: Just "
+"make sure that the players are sorted by their colors and you're set. And "
+"while we are at it, let's generalize the game to allow more that 4 bases."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/pledge/PledgeMaze.html:58
+#: src/lessons/sort/baseball/SelectBaseball.html:17
msgid ""
-"Don't forget that if you have a method modifying a global variable (such as "
-"angleSum), you should ensure that it declares this variable as "
-"global. Without it, the method creates a new variable of the same name, and "
-"the global never gets modified."
+"Let's adapt the selection sort to our situation. The big lines of the "
+"algorithm is then \"for each base, select the players that should occupy "
+"this base and make sure that they come to their position\". This way, we "
+"will grow an sorted area where all players are already sorted (and never "
+"changed) while the unsorted area shrinks."
msgstr ""
-#. type: Content of: <div><pre>
-#: src/lessons/maze/pledge/PledgeMaze.html:62
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/SelectBaseball.html:23
msgid ""
-"def myMethod():\n"
-" global angleSum\n"
-" ...\n"
-" angleSum = angleSum + 1\n"
+"Selecting the player should be no problem; Do not hesitate to define some "
+"methods such as <code>findPlayer()</code> or "
+"<code>findPlayerBase()</code>. This will ensure that your code remains "
+"understandable."
msgstr ""
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/pledge/PledgeMaze.html:68
-msgid "Show an additional tip"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/SelectBaseball.html:27
+msgid ""
+"The most problematic aspect is to move the selected players into "
+"position. For that, you have to move the hole to the position where the "
+"player is, and then move both the player and the hole to the base that is "
+"next to the player's goal (probably in a loop), and finally put the player "
+"in the right position of its target base."
msgstr ""
-#. type: Content of: <div>
-#: src/lessons/maze/pledge/PledgeMaze.html:69
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/SelectBaseball.html:32
msgid ""
-"You should set your direction to your favorite one (NORTH is advised). Then, "
-"you should write the algorithm main loop. In other words, while your buggle "
-"did not find its biscuit, you have to move forward until next obstacle in "
-"the favorite direction. Then, put a paw on a wall (using "
-"(<code>keepHandOnSideWall()</code>) while the sum of turns is not null and "
-"the favorite direction is not free. Do that until you find your baggle."
+"As often in programming, the devil is in the details: there is a bunch of "
+"corner cases that you should detect and deal with correctly, such as the "
+"cases where the player is already in the base (but not in the position that "
+"you would like), or when the hole is on the right of the player (probably "
+"when you sort the first base). But you will find and hunt these while "
+"debugging your code."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/island/IslandMaze.html:1
-msgid "Lost between islands"
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/InsertBaseball.html:1
+msgid "Insertion Baseball"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/island/IslandMaze.html:3
+#: src/lessons/sort/baseball/InsertBaseball.html:3
msgid ""
-"You thought that your algorithm was enough to escape mazes? Well, not every "
-"mazes..."
+"The good point of adapting the selection sort to the baseball problem is "
+"that we know that it works (provided that our adaptation is correct). That's "
+"much better than the first naive algorithm, that was unable to converge to "
+"the solution in some situations. But actually, the selection sort is not "
+"perfect either as it requires a lot of swaps: we have to bring the hole to "
+"the selected player and then both the player and hole in position, and "
+"more. We can do better."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/island/IslandMaze.html:7
+#: src/lessons/sort/baseball/InsertBaseball.html:9
msgid ""
-"The <i>wall follower algorithm</i> we used so far only works if the entry "
-"and the exit are placed near to walls connected to the external wall. But if "
-"the buggle begins in the middle of the maze, it may exist wall sections "
-"disconnected from the external wall."
+"For example, each player can run quite a long way from its initial position "
+"to its target solution. Instead, it may be more interesting to split the "
+"field in two parts: one on the left where all players are sorted relatively "
+"to each others, and one on the right where the players are still at their "
+"initial positions. Then, at each iteration, we take the player at the border "
+"between the sorted and unsorted areas (that is, the left-most player of the "
+"unsorted area) and move it to the left (within the sorted area) until it "
+"reaches its position (that is, until the position where it's bigger that its "
+"left neighbor). This would at least reduce the travel of players to the "
+"sorted area as we use the first one on the border."
msgstr ""
-#. type: Content of: <p><p>
-#: src/lessons/maze/island/IslandMaze.html:12
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:18
msgid ""
-"That is why the previous strategy would let the buggle round around for "
-"ever. Indeed, the maze you should now escape from contains islands, and the "
-"buggle does not start along one of the external walls. Just give it a try if "
-"you want: copy your code over, push the run button and see your previous "
-"solution failing miserabily."
+"Actually, that's exactly what an insertion sort would do: maintain a sorted "
+"area on the left, and put iteratively the player on the border to its "
+"position within the sorted area. This is good, as we know that our algorithm "
+"is not inherently flawed since we adapt a well known one."
msgstr ""
-#. type: Content of: <p><p>
-#: src/lessons/maze/island/IslandMaze.html:18
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:22
msgid ""
-"The method of following a wall is still good and allow to escape very "
-"efficiently some sections of the maze, so we do not want to remove it "
-"entierely. Instead, we want to stop following the wall under some "
-"conditions. Notice that the baggle lays near to the external border of the "
-"maze. So, we want to reach the border and then follow that wall. We need for "
-"example to search for the north wall before following it to the baggle."
+"The easiest to adapt the insertion sort to the baseball problem is to "
+"consider all positions as adjacent and forget about bases. For that, we "
+"define the methods <code>getColor(pos)</code>, <code>move(pos)</code> and "
+"<code>getHole()</code> that all use a unique integer to designate a given "
+"position. These functions simply convert between the way to specify a "
+"position and then call the usual functions to interact with the world. If "
+"you have an <code>index</code> and want to convert it into a "
+"<code>base,pos</code>, then <code>base=index/2</code> and "
+"<code>pos=index%2</code>. To compute the reverse, "
+"<code>index=base*2+pos</code> (this works because "
+"<code>getPositionsAmount()</code> always returns 2)."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:26
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:31
msgid ""
-"To find the north wall, you simply run to the north as long as it's "
-"possible, and when facing an obstacle, you avoid it (using previous method)."
+"For the algorithm itself, you should first move the hole to the position "
+"1. The position 0 is considered to be the sorted area (of size 1 for now) "
+"while the area above 2 is the unsorted area. Then comes an iteration to "
+"sort each element of the unsorted area. Since this iteration is a bit "
+"complex, you should think of its loop invariant, that is, the condition that "
+"is true before and after the loop and which explains that the loop fulfills "
+"its goal. Here, the loop invariant is twofold: First, the hole is between "
+"the sorted area and the unsorted area, and then, the every elements of the "
+"sorted area are ... well sorted relatively to their neighbors."
msgstr ""
-#. type: Attribute 'alt' of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:30
-msgid "I'm lost now, please give me some extra indications"
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:39
+msgid ""
+"Then, the loop body to sort an element should first descend the hole and the "
+"elements within the sorted area until the element is larger than the element "
+"before in the sorted area (2 moves per position to travel), and then move "
+"the hole back to its position between the sorted and unsorted areas (1 move "
+"per position)."
msgstr ""
-#. type: Content of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:31
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/InsertBaseball.html:43
msgid ""
-"Our new run() method will consist in two modes: our buggle will alternate "
-"between the \"north runner mode\" and the \"left follower mode\". You begin "
-"in \"north runner mode\", and switch to \"left follower\" when you have a "
-"wall at the north (do not forget to make sure you have a wall at your left "
-"before switching to \"left follower\" mode). You switch to \"north runner\" "
-"as soon as your buggle is facing north and is not in front of a wall during "
-"its trip around its left wall. The easiest way to write such a state machine "
-"is something like"
+"Once you insert the last element within the sorted area, your whole set is "
+"sorted and you're done. I preserve the surprise of the border cases that "
+"will require some little adjustments to your algorithm to make it work "
+"properly :)"
msgstr ""
-#. type: Content of: <p><p><div><pre>
-#: src/lessons/maze/island/IslandMaze.html:39
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/sort/baseball/BubbleBaseball.html:1
+msgid "Bubble Baseball"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:3
msgid ""
-"[!scala]var state=0;\n"
-"state match {\n"
-" case 0 => // North runner\n"
-" ...\n"
-" state = 1;\n"
-" case 1 => // Left follower\n"
-" ...\n"
-" state = 0;\n"
-" case _ => println(\"This case should not happen. Please fix me\")\n"
-"}[/!][!java]int state=0;\n"
-"switch (state) {\n"
-" case 0: // North runner\n"
-" ...\n"
-" state = 1;\n"
-" break;\n"
-" case 1: // Left follower\n"
-" ...\n"
-" state = 0;\n"
-" break;\n"
-"}[/!][!python]northRunner = True\n"
-"if northRunner:\n"
-" ...\n"
-" northRunner = False\n"
-"else: # left follower\n"
-" ...\n"
-" northRunner = True[/!]"
+"Crap, we adapted the insertion sort because our selection sort required too "
+"much moves to get the selected players to their position, but the insertion "
+"sort requires an inordinate amount of changes to get the border elements to "
+"their position within the sorted area without mixing the already sorted "
+"elements. At the end of the day, our selection variant was more efficient "
+"with at most <code>3*amountOfBase</code> moves to sort one element (1 to get "
+"the hole alongside with the player, and 2 to get the hole+player in "
+"position) while our insertion variant requires at most "
+"<code>3*amountOfPlayers</code> to sort one element (2 to descend the hole "
+"and player in position, 1 to get the hole back to its position). That's "
+"twice as bad as there is two players per base. It may be possible to improve "
+"the insertion sort by moving by more than one element when descending, but "
+"it seems uneasy (at least, while not mixing the already sorted elements) and "
+"it would probably only ensure that our insertion variant becomes as "
+"efficient as our selection variant, not dramatically better."
msgstr ""
-#. type: Content of: <p><p><div>
-#: src/lessons/maze/island/IslandMaze.html:66
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:15
msgid ""
-"Don't forget the default case (matching _), or scala will issue an error "
-"since your matching would be incomplete.[/!]"
+"If we cannot make the sort faster, we can make it easier. If you think about "
+"it, it seems rather natural to adapt the bubble sort to this problem: the "
+"hole becomes the bubble that moves up and down, sorting a bit the array "
+"during each traversal. The big lines are simply: \"while it's not sorted, "
+"move the hole down to base 0 (moving the biggest player of each base at each "
+"step) and then back to the maximal base (moving the smallest player of each "
+"base)\". After a while, <code>isSorted()</code> will return true and your "
+"algorithm will stop."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:69
-msgid "Don't forget to let the buggle pick the baggle at the end of your code."
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:21
+msgid ""
+"This is so easy that we introduce another variant of the problem, with more "
+"than two players per base. But actually, that shouldn't block you very "
+"long, should it?"
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/maze/island/IslandMaze.html:72
+#. type: Content of: <p>
+#: src/lessons/sort/baseball/BubbleBaseball.html:24
msgid ""
-"You're up. That should be enough for you to figure out how to escape this "
-"maze, but if not, you can always request for the tip. But you do not need "
-"any more help, do you?"
+"Surprisingly, the bubble sort variant requires ways less moves than the "
+"other variants. This is astonishing because usually, the bubble sort "
+"performs much worse than the others sorts, but it comes from the very good "
+"match between its big lines and the baseball universe. It actually happens "
+"rather often that a pleasantly written algorithm performs very decently. But "
+"this is not an universal rule either, as demonstrated by the naive algorithm "
+"of the first exercise, that was nice, simple and wrong ;)"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:1
-msgid "Basic Shortest Path algorithm"
+#. type: Content of: <h1>
+#: src/lessons/recursion/Main.html:1
+msgid "Recursive algorithms"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/Main.html:2
+msgid "This lesson allows to experiment with recursive algorithms."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:3
+#: src/lessons/recursion/Main.html:4
msgid ""
-"To conclude with this introductory lesson to maze solving algorithms, we "
-"will investigate another way to find the exit. The buggle in this lesson is "
-"a special buggle: he is a jedi. He can feel the Force. This means he is able "
-"to feel his environment."
+"If you need more recursive algorithms, an exercise on recursive sorting "
+"algorithms (in particular QuickSort and MergeSort) is planned in the future "
+"within the sorting lesson."
+msgstr ""
+
+#. type: Content of: <h3>
+#: src/lessons/recursion/Main.html:8
+msgid "What can I do to improve this lesson?"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:7
+#: src/lessons/recursion/Main.html:10
msgid ""
-"Without even leaving his position, he can retrieve information about the "
-"world he is leaving in, with the following functions:"
+"As usual, there are several things that could be done in this lesson to "
+"improve it further:"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:9
-msgid "<code>getWorldWidth()</code> gives the width of its world."
+#: src/lessons/recursion/Main.html:12
+msgid ""
+"The Sierpinski triangle can be drawn using a simpler L-system. See "
+"http://jpvallon.free.fr/recursivite.html"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:10
-msgid "<code>getWorldHeight()</code> gives the height of its world."
+#: src/lessons/recursion/Main.html:13
+msgid ""
+"The arrowhead curve is also interesting: "
+"http://www.mathcurve.com/fractals/sierpinski/sierpinskitriangle.shtml"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:11
+#: src/lessons/recursion/Main.html:14
msgid ""
-"<code>hasTopWall(x,y)</code> tells whether the cell (x,y) of this world has "
-"a wall on top."
+"The dragon curve could be explained as a L-system: "
+"http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/heighway.htm"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:12
+#: src/lessons/recursion/Main.html:15
msgid ""
-"<code>hasLeftWall(x,y)</code> tells whether the cell (x,y) of this world has "
-"a wall on the left."
+"The dragon2 curve is called the twin dragon: "
+"http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/twindragon.htm"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:13
+#: src/lessons/recursion/Main.html:16
msgid ""
-"<code>hasBaggle(x,y)</code> tells whether the cell (x,y) of this world has a "
-"baggle."
+"The space filling curves could be added (Peano, Hildebert, etc). See: "
+"http://teachout1.net/village/fill.html"
msgstr ""
#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:14
+#: src/lessons/recursion/Main.html:18
msgid ""
-"<code>setIndication(x,y,i)</code> adds the integer indication <code>i</code> "
-"to the cell (x,y)."
+"We could do another exercise on embeeded polygons: "
+"http://www.inrialpes.fr/helix/people/genoud/ENSJAVA/tds/sujets/dessinsReccursifs/actionsrecursives.html"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:15
+#. type: Content of: <h3>
+#: src/lessons/recursion/short_desc.html:1
+msgid "Bases of recursion"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/recursion/short_desc.html:2
msgid ""
-"<code>getIndication(x,y,i)</code> retrieves the integer indication of the "
-"cell (x,y) (or 9999 if there is no indication)."
+"Discover the recursive way of thinking by drawing trees and other figures "
+"with the Logo turtle."
+msgstr ""
+
+#. type: Content of: <h2>
+#: src/lessons/recursion/square/FourSquare.html:1
+msgid "The small cousines of Buggles"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:18
+#: src/lessons/recursion/square/FourSquare.html:3
msgid ""
-"It has to be noted that it is not possible to build a wall on the bottom "
-"edge or on the right edge of a cell. Therefore when such wall exists, it "
-"means it was built on a sibling cells -- as a top (respectively left) wall "
-"on the cell that is located below (respectively at the right of) the current "
-"cell."
+"Today, we will meet the small cousines of the buggles: the turtles. In fact, "
+"turtles are much olders than the buggles. They were invented in the 70's by "
+"a scientific from MIT called Seymour Papert to help teaching programming, "
+"and the buggles are a variation on the idea invented by Lyn Turbak from "
+"Wellesley College later."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:24
+#: src/lessons/recursion/square/FourSquare.html:9
msgid ""
-"Your buggle should first write the distance to the exit on each cell (or at "
-"least the useful ones)."
+"Turtles are thus a bit like buggles, but smaller. Just like buggles, you can "
+"order them to move forward, to turn, to move backward, etc. Just like "
+"buggles, they leave a line on their path when they move (but the line is "
+"much smaller)."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:25
+#: src/lessons/recursion/square/FourSquare.html:14
msgid ""
-"For that, find the exit and write 0 there. Then, write 1 on every "
-"neighboring cells that is not separated from the exit with a wall. And then "
-"mark every cells from which you can reach the exit in 2 steps, and iterate "
-"for all cells until you mark the cell where the buggle is located."
+"The main difference is that where buggles can only move of right angles, "
+"turtles can move of any arbitrary angles specified by a real number (a "
+"double). This gives them much more liberty in their movings. The buggles can "
+"do several other tricks, like reading and writting messages, picking or "
+"dropping objects, and there is sometimes walls in their worlds (but all this "
+"is completely above the capacities of turtles)."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:30
+#: src/lessons/recursion/square/FourSquare.html:21
msgid ""
-"Once the cells are marked, get your jedi buggle to follow the shortest "
-"path. Basically the buggle has only to walk on each case with the lesser "
-"distance from the exit. You can use the method "
-"<code>setDirection(direction)</code> to make your buggle look at the "
-"specific direction such as <code>Direction.NORTH</code> or "
-"<code>Direction.EAST</code>."
+"From a practical point of view, most of the methods you knew about buggles "
+"still work with turtles, with some minor adaptations. In particular, the "
+"<code>forward()</code> method takes the amount of steps to do not as an "
+"integer, but as a [!python]point number[/!][!java|scala]double[/!] (see "
+"\"About this world\" for more details)."
msgstr ""
-#. type: Attribute 'alt' of: <div>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:35
-msgid "I'm lost now. Please give me some extra indications."
+#. type: Content of: <h3>
+#: src/lessons/recursion/square/FourSquare.html:28
+msgid "Doubles? But what is it?"
msgstr ""
-#. type: Content of: <div>
-#: src/lessons/maze/shortestpath/ShortestPathMaze.html:36
-msgid "Use the Force, Luke!"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/square/FourSquare.html:29
+msgid "It's simply a point number. Example:"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:1
-msgid "Finding the walls to follow"
+#. type: Content of: <pre>
+#: src/lessons/recursion/square/FourSquare.html:31
+#, no-wrap
+msgid ""
+"double x = 3.72;\n"
+"x + 1.234 // Value = 4.954\n"
+"x + 2. // Value = 5.72 (2. means 2.0)\n"
+"x + 2 // [!java]Value = 5.72 (2 automatically converted to "
+"2.0)[/!][!scala]Type error (+ operator don't mix Double and Int); manual "
+"conversion mandatory[/!]\n"
+"x * 2. // Value = 7.44 \n"
+"x / 2. // Value = 1.86 \n"
+"[!java](int) x[/!][!scala]x.asInstanceOf[Int][/!] // Value = 1 (“casting to "
+"int”, converted to integer by truncating)\n"
+"Math.round(x) // Value = 2 (1.86 rounded to nearest integer)\n"
+"Math.floor(x) // Value = 1 (1.86 rounded toward minus infinity)\n"
+"Math.floor(-5.12) // Value = -6 (rounded toward minus infinity)\n"
+"Math.ceiling(x) // Value = 2 (1.86 rounded toward plus infinity)\n"
+"Math.ceiling(-5.12) // Value = -5 (rounded toward plus infinity)\n"
+"[!java](double) 17[/!][!scala]17.asInstanceOf[Double][/!] // Value = 17.0 "
+"(“casted to double”, converted to double)\n"
+msgstr ""
+
+#. type: Content of: <p><p><p><h2>
+#: src/lessons/recursion/square/FourSquare.html:47 src/lessons/recursion/hanoi/HanoiBoard.html:20 src/lessons/welcome/array/basics/Array1.html:229
+msgid "Goal of this exercise"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:3
+#: src/lessons/recursion/square/FourSquare.html:48
msgid ""
-"This is exactly the same maze than before, but the buggle does not start at "
-"the same location. In particular, it does not have any wall to its left at "
-"the beginning."
+"Even if this is the first exercise on the recursivity lesson, the code you "
+"have to write is not recursive. The goal is to get familiar with the turtle "
+"world before getting on serious matter."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:7
+#: src/lessons/recursion/square/FourSquare.html:52
msgid ""
-"As a result, the method you wrote for the previous exercise probably don't "
-"work for this one. If you use it here with no modification, your buggle "
-"probably start looping over the four free cells around its start position "
-"(if that's not the case, well, you didn't really stick to the mission on "
-"previous exercise. Feel lucky and proceed to the next :)"
+"You must reproduce a simple geometrical painting constituted of four 100 "
+"steps long squares (see the objective world for more details). It is "
+"obviously a good idea to write a method to draw a square, and then use it in "
+"your code."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:14
+#. type: Content of: <h2>
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:1
+msgid "Fractal of polygons"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:3
msgid ""
-"This is because your <code>keepHandOnSideWall()</code> method has an "
-"implicit <b>pre-condition</b>: it works well if and only if the buggle has a "
-"wall to its left when you call it. Such pre-condition are very heavily used "
-"when programming. Specifying them explicitly helps understanding the code "
-"written by other, and they even allow sometimes to prove that the code works "
-"correctly."
+"The fractal we will now draw is formed of a polygon, with little polygons on "
+"each corner. The prototype of the method drawing it is the following:"
+msgstr ""
+
+#. type: Content of: <pre>
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:5
+#, no-wrap
+msgid ""
+"[!java]void [/!]polygonFractal ([!java]int [/!]levels[!scala]:Int[/!], "
+"[!java]int [/!]sides[!scala]:Int[/!], [!java]double "
+"[/!]length[!scala]:Double[/!], [!java]double [/!]shrink[!scala]:Double[/!])"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:24
+#: src/lessons/recursion/polygonfractal/PolygonFractal.html:7 src/lessons/recursion/dragoncurve/DragonCurve1.html:25 src/lessons/recursion/dragoncurve/DragonCurve2.html:44
msgid ""
-"Fixing the problem should be very easy. Simply make sure that the "
-"pre-condition of <code>keepHandOnSideWall()</code> is verified before "
-"calling it. For that, update your code to first look for a wall on its left "
-"before the big <code>while</code> loop."
+"Have a look at each world's objective view to understand how to write the "
+"function."
msgstr ""
-#. type: Content of: <h3>
-#: src/plm/universe/lightbot/LightBotWorld.html:1 src/lessons/lightbot/Main.html:1 src/lessons/lightbot/short_desc.html:1
-msgid "LightBot"
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/Koch.html:1
+msgid "Snow flake"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/plm/universe/lightbot/LightBotWorld.html:3
+#: src/lessons/recursion/koch/Koch.html:3
msgid ""
-"This universe introduces a little programming puzzle which can somehow be "
-"used to introduce programmation to non-reading kids since it is programmed "
-"graphically. The goal of each board is to light up all the lights. Your "
-"robot understands the following orders:"
-msgstr ""
-
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:7
-msgid "<b>Order</b>"
+"We will now draw snow flakes using the Koch fractal. A fractal is a "
+"geometric pattern repeated at every scale."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:7
-msgid "<b>Meaning</b>"
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/Koch.html:6
+msgid ""
+"The general form is a triangle, with each side given by several recursive "
+"calls. Your work is only to write the code of the <code>snowSide</code> "
+"method so that it draws one side of the triangle. To make it easier, each "
+"sides are represented in a specific color. Just draw the red things (without "
+"changing your pen color), and the other colors will be drawn automatically."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:8
-msgid "<b>Move forward</b>"
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/Koch.html:12
+msgid ""
+"Observe the drawing in each world's objective to understand the pattern's "
+"logic, and then reproduce it. At level 0, the Koch curve is just a straight "
+"line. At level 1, the curve is divided in three thirds, and the middle part "
+"is replaced by the two sides of an equilateral triangle of the same length "
+"as the segment being removed. At level 2, the process is repeated, whith "
+"each segments split in three parts and the middle part being replaced by the "
+"two sides of an equilateral triangle."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:8
-msgid "Cannot be done if the destination cell is of another height than source cell"
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/recursion/koch/Koch.html:19
+msgid "Too much letters. Please picture it."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:9
-msgid "<b>Jump forward</b>"
+#. type: Content of: <p><div><p>
+#: src/lessons/recursion/koch/Koch.html:20 src/lessons/recursion/koch/SquareKoch.html:8
+msgid "Here are the results of the first levels of recursion."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:9
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/Koch.html:24
msgid ""
-"Can only be done if the destination cell is one step higher than source "
-"cell, or if destination is lower than source. Cannot be used for plain "
-"moves."
+"You must write the <code>snowSide()</code> method, which is recursive but "
+"<b>do not call snowFlake from snowSide</b>, or you will get very strange and "
+"unexpected behaviors."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:10
-msgid "<b>Turn left</b>."
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/SquareKoch.html:1
+msgid "Snow square"
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:11
-msgid "<b>Turn right</b>."
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/SquareKoch.html:3
+msgid ""
+"This exercise is a variation over the snow flake that we saw previously. "
+"The main difference is that we are growing little squares instead of "
+"triangles on the sides of the figure."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:12
-msgid "<b>Switch the light</b>."
+#. type: Attribute 'alt' of: <p><div>
+#: src/lessons/recursion/koch/SquareKoch.html:7
+msgid "I don't see it, sorry. Please picture it."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:12
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/SquareKoch.html:13
msgid ""
-"Turn it on if it was off, and off if it was on. No effect if the cell does "
-"not contain any light."
+"As previously, your <code>squareSide</code> function should only draw one "
+"side of the figure, and the template will call it for all sides "
+"automatically (with one color per side)."
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:13
-msgid "<b>Call function 1</b>."
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/PentaKoch.html:1
+msgid "Snow pentagon"
msgstr ""
-#. type: Content of: <table><tr><td>
-#: src/plm/universe/lightbot/LightBotWorld.html:14
-msgid "<b>Call function 2</b>."
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/PentaKoch.html:3
+msgid ""
+"Here comes yet another variation of the Koch curve. This time, we grow "
+"little pentagons (ie, polygons with five sides each). I'm sure you get it "
+"now."
msgstr ""
#. type: Content of: <p>
-#: src/plm/universe/lightbot/LightBotWorld.html:17
+#: src/lessons/recursion/koch/PentaKoch.html:6
msgid ""
-"Please note that this world is not completely suited to small kids since the "
-"main difficulty comes from the fact that your are highly limited in the "
-"amount of instructions you can give to your robot. Advanced levels thus "
-"require to write sound functions, and are often above the capacities of "
-"small kids."
+"Another difference with earlier is that the length is not divided by three "
+"at each step anymore, but multiplied by 0.4. The curve looks better this way "
+":)"
msgstr ""
#. type: Content of: <p>
-#: src/plm/universe/lightbot/LightBotWorld.html:19
+#: src/lessons/recursion/koch/PentaKoch.html:9
msgid ""
-"This game is heavily inspirated from a flash game of the same name, which "
-"can for example be played on kongregate.com. It was written by Danny "
-"Yaroslavski (Coolio-Niato), the original idea being of Matt Chase."
+"We draw only one side in this exercise so your code will be called only once "
+"this time."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/lightbot/Main.html:2
-msgid ""
-"This lesson introduces a little programming puzzle inspired from a flash "
-"game."
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/HexaKoch.html:1
+msgid "Snow hexagon"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Main.html:4
-msgid "See the <i>About this world</i> dialog for more details."
+#: src/lessons/recursion/koch/HexaKoch.html:3
+msgid ""
+"This time, we will draw the curve that is known as the (6, 0.14)-Koch "
+"curve. This means that you have to grow 6-sided polygons on the segments, "
+"and that the length should be multiplied by 0.14 at each recursion level."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/short_desc.html:3
+#: src/lessons/recursion/koch/HexaKoch.html:7
msgid ""
-"This lesson constitutes a little brain teaser for programmers. You have to "
-"instruct your robot to turn off all lights. The trick is that you program "
-"your robot graphically, and that you are limited in the amount of "
-"instructions."
+"For the record, the origical Koch curve is the (3, 1/3)-Koch curve, the Snow "
+"square would be (4,1/3)-Koch curve while the Snow pentagon is also called "
+"the (5, 0.4)-Koch curve. If you want, you can switch to the creative mode in "
+"the menu and explore freely other Koch curves. Just change the initial call "
+"to hexaKoch to what you want."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/short_desc.html:8
-msgid "No previous experience is expected to take this lesson."
+#: src/lessons/recursion/koch/HexaKoch.html:12
+msgid ""
+"For further reference, please see <a "
+"href=\"http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm\">http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm</a>."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board01TwoSteps.html:1
-msgid "Welcome"
+#. type: Content of: <h2>
+#: src/lessons/recursion/koch/Crab.html:1
+msgid "Fractal Crab"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board01TwoSteps.html:3
+#: src/lessons/recursion/koch/Crab.html:3
msgid ""
-"Welcome to the lightbot world. This is merely a programmer puzzle rather "
-"than a real lesson (although some use it to teach programming). The robot "
-"is not programmed in Java, but rather graphically. You can see the existing "
-"orders in the documentation using the <i>About this world</i> menu."
+"The Crab curve is not exactly a Koch curve, but that's still a fractal and "
+"it's built rather similarly. This time, we grow square triangle on the side "
+"of the figure: the angle is 45 degrees, and the length is divided by "
+"[!java|scala]Math.sqrt(2)[/!][!python]math.sqrt(2)[/!] at each step."
msgstr ""
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:6
+#. type: Content of: <p>
+#: src/lessons/recursion/koch/Crab.html:7
msgid ""
-"The goal of each board is simply to switch on every lights of the board "
-"using your little robot."
+"Check the figures produced by the first steps of recursion to understand the "
+"pattern."
msgstr ""
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:8
-msgid ""
-"This is a introduction exercise, which should be solvable by only moving "
-"forward and switching the light, using respectively"
+#. type: Content of: <h3>
+#: src/lessons/recursion/koch/Crab.html:9
+msgid "Bibliographical note"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board01TwoSteps.html:10 src/lessons/lightbot/Board02Turn.html:4 src/lessons/lightbot/Board06Func.html:3
-msgid "and"
+#: src/lessons/recursion/koch/Crab.html:10
+msgid ""
+"This curve, also called the Lévy C curve was invented in 1938 by the French "
+"mathematician Paul Lévy in 1938. As usual, the wikipedia page is very "
+"instructive, and the page provide a very good additions: <a "
+"href=\"http://www.mathcurve.com/fractals/c/c.shtml\">http://www.mathcurve.com/fractals/c/c.shtml</a>."
msgstr ""
-#. type: Content of: <p><</p><p>
-#: src/lessons/lightbot/Board01TwoSteps.html:10
-msgid "."
+#. type: Content of: <h2>
+#: src/lessons/recursion/tree/Tree.html:1
+msgid "Trees"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board02Turn.html:1
-msgid "Turn around"
+#. type: Content of: <p>
+#: src/lessons/recursion/tree/Tree.html:3
+msgid ""
+"We will now draw trees. For that, we will write a method using double "
+"recursion following this prototype"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board02Turn.html:3
-msgid "Now, you probably need to turn in addition (using"
+#. type: Content of: <pre>
+#: src/lessons/recursion/tree/Tree.html:5
+#, no-wrap
+msgid ""
+"[!java]void [/!]tree([!java]int [/!]steps[!scala]:Int[/!], [!java]double "
+"[/!]length[!scala]:Double[/!], [!java]double [/!]angle[!scala]:Double[/!], "
+"[!java]double [/!]shrink[!scala]:Double[/!])"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board02Turn.html:4
-msgid ")."
+#: src/lessons/recursion/tree/Tree.html:7
+msgid ""
+"To draw a tree of four levels, you have to draw a trunk of the given length, "
+"turn right of the given angle, draw a tree of level 3, turn left twice of "
+"the given angle, draw another tree of level 3, and come back to your initial "
+"location. Don't forget to come back to the initial location!"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board03Jump.html:1
-msgid "Jump"
+#. type: Content of: <p><p><p>
+#: src/lessons/recursion/tree/Tree.html:12
+msgid ""
+"If a tree's trunk is of length 'len', the trunk of the next level tree will "
+"be of length 'len*shrink'."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board03Jump.html:3
-msgid "You can also jump using"
+#. type: Content of: <p><p><p><p><p>
+#: src/lessons/recursion/tree/Tree.html:15
+msgid ""
+"As you can see, each recursion level is represented by a distinctive "
+"color. For that, you have to call the <code>current(step)</code>, passing "
+"the current recursion level as a parameter. This will pick the right color "
+"for you. Don't erase your great colors when you move back to your initial "
+"location."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board03Jump.html:3
+#. type: Content of: <p><p><p><p><p>
+#: src/lessons/recursion/tree/Tree.html:19
msgid ""
-"to pass obstacles. You can either jump one level up or any amount of levels "
-"down, but you cannot jump to go on a cell of the same height."
+"If you get your function wrong, this can easily become hairly to debug as "
+"your errors will appear at each level of the recursion, completely changing "
+"the drawing. For debugging purpose, you can use the <code>subtree()</code> "
+"that will draw a correct subtree. This function is then very similar to the "
+"one you are trying to write. The only difference is that "
+"<code>subtree()</code> only draws in black. So, you can use it instead of a "
+"recursive call to debug your code, but you have to change for a proper "
+"recursive call to your own code (once it works) to get the colors right, "
+"and pass the exercise."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board04Stairs.html:1
-msgid "Stairs"
+#. type: Content of: <h2>
+#: src/lessons/recursion/sierpinski/Sierpinski.html:1
+msgid "Sierpinski's Triangle"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board04Stairs.html:3
-msgid "Can you pass these stairs?"
+#: src/lessons/recursion/sierpinski/Sierpinski.html:3
+msgid ""
+"The fractal we will now draw is formed of a big triangle inside which "
+"several smaller triangles are embedded. The prototype of the function to "
+"draw it is the following:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board05Higher.html:1
-msgid "Higher"
+#. type: Content of: <pre>
+#: src/lessons/recursion/sierpinski/Sierpinski.html:6
+#, no-wrap
+msgid ""
+"[!java]void [/!]sierpinski([!java]int [/!]level[!scala]:Int[/!], "
+"[!java]double [/!]length[!scala]:Double[/!])"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board05Higher.html:3
-msgid "Let's go higher"
+#: src/lessons/recursion/sierpinski/Sierpinski.html:8
+msgid ""
+"Have a look at each world's objective view to understand how to write the "
+"function. To draw one side of the triangle, draw a smaller recursive "
+"triangle (halve the length) and move forward by the requested length. "
+"Globally, you have to draw 3 such sides and turn by 120 between each side."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board06Func.html:1
-msgid "Functions"
+#. type: Content of: <h2>
+#: src/lessons/recursion/spiral/Spiral.html:1
+msgid "Spirals"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board06Func.html:3
-msgid "You can use"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/spiral/Spiral.html:3
+msgid ""
+"We will now draw our first recursive function with the turtle. The goal is "
+"to draw different kind of spirals with the same function, which prototype is "
+"the following:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/lightbot/Board06Func.html:3
+#. type: Content of: <pre>
+#: src/lessons/recursion/spiral/Spiral.html:6
+#, no-wrap
msgid ""
-"to call respectively the first and second functions. Define their code in "
-"their own tab."
+"[!java]void [/!]spiral([!java]int [/!]steps[!scala]:Int[/!], [!java]int "
+"[/!]angle[!scala]:Int[/!], [!java]int [/!]length[!scala]:Int[/!], [!java]int "
+"[/!]increment[!scala]:Int[/!])"
msgstr ""
-#. type: Content of: <p><p>
-#: src/lessons/lightbot/Board06Func.html:5
-msgid "This is great if you get out of space in your main function"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/spiral/Spiral.html:8
+msgid ""
+"To help you understanding how to write it, here is an example of how the "
+"parameters change during one specific call:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board07Repeat.html:1
-msgid "Repetitive tasks"
+#. type: Content of: <pre>
+#: src/lessons/recursion/spiral/Spiral.html:11
+#, no-wrap
+msgid ""
+"spiral(5, 90, 0, 3);\n"
+" forward(0);\n"
+" left(90);\n"
+" spiral(4,90,3,3);\n"
+" forward(3);\n"
+" left(90);\n"
+" spiral(3,90,6,3);\n"
+" forward(6);\n"
+" left(90);\n"
+" spiral(2,90,9,3);\n"
+" forward(9);\n"
+" left(90);\n"
+" spiral(1,90,12,3);\n"
+" forward(12);\n"
+" left(90);\n"
+" spiral(0,90,12,3);\n"
+msgstr ""
+
+#. type: Content of: <h2>
+#: src/lessons/recursion/spiral/SpiralUse.html:1
+msgid "Drawing spirals"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board07Repeat.html:3
-msgid "Functions are also of great use for repetitive tasks"
+#: src/lessons/recursion/spiral/SpiralUse.html:3
+msgid ""
+"This exercise is not really an exercise in that sense that you just have to "
+"click on the Execute button to get the reward: All the needed code is "
+"already provided. Instead, you can here explore the possibilities of the "
+"code you just wrote by changing the parameters of the call to the "
+"<code>spiral</code> function. You can move on to the next exercise if you "
+"are short on time, and come back later to play around."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board08Rec.html:1
-msgid "Calling functions from functions"
+#. type: Content of: <p>
+#: src/lessons/recursion/spiral/SpiralUse.html:9
+msgid ""
+"Here are some of the figures that you can produce with your "
+"<code>Spiral</code> function, provided that you come with the right "
+"parameters. You can switch to the creative mode (from the Session menu) to "
+"disable the world comparison when you explore with these spirals."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board08Rec.html:3
-msgid "It is perfectly okay to call a function from within a function!"
+#: src/lessons/recursion/spiral/SpiralUse.html:18
+msgid ""
+"If you discover a cool figure, don't forget to send your parameters (menu "
+"Help/feedback) so that we can add it to the list!"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board09Castle.html:1
-msgid "Castle"
+#. type: Content of: <h2>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:1
+msgid "Dragon curve (1)"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board09Castle.html:3
-msgid "You're getting good at this..."
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:3
+msgid "The dragon curve is a classical example of recursive method."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board10Wall.html:1
-msgid "Wall"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:5
+msgid "The definition of this curve is the following:"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board10Wall.html:3
-msgid "Ready to climb the wall?"
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:6
+msgid "the dragon curve of order 1 is a vector between to arbitrary points P and Q,"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board11Sea.html:1
-msgid "Sea"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:7
+msgid ""
+"the dragon curve of order n is the dragon curve of order n-1 between P and "
+"R, followed by the same curve of order n-1 between Q and R, where PRQ is an "
+"isosceles triangle with angle R being a right angle, and R being at the "
+"right of the PQ vector. Thus, if P and Q coordinates are (x, y) and (z, t), "
+"the coordinate (u, v) of R are given by:"
+msgstr ""
+
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:13 src/lessons/recursion/dragoncurve/DragonCurve2.html:26
+#, no-wrap
+msgid ""
+"u = (x + z)/2 + (t - y)/2\n"
+"v = (y + t)/2 - (z - x)/2\n"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board11Sea.html:3
-msgid "You now have to surf these waves of lamps."
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:17
+msgid "The prototype of the method drawing the curve is the following:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/lightbot/Board12Escher.html:1
-msgid "Escher Castle"
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:18 src/lessons/recursion/dragoncurve/DragonCurve2.html:22
+#, no-wrap
+msgid ""
+"[!java]void [/!]dragon([!java]int [/!]order[!scala]:Int[/!], [!java]double "
+"[/!]x[!scala]:Double[/!], [!java]double [/!]y[!scala]:Double[/!], "
+"[!java]double [/!]z[!scala]:Double[/!], [!java]double "
+"[/!]t[!scala]:Double[/!])"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/lightbot/Board12Escher.html:3
-msgid "This one aint easy."
+#: src/lessons/recursion/dragoncurve/DragonCurve1.html:21
+msgid ""
+"You should use the method <code>setPos(x,y)</code> to put your turtle at "
+"coordinates (x,y) and the method <code>moveTo(z,t)</code> to draw a line "
+"between the turtle position and the point(z,t)."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Close10.html:1
-msgid "Close to 10"
+#. type: Content of: <h2>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:1
+msgid "The dragon curve (2)"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Close10.html:2
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:3
msgid ""
-"Given 2 int values, return whichever value is nearest to the value 10, or "
-"return 0 in the event of a tie. [!java|scala]Note that Math.abs(n) returns "
-"the absolute value of a number.[/!] [!python]Note that math.fabs(n) returns "
-"the absolute value of a number. This function can only be used if you "
-"imported the math module.[/!]"
+"Previous solution induce that the turtle teleports to other location, or at "
+"the very least, that it moves its pen up during the drawing. Indeed, the end "
+"of the drawing of the first recursive call does not match the begining of "
+"the second recursive call. That is why we had to use the method "
+"<code>setPos()</code>"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Close10.html:7 src/lessons/welcome/bat/bool1/Diff21.html:5 src/lessons/welcome/bat/bool1/HasTeen.html:6 src/lessons/welcome/bat/bool1/IcyHot.html:5 src/lessons/welcome/bat/bool1/In1020.html:5 src/lessons/welcome/bat/bool1/In3050.html:5 src/lessons/welcome/bat/bool1/LastDigit.html:9 src/lessons/welcome/bat/bool1/LoneTeen.html:6 src/lessons/welcome/bat/bool1/Main.html:11 src/lessons/welcome/bat/bool1/Makes10.html:5 src/lessons/welcome/bat/bool1/Max1020.html [...]
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:9
msgid ""
-"This exercise was converted to PLM from the excellent exercising site "
-"http://javabat.com/"
+"In this lesson, you will write a recursive method allowing to draw the "
+"dragon curve without taking the pen up. For that, we need another recursive "
+"method drawing the mirror side of the curve."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/CountTeen.html:1
-msgid "Count Teen"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:13
+msgid ""
+"The method <code>dragon()</code> is then recursively defined using itself "
+"and <code>dragonReverse()</code>. Likewise, the method "
+"<code>dragonReverse()</code> is defined recursively using itself and "
+"<code>dragon()</code>. This is thus an example of <i>mutual recursion</i>."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/CountTeen.html:2
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:20
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 "
-"inclusive. Given 4 int values, return the amount of teen ones."
+"The prototype of the <code>dragon()</code> method remains unchanged from "
+"previous exercise:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Diff21.html:1
-msgid "Diff 21"
-msgstr ""
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/Diff21.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:24
msgid ""
-"Given an int n, return the absolute difference between n and 21, except "
-"return double the absolute difference if n is over 21."
+"The new point's coordinate (u, v) introduced by the <code>dragon()</code> "
+"are:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/HasTeen.html:1
-msgid "Has Teen"
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:30
+msgid "The prototype of the method <code>dragonReverse</code> is similar:"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/HasTeen.html:2
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:31
+#, no-wrap
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 "
-"inclusive. Given 3 int values, return true if 1 or more of them are teen."
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/IcyHot.html:1
-msgid "Icy Hot"
+"[!java]void [/!]dragonReverse([!java]int [/!]order[!scala]:Int[/!], "
+"[!java]double [/!]x[!scala]:Double[/!], [!java]double "
+"[/!]y[!scala]:Double[/!], [!java]double [/!]z[!scala]:Double[/!], "
+"[!java]double [/!]t[!scala]:Double[/!])"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/IcyHot.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:33
msgid ""
-"Given two temperatures, return true if one is less than 0 and the other is "
-"greater than 100."
+"The new point's coordinate (u, v) introduced by the "
+"<code>dragonReverse()</code> are:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/In1020.html:1
-msgid "In [10;20]"
+#. type: Content of: <pre>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:35
+#, no-wrap
+msgid ""
+"u = (x + z)/2 - (t - y)/2\n"
+"v = (y + t)/2 + (z - x)/2\n"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/In1020.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/dragoncurve/DragonCurve2.html:39
msgid ""
-"Given 2 int values, return true if either of them is in the range 10..20 "
-"inclusive."
+"To make the work of each method recursiv more visible, the line painted by "
+"the <code>dragon()</code> must be red (<code>Color.red</code>) while the "
+"line painted by the <code>dragonReverse()</code> must be blue "
+"(<code>Color.blue</code>)."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/In3050.html:1
-msgid "In [30;50]"
+#. type: Content of: <h3>
+#: src/lessons/recursion/hanoi/Main.html:1 src/lessons/recursion/hanoi/short_desc.html:1
+msgid "Hanoi towers"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/In3050.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/Main.html:2
msgid ""
-"Given 2 int values, return true if they are both in the range 30..40 "
-"inclusive, or they are both in the range 40..50 inclusive."
+"Here comes the super classical exercise on recursion. It's not very "
+"developed here, I'm not sure of what I could add to this lesson. If you have "
+"any idea, please submit them."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/LastDigit.html:1
-msgid "LastDigit"
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/short_desc.html:2
+msgid "Here comes the super classical exercise on recursion."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/LastDigit.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/short_desc.html:4
msgid ""
-"Given two non-negative int values, return true if they have the same last "
-"digit, such as with 27 and 57. Note that the % \"mod\" operator computes "
-"remainders, so 17 % 10 is 7."
+"This is an application exercise of recursion, that you should master to take "
+"this lesson."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/LoneTeen.html:1
-msgid "Lone Teen"
+#. type: Content of: <h2>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:1
+msgid "Tower of Hanoi"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/LoneTeen.html:2
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:3
msgid ""
-"We'll say that a number is \"teen\" if it is in the range 13..19 "
-"inclusive. Given 2 int values, return true if one or the other is teen, but "
-"not both."
+"The Tower of Hanoi or Towers of Hanoi, also called the Tower of Brahma or "
+"Towers of Brahma, is a mathematical game or puzzle. It consists of three "
+"pegs, and a number of disks of different sizes which can slide onto any "
+"peg. The puzzle starts with the disks in a neat stack in ascending order of "
+"size on one peg, the smallest at the top, thus forming a pyramid."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Main.html:1
-msgid "Boolean fun"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/recursion/hanoi/HanoiBoard.html:9
+msgid ""
+"The objective of the puzzle is to move the entire stack to another peg, "
+"obeying the following rules:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Main.html:3
-msgid ""
-"Boolean operations are one of the very basic task in programming. As long "
-"as you cannot write a not so simple boolean test under the minute, you "
-"probably will have a very bad time writing a real program."
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:11
+msgid "Only one disk may be moved at a time."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Main.html:8
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:13
msgid ""
-"That is why this lesson provides you a bunch of such exercises, so that you "
-"can get trained in this."
+"Each move consists of taking the upper disk from one of the pegs and sliding "
+"it onto another peg, on top of the other disks that may already be present "
+"on that peg."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Makes10.html:1
-msgid "Makes 10"
+#. type: Content of: <ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:17
+msgid "No disk may be placed on top of a smaller disk."
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/Makes10.html:2
+#: src/lessons/recursion/hanoi/HanoiBoard.html:22
msgid ""
-"Given 2 ints, a and b, return true if one if them is 10 or if their sum is "
-"10."
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/Max1020.html:1
-msgid "Max1020"
+"Write the core of the method: <code>[!java]void [/!]solve([!java]int "
+"[/!]src[!scala]:Int[/!], [!java]int [/!]dst[!scala]:Int[/!],[!java]int "
+"[/!]other[!scala]:Int[/!], [!java]int [/!]height[!scala]:Int[/!])</code>"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Max1020.html:2
+#: src/lessons/recursion/hanoi/HanoiBoard.html:25
msgid ""
-"Given 2 positive int values, return the larger value that is in the range "
-"10..20 inclusive, or return 0 if neither is in that range."
+"This method will recursively solve the presented problem. The first "
+"parameter named <code>src</code> is the index of the initial tower, the "
+"second parameter <code>dst</code> is the index of the expected final tower, "
+"the third parameter <code>other</code> is the index of the unused peg while "
+"the fourth parameter <code>height</code> is the height of the tower."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/Max1020.html:5
+#: src/lessons/recursion/hanoi/HanoiBoard.html:31
msgid ""
-"Note that Math.max(Int,Int):Int and Math.min(Int,Int):Int return the maximum "
-"and minimum of two integers"
+"A key to solving this puzzle is to recognize that it can be solved by "
+"breaking the problem down into a collection of smaller problems and further "
+"breaking those problems down into even smaller problems until a solution is "
+"reached."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:1
-msgid "MonkeyTrouble"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:35
+msgid "I don't get it, please give me some extra indications"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:3
-msgid ""
-"We have two monkeys, a and b, and the parameters aSmile and bSmile indicate "
-"if each is smiling. We are in trouble if they are both smiling or if "
-"neither of them is smiling. Return true if we are in trouble."
+#. type: Content of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:36
+msgid "Here is the pseudo-code of the solution:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/NearHundred.html:1
-msgid "Near Hundred"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:38
+msgid "label the pegs A, B, C (these labels may move at different steps)"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool1/NearHundred.html:2
-msgid ""
-"Given an int n, return true if it is within 10 of 100 or 200. "
-"[!java|scala]Note that Math.abs(n) returns the absolute value of a "
-"number.[/!] [!python]Note that math.fabs(n) returns the absolute value of a "
-"number. This function can only be used if you imported the math module.[/!]"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:39
+msgid "let n be the total number of discs (the height of the initial tower)"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/ParotTrouble.html:1
-msgid "Parot Trouble"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:40
+msgid "number the discs from 1 (smallest, topmost) to n (largest, bottommost)"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/ParotTrouble.html:3
-msgid ""
-"We have a loud talking parrot. The \"hour\" parameter is the current hour "
-"time in the range 0..23. We are in trouble if the parrot is talking and the "
-"hour is before 7 or after 20. Return true if we are in trouble."
+#. type: Content of: <div>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:43
+msgid "To move n discs from peg A to peg C:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/PosNeg.html:1
-msgid "Positive Negative"
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:45
+msgid "move n−1 discs from A to B. This leaves disc number n alone on peg A"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/PosNeg.html:2
-msgid ""
-"Given 2 int values, return true if one is negative and one is "
-"positive. Unless negative is true, then they both must be negative."
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:46
+msgid "move disc number n from A to C"
+msgstr ""
+
+#. type: Content of: <div><ul><li>
+#: src/lessons/recursion/hanoi/HanoiBoard.html:47
+msgid "move n−1 discs from B to C so they sit on disc number n"
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/SleepIn.html:1
-msgid "SleepDay"
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:1
+msgid "HanoiWorld"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/SleepIn.html:3
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:4
msgid ""
-"The parameter weekday is true if it is a weekday, and the parameter vacation "
-"is true if we are on vacation. We sleep in if it is not a weekday or we're "
-"on vacation. Return true if we sleep in."
+"This world implements the ultra-classical Hanoi problem. You are asked to "
+"move the disk pile from the stick where they are to the target stick (given "
+"as second parameter in the world's name -- number 1 for the default "
+"world). There is some extra constraint: you can only move one disk at a "
+"time, and you cannot move a big disk over a smaller one."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool1/SumDouble.html:1
-msgid "Sum Double"
+#. type: Content of: <p>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:11
+msgid "Only 4 functions are provided:"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool1/SumDouble.html:2
-msgid ""
-"Given two int values, return their sum. Unless the two values are the same, "
-"then return double their sum."
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/AlarmClock.html:1
-msgid "AlarmClock"
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:13
+#, no-wrap
+msgid "[!java]void [/!]move([!java]int [/!]src, [!java]int [/!]dst)"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/AlarmClock.html:2
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:15
msgid ""
-"Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a "
-"boolean indicating if we are on vacation, return a string of the form "
-"\"7:00\" indicating when the alarm clock should ring. Weekdays, the alarm "
-"should be \"7:00\" and on the weekend it should be \"10:00\". Unless we are "
-"on vacation -- then on weekdays it should be \"10:00\" and weekends it "
-"should be \"off\"."
+"Moves one disk from the stick <code>src</code> onto the stick "
+"<code>dst</code>. If you try to do an invalid move (like laying a disk over "
+"a smaller one), an IllegalArgumentException is thrown."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/AnswerCell.html:1
-msgid "AnswerCell"
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:19
+#, no-wrap
+msgid "[!java]int [/!]getSlotSize([!java]int [/!]slot)[!scala]:Int[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/AnswerCell.html:2
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:20
msgid ""
-"Your cell phone rings. Return true if you should answer it. Normally you "
-"answer, except in the morning you only answer if it is your mom calling. In "
-"all cases, if you are asleep, you do not answer."
+"Returns the amount of disks placed on the specified slot. This is mainly "
+"used to initialize the recursion and set the amount of recursive call to "
+"execute."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/BlueTicket.html:1
-msgid "BlueTicket"
+#. type: Content of: <pre>
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:23
+#, no-wrap
+msgid "[!java]int [/!]getRadius([!java]int [/!]slot)[!scala]:Int[/!]"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/BlueTicket.html:2
-msgid ""
-"You have a blue lottery ticket, with ints a, b, and c on it. This makes "
-"three pairs, which we'll call ab, bc, and ac. Consider the sum of the "
-"numbers in each pair. If any pair sums to exactly 10, the result is 10. "
-"Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the "
-"result is 5. Otherwise the result is 0."
+#: src/lessons/recursion/hanoi/universe/HanoiWorld.html:24
+msgid "Returns the radius of the top-most disk of the specified slot."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:1
-msgid "CaughtSpeeding"
+#. type: Content of: <h3>
+#: src/lessons/maze/Main.html:1 src/lessons/maze/short_desc.html:1
+msgid "Labyrinths"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:2
-msgid ""
-"You are driving a little too fast, and a police officer stops you. Write "
-"code to compute the result, encoded as an int value: 0=no ticket, 1=small "
-"ticket, 2=big ticket. If speed is 60 or less, the result is 0. If speed is "
-"between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the "
-"result is 2. Unless it is your birthday -- on that day, your speed can be 5 "
-"higher in all cases."
+#. type: Content of: <p>
+#: src/lessons/maze/Main.html:3 src/lessons/maze/short_desc.html:3
+msgid "This lesson proposes several exercises about labyrinths in the buggle world."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/CigarParty.html:1
-msgid "CigarParty"
+#. type: Content of: <h2>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:1
+msgid "The crazy mouse"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/CigarParty.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:3
msgid ""
-"When squirrels get together for a party, they like to have cigars. A "
-"squirrel party is successful when the number of cigars is between 40 and 60, "
-"inclusive. Unless it is the weekend, in which case there is no upper bound "
-"on the number of cigars. Return true if the party with the"
+"The day of your buggle starts badly. Out of luck, it got trapped into a "
+"maze. Help it finding its path out of there."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/DateFashion.html:1
-msgid "DateFashion"
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:8
+msgid ""
+"The exit is represented by a baggle and you need to pick this baggle in "
+"order to exit the maze."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/DateFashion.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:13
msgid ""
-"You and your date are trying to get a table at a restaurant. The parameter "
-"\"you\" is the stylishness of your clothes, in the range 0..10, and \"date\" "
-"is the stylishness of your date's clothes. The result getting the table is "
-"encoded as an int value with 0=no, 1=maybe, 2=yes. If either of you is very "
-"stylish, 8 or more, then the result is 2 (yes). With the exception that if "
-"either of you has style of 2 or less, then the result is 0 (no). Otherwise "
-"the result is 1 (maybe)."
+"Since the maze is so small, we can write the dumbest possible algorithm to "
+"do so. It relies on randomness and proves quite inefficient."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/GreenTicket.html:1
-msgid "GreenTicket"
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:18
+msgid ""
+"While the buggle didn't find the path to the escape, it must proceed the "
+"following way: pick a random integer between 0 and 2 by using the provided "
+"<code>random3()</code> method and make one of the following actions: moving "
+"forward if possible, turn left or turn right."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/GreenTicket.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/randommouse/RandomMouseMaze.html:24
msgid ""
-"You have a green lottery ticket, with ints a, b, and c on it. If the numbers "
-"are all different from each other, the result is 0. If all of the numbers "
-"are the same, the result is 20. If two of the numbers are the same, the "
-"result is 10."
+"You don't believe that it could work? Well, give it a try, you will see... "
+"Don't forget to pick up the baggle once you've reached it."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/In1To10.html:1
-msgid "In1To10"
+#. type: Content of: <h2>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:1
+msgid "Following the walls"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/In1To10.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:3
msgid ""
-"Given a number n, return true if n is in the range 1..10, inclusive. Unless "
-"\"outsideMode\" is true, in which case return true if the number is less or "
-"equal to 1, or greater or equal to 10."
+"This time, the maze is a bit more complicated. Random won't be enough, we "
+"ough to be smart!"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/InOrderEqual.html:1
-msgid "InOrderEqual"
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:6
+msgid ""
+"The good news is that this maze is simpler that it seems at the first "
+"glance: every wall are connected to each other. To get out of this kind of "
+"maze, the buggle only have to follow a wall (the one on its left or the one "
+"on its right, it doesn't matter). While keeping a paw on the wall, the "
+"buggle must move forward until it finds the maze exit and this biscuit it "
+"loves so much."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/InOrderEqual.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:13
msgid ""
-"Given three ints, a b c, return true if they are in strict increasing order, "
-"such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the "
-"exception that if \"equalOk\" is true, equality is allowed, such as 5 5 7 or "
-"5 5 5."
+"This works here because there is no island of isolated walls, so our buggle "
+"cannot loop around for ever without encountering its baggle."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/InOrder.html:1
-msgid "InOrder"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:17
+msgid ""
+"The goal of this exercise is to write an algorithm allowing the buggle to "
+"get out of this maze."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/InOrder.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:20
msgid ""
-"Given three ints, a b c, return true if b is greater than a, and c is "
-"greater than b. However, with the exception that if \"bOk\" is true, b does "
-"not need to be greater than a."
+"As said earlier, it does not matter whether you decide to follow the left "
+"wall or the right one. Simply, the demo follows the left one, so you should "
+"do the same in your solution to ease the comparison of your solution and the "
+"demo."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/LastDigit2.html:1
-msgid "LastDigit 2"
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:25
+msgid ""
+"Write a method <code>keepHandOnSideWall()</code> which lets the buggle move "
+"one step forward while keeping the paw on the wall of the selected side. You "
+"must ensure that the buggle always keep the paw on the wall, but also that "
+"it won't crash into a wall. You can check the tip for more info on this, but "
+"only do so if you're stuck. Try to do it without the tip first."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/LastDigit2.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:32
msgid ""
-"Given three ints, a b c, return true if two or more of them have the same "
-"rightmost digit. The ints are non-negative. Note: the % \"mod\" operator "
-"computes the remainder, e.g. 17 % 10 is 7."
+"Then, write the whole algorithm to traverse the maze step by step (using "
+"<code>keepHandOnSideWall()</code>) until it finds the biscuit and the "
+"exit. Don't forget to pick the baggle up once you've found it."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/LessBy10.html:1
-msgid "LessBy10"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:37
+msgid "I'm lost, please give me some extra indications"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/LessBy10.html:2
+#. type: Content of: <div><p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:38
msgid ""
-"Given three ints, a b c, return true if one of them is 10 or more less than "
-"one of the others."
+"When your buggle has a wall on the left, there is three situations to "
+"consider, depending on the surrounding walls. The following table depicts "
+"each initial situation, and where you should let your buggle end after one "
+"step."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/Main.html:1
-msgid "Boolean (even more) fun"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:45
+msgid "Case 1"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/bat/bool2/Main.html:3
-msgid ""
-"A very good introduction to this type is available here: "
-"http://javabat.com/doc/ifboolean.html."
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:46
+msgid "Case 2"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/MaxMod5.html:1
-msgid "MaxMod5"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:47
+msgid "Case 3"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/MaxMod5.html:2
-msgid ""
-"Given two int values, return whichever value is larger. However if the two "
-"values have the same remainder when divided by 5, then the return the "
-"smaller value. However, in all cases, if the two values are the same, return "
-"0. Note: the % \"mod\" operator computes the remainder, e.g. 7 % 5 is 2."
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:49
+msgid "Initial situation"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/NearTen.html:1
-msgid "NearTen"
+#. type: Content of: <div><table><tr><td>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:54
+msgid "Where is the next step"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/NearTen.html:2
+#. type: Content of: <div><p>
+#: src/lessons/maze/wallfollower/WallFollowerMaze.html:60
msgid ""
-"Given a non-negative number \"num\", return true if num is within 2 of a "
-"multiple of 10. Note: (a % b) is the remainder of dividing a by b, so (7 % "
-"5) is 2."
+"If you do a <code>right()</code> in any case at the end of your function, "
+"it's possible to write it in 3 lines with a <code>while</code> loop."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/RedTicket.html:1
-msgid "RedTicket"
+#. type: Content of: <h2>
+#: src/lessons/maze/pledge/PledgeMaze.html:1
+msgid "Pledge algorithm"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/RedTicket.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:3
msgid ""
-"You have a red lottery ticket showing ints a, b, and c, each of which is 0, "
-"1, or 2. If they are all the value 2, the result is 10. Otherwise if they "
-"are all the same, the result is 5. Otherwise so long as both b and c are "
-"different from a, the result is 1. Otherwise the result is 0."
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/ShareDigit.html:1
-msgid "ShareDigit"
+"Once again, you thought that your algorithm were good enough to escape the "
+"maze, and once again, you buggle is now in a maze where your previous "
+"algorithm fails. Just give it a try: copy/paste your code and hit the "
+"\"Run\" button and see your creation fail. The trap is shaped like an upper "
+"case \"G\". The buggle enters the trap and follows the inner border. At some "
+"point, it finds the north direction free, run into that direction, and falls "
+"again in the trap."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/ShareDigit.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:13
msgid ""
-"Given two ints, each in the range 10..99, return true if there is a digit "
-"that appears in both numbers, such as the 2 in 12 and 23. (Note: division, "
-"e.g. n/10, gives the left digit while the % \"mod\" n%10 gives the right "
-"digit.)"
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/SortaSum.html:1
-msgid "SortaSum"
+"The Pledge's algorithm (named after Jon Pledge of Exeter) can solve this "
+"maze."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/SortaSum.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:16
msgid ""
-"Given 2 ints, a and b, return their sum. However, sums in the range 10..19 "
-"inclusive, are forbidden, so in that case just return 20."
+"This algorithm is a modification of the previous one thought to avoid "
+"obstacles. It randomly picks a heading and let the buggle move in that "
+"direction. When it encounters an obstacle, a paw (for example the left one) "
+"is kept on the wall following the obstacle while counting the turns. When "
+"the buggle is back to its original heading and when the sum of the turns is "
+"0, the buggle leaves the obstacle and continues keeping its original "
+"heading."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:1
-msgid "SquirrelPlay"
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:24
+msgid ""
+"Note that the use of \"total turning\" rather than just the \"current "
+"direction\" allows the algorithm to avoid G-shapped traps. If one proceeds "
+"left into the trap, one gets turned around a full 360 degrees by the "
+"walls. As we said before, the naive \"current direction\" algorithm gets "
+"into a limit cycle as it leaves the lower rightmost wall heading left and "
+"runs into the curved section on the left again."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:31
msgid ""
-"The squirrels in Palo Alto spend most of the day playing. In particular, "
-"they play if the temperature is between 60 and 90 (inclusive). Unless it is "
-"summer, then the upper limit is 100 instead of 90. Given an int temperature "
-"and a boolean isSummer, return true if the squirrels play and false "
-"otherwise."
+"The Pledge's algorithm does not leave the rightmost wall due to the total "
+"turning not being zero at that point. It follows the wall all the way "
+"around, finally leaving it heading left on the bottom outside"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TeaParty.html:1
-msgid "TeaParty"
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:38
+msgid ""
+"<a name=\"Objective\"/>You now have to modify your solution to implement the "
+"Pledge algorithm to escape this maze."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TeaParty.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:41
msgid ""
-"We are having a party with amounts of tea and candy. Return the int outcome "
-"of the party encoded as 0=bad, 1=good, or 2=great. A party is good (1) if "
-"both tea and candy are at least 5. However, if either tea or candy is at "
-"least double the amount of the other one, the party is great (2). However, "
-"in all cases, if either tea or candy is less than 5, the party is always bad "
-"(0)."
+"Change your <code>keepHandOnSideWall()</code> method to count the amount of "
+"turns done by the buggle (+1 when it turns left, and -1 when it turns "
+"right). This counting may require the addition of an <code>angleSum</code> "
+"integer value in your program."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TeenSum.html:1
-msgid "TeenSum"
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:46
+msgid ""
+"Write a boolean method <code>isDirectionFree(dir)</code> indicating if the "
+"provided direction is free, ie, if you can move in that direction (Note that "
+"the demo uses the NORTH direction for that). You can retrieve the current "
+"direction of the buggle using the method <code>getDirection()</code>. You "
+"can change your direction (without moving) using "
+"<code>setDirection(dir)</code>. Don't forget to store the previous direction "
+"of your buggle (in a dedicated variable) before checking if your favorite "
+"direction is free in order to restore your state afterward."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TeenSum.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:55
msgid ""
-"Given 2 ints, a and b, return their sum. However, \"teen\" values in the "
-"range 13..19 inclusive, are extra lucky. So if either value is a teen, just "
-"return 19."
+"You may have to change the rest of your code also, but these changes should "
+"remain limited."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/TwoAsOne.html:1
-msgid "TwoAsOne"
+#. type: Content of: <p>
+#: src/lessons/maze/pledge/PledgeMaze.html:58
+msgid ""
+"Don't forget that if you have a method modifying a global variable (such as "
+"angleSum), you should ensure that it declares this variable as "
+"global. Without it, the method creates a new variable of the same name, and "
+"the global never gets modified."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/TwoAsOne.html:2
+#. type: Content of: <div><pre>
+#: src/lessons/maze/pledge/PledgeMaze.html:62
+#, no-wrap
msgid ""
-"Given three ints, a b c, return true if it is possible to add two of the "
-"ints to get the third."
+"def myMethod():\n"
+" global angleSum\n"
+" ...\n"
+" angleSum = angleSum + 1\n"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:1
-msgid "WithoutDoubles"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/pledge/PledgeMaze.html:68
+msgid "Show an additional tip"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:2
+#. type: Content of: <div>
+#: src/lessons/maze/pledge/PledgeMaze.html:69
msgid ""
-"Return the sum of two 6-sided dice rolls, each in the range 1..6. However, "
-"if noDoubles is true, if the two dice show the same value, increment one die "
-"to the next value, wrapping around to 1 if its value was 6."
+"You should set your direction to your favorite one (NORTH is advised). Then, "
+"you should write the algorithm main loop. In other words, while your buggle "
+"did not find its biscuit, you have to move forward until next obstacle in "
+"the favorite direction. Then, put a paw on a wall (using "
+"(<code>keepHandOnSideWall()</code>) while the sum of turns is not null and "
+"the favorite direction is not free. Do that until you find your baggle."
msgstr ""
-#. type: Content of: <h1>
-#: src/plm/universe/bat/BatWorld.html:1
-msgid "BatWorld"
+#. type: Content of: <h2>
+#: src/lessons/maze/island/IslandMaze.html:1
+msgid "Lost between islands"
msgstr ""
#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:3
+#: src/lessons/maze/island/IslandMaze.html:3
msgid ""
-"This world is a simplistic testing environment largely inspired from the "
-"http://codingbat.com invented by Nick Parlente."
+"You thought that your algorithm was enough to escape mazes? Well, not every "
+"mazes..."
msgstr ""
#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:6
+#: src/lessons/maze/island/IslandMaze.html:7
msgid ""
-"The typical exercises are very short ones, aiming at improving the tactical "
-"programming abilities of the students. That is to say that you will be "
-"presented a quite long list of very little exercises about rather simple "
-"things. The idea is to train you on these issues until they become automatic "
-"to you."
+"The <i>wall follower algorithm</i> we used so far only works if the entry "
+"and the exit are placed near to walls connected to the external wall. But if "
+"the buggle begins in the middle of the maze, it may exist wall sections "
+"disconnected from the external wall."
msgstr ""
-#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:12
+#. type: Content of: <p><p>
+#: src/lessons/maze/island/IslandMaze.html:12
msgid ""
-"In contrary to the other worlds, the BatWorld does not provide any fancy "
-"abstraction nor visualization. You have to fill a function, which gets "
-"called for a bunch of parameter sets, and that's it."
+"That is why the previous strategy would let the buggle round around for "
+"ever. Indeed, the maze you should now escape from contains islands, and the "
+"buggle does not start along one of the external walls. Just give it a try if "
+"you want: copy your code over, push the run button and see your previous "
+"solution failing miserabily."
msgstr ""
-#. type: Content of: <p>
-#: src/plm/universe/bat/BatWorld.html:16
+#. type: Content of: <p><p>
+#: src/lessons/maze/island/IslandMaze.html:18
msgid ""
-"For more information, you should refer to the CodingBat.com documentation, "
-"which contains for example a very useful documentation on boolean operators: "
-"http://codingbat.com/doc/ifboolean.html"
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/Main.html:1
-msgid "String fun"
+"The method of following a wall is still good and allow to escape very "
+"efficiently some sections of the maze, so we do not want to remove it "
+"entierely. Instead, we want to stop following the wall under some "
+"conditions. Notice that the baggle lays near to the external border of the "
+"maze. So, we want to reach the border and then follow that wall. We need for "
+"example to search for the north wall before following it to the baggle."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/bat/string1/Main.html:3
+#. type: Content of: <p><p><p>
+#: src/lessons/maze/island/IslandMaze.html:26
msgid ""
-"Strings are the simplest of the complex data types :) They provide several "
-"operations, such as getting the length of the string, or a substring of it.."
+"To find the north wall, you simply run to the north as long as it's "
+"possible, and when facing an obstacle, you avoid it (using previous method)."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/bat/string1/Main.html:7
-msgid ""
-"A very good introduction to this type is available here: "
-"http://javabat.com/doc/string.html."
+#. type: Attribute 'alt' of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:30
+msgid "I'm lost now, please give me some extra indications"
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/bat/string1/short_desc.html:1
-msgid "Small exercises about strings"
+#. type: Content of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:31
+msgid ""
+"Our new run() method will consist in two modes: our buggle will alternate "
+"between the \"north runner mode\" and the \"left follower mode\". You begin "
+"in \"north runner mode\", and switch to \"left follower\" when you have a "
+"wall at the north (do not forget to make sure you have a wall at your left "
+"before switching to \"left follower\" mode). You switch to \"north runner\" "
+"as soon as your buggle is facing north and is not in front of a wall during "
+"its trip around its left wall. The easiest way to write such a state machine "
+"is something like"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/bat/string1/short_desc.html:3
+#. type: Content of: <p><p><div><pre>
+#: src/lessons/maze/island/IslandMaze.html:39
+#, no-wrap
msgid ""
-"These are some training exercises around strings. But unfortunately, its "
-"integration within PLM is still ongoing."
+"[!scala]var state=0;\n"
+"state match {\n"
+" case 0 => // North runner\n"
+" ...\n"
+" state = 1;\n"
+" case 1 => // Left follower\n"
+" ...\n"
+" state = 0;\n"
+" case _ => println(\"This case should not happen. Please fix me\")\n"
+"}[/!][!java]int state=0;\n"
+"switch (state) {\n"
+" case 0: // North runner\n"
+" ...\n"
+" state = 1;\n"
+" break;\n"
+" case 1: // Left follower\n"
+" ...\n"
+" state = 0;\n"
+" break;\n"
+"}[/!][!python]northRunner = True\n"
+"if northRunner:\n"
+" ...\n"
+" northRunner = False\n"
+"else: # left follower\n"
+" ...\n"
+" northRunner = True[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/bat/string1/short_desc.html:6
-msgid "Please be patient with us."
+#. type: Content of: <p><p><div>
+#: src/lessons/maze/island/IslandMaze.html:66
+msgid ""
+"Don't forget the default case (matching _), or scala will issue an error "
+"since your matching would be incomplete.[/!]"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/AltPairs.html:1
-msgid "AltPairs"
+#. type: Content of: <p><p><p>
+#: src/lessons/maze/island/IslandMaze.html:69
+msgid "Don't forget to let the buggle pick the baggle at the end of your code."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/AltPairs.html:2
+#. type: Content of: <p><p><p>
+#: src/lessons/maze/island/IslandMaze.html:72
msgid ""
-"Given a string, return a string made of the chars at indexes 0,1, 4,5, 8,9 "
-"... so \"kittens\" yields \"kien\"."
+"You're up. That should be enough for you to figure out how to escape this "
+"maze, but if not, you can always request for the tip. But you do not need "
+"any more help, do you?"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/FrontTimes.html:1
-msgid "FrontTimes"
+#. type: Content of: <h2>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:1
+msgid "Basic Shortest Path algorithm"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/FrontTimes.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:3
msgid ""
-"Given a string and a non-negative int n, we'll say that the front of the "
-"string is the first 3 chars, or whatever is there if the string is less than "
-"length 3. Return n copies of the front;"
-msgstr ""
-
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/Last2.html:1
-msgid "Last2"
+"To conclude with this introductory lesson to maze solving algorithms, we "
+"will investigate another way to find the exit. The buggle in this lesson is "
+"a special buggle: he is a jedi. He can feel the Force. This means he is able "
+"to feel his environment."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/bat/string1/Last2.html:3
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:7
msgid ""
-"Given a string, return the amount of times that the two last letters appear "
-"as a substring of the string. So \"hixxxhi\" yields 1 (we won't count the "
-"end substring) while \"aaaNaa\" yields 2 (substrings may overlap)."
+"Without even leaving his position, he can retrieve information about the "
+"world he is leaving in, with the following functions:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringBits.html:1
-msgid "StringBits"
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:9
+msgid "<code>getWorldWidth()</code> gives the width of its world."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringBits.html:2
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:10
+msgid "<code>getWorldHeight()</code> gives the height of its world."
+msgstr ""
+
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:11
msgid ""
-"Given a string, return a new string made of every other char starting with "
-"the first, so \"Hello\" yields \"Hlo\"."
+"<code>hasTopWall(x,y)</code> tells whether the cell (x,y) of this world has "
+"a wall on top."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringMatch.html:1
-msgid "StringMatch"
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:12
+msgid ""
+"<code>hasLeftWall(x,y)</code> tells whether the cell (x,y) of this world has "
+"a wall on the left."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringMatch.html:2
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:13
msgid ""
-"Given 2 strings, a and b, return the number of the positions where they "
-"contain the same length 2 substring. So \"xxcaazz\" and \"xxbaaz\" yields 3, "
-"since the \"xx\", \"aa\", and \"az\" substrings appear in the same place in "
-"both strings."
+"<code>hasBaggle(x,y)</code> tells whether the cell (x,y) of this world has a "
+"baggle."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringSplosion.html:1
-msgid "StringSplosion"
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:14
+msgid ""
+"<code>setIndication(x,y,i)</code> adds the integer indication <code>i</code> "
+"to the cell (x,y)."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringSplosion.html:2
-msgid "Given a non-empty string like \"Code\" return a string like \"CCoCodCode\"."
+#. type: Content of: <ul><li>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:15
+msgid ""
+"<code>getIndication(x,y,i)</code> retrieves the integer indication of the "
+"cell (x,y) (or 9999 if there is no indication)."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringTimes.html:1
-msgid "StringTimes"
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:18
+msgid ""
+"It has to be noted that it is not possible to build a wall on the bottom "
+"edge or on the right edge of a cell. Therefore when such wall exists, it "
+"means it was built on a sibling cells -- as a top (respectively left) wall "
+"on the cell that is located below (respectively at the right of) the current "
+"cell."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringTimes.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:24
msgid ""
-"Given a string and a non-negative int n, return a larger string that is n "
-"copies of the original string."
+"Your buggle should first write the distance to the exit on each cell (or at "
+"least the useful ones)."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringX.html:1
-msgid "StringX"
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:25
+msgid ""
+"For that, find the exit and write 0 there. Then, write 1 on every "
+"neighboring cells that is not separated from the exit with a wall. And then "
+"mark every cells from which you can reach the exit in 2 steps, and iterate "
+"for all cells until you mark the cell where the buggle is located."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringX.html:2
+#. type: Content of: <p>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:30
msgid ""
-"Given a string, return a version where all the \"x\" have been "
-"removed. Except an \"x\" at the very start or end should not be removed."
+"Once the cells are marked, get your jedi buggle to follow the shortest "
+"path. Basically the buggle has only to walk on each case with the lesser "
+"distance from the exit. You can use the method "
+"<code>setDirection(direction)</code> to make your buggle look at the "
+"specific direction such as <code>Direction.NORTH</code> or "
+"<code>Direction.EAST</code>."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/bat/string1/StringYak.html:1
-msgid "StringYak"
+#. type: Attribute 'alt' of: <div>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:35
+msgid "I'm lost now. Please give me some extra indications."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/bat/string1/StringYak.html:2
-msgid ""
-"Suppose the string \"yak\" is unlucky. Given a string, return a version "
-"where all the \"yak\" are removed, but the \"a\" can be any char. The "
-"\"yak\" strings will not overlap."
+#. type: Content of: <div>
+#: src/lessons/maze/shortestpath/ShortestPathMaze.html:36
+msgid "Use the Force, Luke!"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/welcome/array/basics/Array1.html:1
-msgid "[!java|scala]Arrays[/!][!python]Lists[/!] and Knotting"
+#. type: Content of: <h2>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:1
+msgid "Finding the walls to follow"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/basics/Array1.html:3
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:3
msgid ""
-"The goal of this exercise is to reproduce the pattern of the first row in "
-"the other rows with a shift of one cell (see the Objective tab for "
-"details). The biggest difference between this exercise and the others we had "
-"on patterns is that you have to read the pattern (on first row) before "
-"reproducing it. You cannot do otherwise because the same code will be "
-"executed on three different worlds, each of them having a specific pattern."
+"This is exactly the same maze than before, but the buggle does not start at "
+"the same location. In particular, it does not have any wall to its left at "
+"the beginning."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:11
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:7
msgid ""
-"One solution is to read the next cell, and go copy it in position before "
-"coming back to read the second cell. But since it is forbidden to use the "
-"methods to teleport the buggle to a specific position (<code>setPos()</code> "
-"and similar), this approach will be a pain to implement."
+"As a result, the method you wrote for the previous exercise probably don't "
+"work for this one. If you use it here with no modification, your buggle "
+"probably start looping over the four free cells around its start position "
+"(if that's not the case, well, you didn't really stick to the mission on "
+"previous exercise. Feel lucky and proceed to the next :)"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:16
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:14
msgid ""
-"The simplest is to store the sequence of colors that constitute the whole "
-"pattern in an [!java|scala]<b>array</b>[/!][!python]<b>list</b>[/!]. But "
-"before we can do so, we should learn a bit what "
-"[!java|scala]arrays[/!][!python]lists[/!] are."
+"This is because your <code>keepHandOnSideWall()</code> method has an "
+"implicit <b>pre-condition</b>: it works well if and only if the buggle has a "
+"wall to its left when you call it. Such pre-condition are very heavily used "
+"when programming. Specifying them explicitly helps understanding the code "
+"written by other, and they even allow sometimes to prove that the code works "
+"correctly."
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/welcome/array/basics/Array1.html:20
-msgid "[!java|scala]Arrays[/!][!python]List[/!]"
+#. type: Content of: <p>
+#: src/lessons/maze/wallfindfollow/WallFindFollowMaze.html:24
+msgid ""
+"Fixing the problem should be very easy. Simply make sure that the "
+"pre-condition of <code>keepHandOnSideWall()</code> is verified before "
+"calling it. For that, update your code to first look for a wall on its left "
+"before the big <code>while</code> loop."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array1.html:22
+#. type: Content of: <h3>
+#: src/plm/universe/lightbot/LightBotWorld.html:1 src/lessons/lightbot/Main.html:1 src/lessons/lightbot/short_desc.html:1
+msgid "LightBot"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/plm/universe/lightbot/LightBotWorld.html:3
msgid ""
-"[!java|scala]An array[/!][!python]A list[/!] is an ordered sequence of "
-"variables that go together. It is somehow similar to a shelve where each "
-"level can store a separate value. Each variable of the sequence is "
-"identified by its position, and can store a specific value. [!java|scala]All "
-"cells of the array must store values of the same type because arrays are "
-"homogeneous in [!thelang]. It is possible to trick this restriction by using "
-"the datatype <code>[!java]Object[/!][!scala]Any[/!]</code> that can contain "
-"[!java]almost[/!] any other datatype. [!java]Primitive types such as the "
-"ones we saw so far (int, boolean, double, char, etc) cannot be stored in an "
-"Object variable, but their objectified counter-part (Integer, Boolean, "
-"Double, Char, Boolean, etc) can.[/!] It is however a good practice to make "
-"the type of an array as specific as possible, i.e., if you plan to store "
-"some integers in your array, make it an array of integers, not of "
-"[!java]Object[/!][!scala]Any[/!].[/!] [!python]Lists can even mix values of "
-"differing types, such as integer values in some cells and colors in other "
-"cells.[/!]"
+"This universe introduces a little programming puzzle which can somehow be "
+"used to introduce programmation to non-reading kids since it is programmed "
+"graphically. The goal of each board is to light up all the lights. Your "
+"robot understands the following orders:"
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:38
-msgid ""
-"T is the [!java|scala]array[/!][!python]list[/!]'s name, "
-"[!java|python]T[0][/!][!scala]T(0)[/!] is the name of the first cell, "
-"[!java|python]T[1][/!][!scala]T(1)[/!] the name of the second cell, "
-"[!java|python]T[2][/!][!scala]T(2)[/!] the third one, etc. And yes, the "
-"first cell is numbered [!java|python]T[0][/!][!scala]T(0)[/!] while the last "
-"one of [!java|scala]an array[/!][!python]a list[/!] of size N is "
-"[!java|python]T[N-1][/!][!scala]T(N-1)[/!]. It may seem funny to count "
-"starting from 0 and not from 1 as usual, but some historical reasons make it "
-"unavoidable here."
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:7
+msgid "<b>Order</b>"
msgstr ""
-#. type: Content of: <p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:46
-msgid "Basic usage"
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:7
+msgid "<b>Meaning</b>"
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:48
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:8
+msgid "<b>Move forward</b>"
+msgstr ""
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:8
+msgid "Cannot be done if the destination cell is of another height than source cell"
+msgstr ""
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:9
+msgid "<b>Jump forward</b>"
+msgstr ""
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:9
msgid ""
-"We can use an integer variable <i>i</i> to access with "
-"[!java|python]T[i][/!][!scala]T(i)[/!] to the cells: when the value of "
-"<i>i</i> is 0, then [!java|python]T[i][/!][!scala]T(i)[/!] accesses "
-"[!java|python]T[0][/!][!scala]T(0)[/!]; when the value of <i>i</i> is 10, "
-"then [!java|python]T[i][/!][!scala]T(i)[/!] accesses "
-"[!java|python]T[10][/!][!scala]T(10)[/!]. <i>i</i> is said to be the "
-"<b>index</b> in T. <code>[!java|python]T[i][/!][!scala]T(i)[/!]</code> can "
-"be used just like any variable. We can set a new value:"
+"Can only be done if the destination cell is one step higher than source "
+"cell, or if destination is lower than source. Cannot be used for plain "
+"moves."
msgstr ""
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:56
-#, no-wrap
-msgid "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:10
+msgid "<b>Turn left</b>."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:58
-msgid "We can retrieve and use its value:"
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:11
+msgid "<b>Turn right</b>."
msgstr ""
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:59
-#, no-wrap
-msgid "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:12
+msgid "<b>Switch the light</b>."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:61
-msgid "We can test this value:"
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:12
+msgid ""
+"Turn it on if it was off, and off if it was on. No effect if the cell does "
+"not contain any light."
msgstr ""
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:62
-#, no-wrap
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:13
+msgid "<b>Call function 1</b>."
+msgstr ""
+
+#. type: Content of: <table><tr><td>
+#: src/plm/universe/lightbot/LightBotWorld.html:14
+msgid "<b>Call function 2</b>."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/plm/universe/lightbot/LightBotWorld.html:17
msgid ""
-"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) "
-"[!scala|java]{[/!][!python]:[/!]\n"
-" [!java|scala]//[/!][!python]#[/!] instructions...\n"
-"[!java|scala]}[/!]"
+"Please note that this world is not completely suited to small kids since the "
+"main difficulty comes from the fact that your are highly limited in the "
+"amount of instructions you can give to your robot. Advanced levels thus "
+"require to write sound functions, and are often above the capacities of "
+"small kids."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:66
+#. type: Content of: <p>
+#: src/plm/universe/lightbot/LightBotWorld.html:19
msgid ""
-"It is very easy to traverse the whole "
-"[!scala|java]array[/!][!python]list[/!], for example to initialize each "
-"cells."
+"This game is heavily inspirated from a flash game of the same name, which "
+"can for example be played on kongregate.com. It was written by Danny "
+"Yaroslavski (Coolio-Niato), the original idea being of Matt Chase."
msgstr ""
-#. type: Content of: <p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:69
-#, no-wrap
+#. type: Content of: outside any tag (error?)
+#: src/lessons/lightbot/Main.html:2
msgid ""
-"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in "
-"range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
-" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"This lesson introduces a little programming puzzle inspired from a flash "
+"game."
msgstr ""
-#. type: Content of: <p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:73
+#. type: Content of: <p>
+#: src/lessons/lightbot/Main.html:4
+msgid "See the <i>About this world</i> dialog for more details."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/short_desc.html:3
msgid ""
-"[!java|scala]The notation <code>T.length</code> retrieves the length of the "
-"array T,[/!] [!python]The function <code>len()</code> retrieves the length "
-"of the list T,[/!] allowing to build a classical for loop easily. "
-"[!python]Actually, the <code>len()</code> function is much more generic and "
-"can be used to retrieve the length of many objects. Applied to strings for "
-"example, it returns the amount of chars in this string.[/!] [!scala]Don't "
-"forget to start at <code>0</code> and stop at <code>T.length-1</code> "
-"instead of <code>1 to T.length</code> however.[/!]"
+"This lesson constitutes a little brain teaser for programmers. You have to "
+"instruct your robot to turn off all lights. The trick is that you program "
+"your robot graphically, and that you are limited in the amount of "
+"instructions."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:81
+#. type: Content of: <p>
+#: src/lessons/lightbot/short_desc.html:8
+msgid "No previous experience is expected to take this lesson."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board01TwoSteps.html:1
+msgid "Welcome"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board01TwoSteps.html:3
msgid ""
-"If you just want to iterate over the values of T without keeping track of "
-"their index, you can simply write:"
+"Welcome to the lightbot world. This is merely a programmer puzzle rather "
+"than a real lesson (although some use it to teach programming). The robot "
+"is not programmed in Java, but rather graphically. You can see the existing "
+"orders in the documentation using the <i>About this world</i> menu."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:82
-#, no-wrap
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:6
msgid ""
-"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in "
-"T:[/!]\n"
-" action()[!java];[/!]\n"
-"[!java|scala]}[/!]"
+"The goal of each board is simply to switch on every lights of the board "
+"using your little robot."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:85
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:8
msgid ""
-"[!java]This construct is called an <i>extended loop</i> in Java. The "
-"variable <i>i</i> takes all values of the set located to the right of the "
-"colon (:), one after the other.[/!] [!python|scala]This is actually very "
-"similar to the previous construct. Simply, "
-"<code>[!python]range(n)[/!][!scala]i to j[/!]</code> returns a set of "
-"integers over which the for construct iterates. Actually, [!thelang] offers "
-"much more elegant ways to traverse [!python]lists[/!][!scala]arrays[/!] and "
-"other data collections, but this should be the topic of a specific set of "
-"exercises (that are still to be written in PLM).[/!]"
+"This is a introduction exercise, which should be solvable by only moving "
+"forward and switching the light, using respectively"
msgstr ""
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:96
-msgid "Declaring [!python]a list[/!][!java|scala]an array[/!]"
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board01TwoSteps.html:10 src/lessons/lightbot/Board02Turn.html:4 src/lessons/lightbot/Board06Func.html:3
+msgid "and"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:99
-msgid ""
-"If you know beforehand the content of your list, you can affect these values "
-"all together. Just put them between square braces and separated by commas "
-"as follows:"
+#. type: Content of: <p><</p><p>
+#: src/lessons/lightbot/Board01TwoSteps.html:10
+msgid "."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:102
-#, no-wrap
-msgid ""
-"L = [1, 3, 5, 7, 9] \n"
-"<span class=\"comment\"># L is now an array of 5 values, all of them being "
-"integers</span>"
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board02Turn.html:1
+msgid "Turn around"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:104
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board02Turn.html:3
+msgid "Now, you probably need to turn in addition (using"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board02Turn.html:4
+msgid ")."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board03Jump.html:1
+msgid "Jump"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board03Jump.html:3
+msgid "You can also jump using"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board03Jump.html:3
msgid ""
-"Otherwise, you probably want to create an empty list and then append each "
-"values separately to the list:"
+"to pass obstacles. You can either jump one level up or any amount of levels "
+"down, but you cannot jump to go on a cell of the same height."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:106
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board04Stairs.html:1
+msgid "Stairs"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board04Stairs.html:3
+msgid "Can you pass these stairs?"
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board05Higher.html:1
+msgid "Higher"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board05Higher.html:3
+msgid "Let's go higher"
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board06Func.html:1
+msgid "Functions"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board06Func.html:3
+msgid "You can use"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board06Func.html:3
msgid ""
-"L2 = [] \n"
-"<span class=\"comment\"># L2 is now an empty list</span>\n"
-"L2.append(1)\n"
-"L2.append(3)\n"
-"L2.append(5)\n"
-"L2.append(7)\n"
-"L2.append(9) \n"
-"<span class=\"comment\"># Its content is now the same as L previously</span>"
+"to call respectively the first and second functions. Define their code in "
+"their own tab."
+msgstr ""
+
+#. type: Content of: <p><p>
+#: src/lessons/lightbot/Board06Func.html:5
+msgid "This is great if you get out of space in your main function"
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board07Repeat.html:1
+msgid "Repetitive tasks"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board07Repeat.html:3
+msgid "Functions are also of great use for repetitive tasks"
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board08Rec.html:1
+msgid "Calling functions from functions"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board08Rec.html:3
+msgid "It is perfectly okay to call a function from within a function!"
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board09Castle.html:1
+msgid "Castle"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:117
-msgid ""
-"To declare a variable named <b>T</b> that can store arrays of integers, one "
-"should write:"
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board09Castle.html:3
+msgid "You're getting good at this..."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:118
-#, no-wrap
-msgid "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board10Wall.html:1
+msgid "Wall"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:120
-msgid ""
-"[!java]<code>int</code> means that the elements of the array are of type "
-"integer; <code>[]</code> means that we are speaking of an array and "
-"<code>T</code> is the name of the variable. For historical reasons, this "
-"can also be written as <code>int T[]</code> (with the [] after the variable "
-"name), but this is less readable and should probably be avoided.[/!] "
-"[!scala]The <code>[Int]</code> notation specializes the Array type (that is "
-"generic), specifying that each cell of this array is an integer. An array of "
-"booleans would simply by written <code>Array[Boolean]</code>.[/!]"
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board10Wall.html:3
+msgid "Ready to climb the wall?"
msgstr ""
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:128
-msgid "Allocating an array"
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board11Sea.html:1
+msgid "Sea"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:130
-msgid ""
-"Declaring a variable <code>T</code> that stores an array only reserve the "
-"<b>name</b> <code>T</code> for later use, but not the memory area to store "
-"the cells. The array is not initialized yet: it does not have any "
-"value. What would <code>[!java]T[4][/!][!scala]T(4)[/!]</code> mean if we "
-"didn't say that the array is 5 cells long?"
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board11Sea.html:3
+msgid "You now have to surf these waves of lamps."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:135
-msgid "First and foremost, we have to give a value to <code>T</code>:"
+#. type: Content of: <h1>
+#: src/lessons/lightbot/Board12Escher.html:1
+msgid "Escher Castle"
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:136
-#, no-wrap
-msgid "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
+#. type: Content of: <p>
+#: src/lessons/lightbot/Board12Escher.html:3
+msgid "This one aint easy."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:138
-msgid ""
-"<code>new</code> means that we want to create something, and "
-"<code>[!java]int[10][/!][!scala]Array[Int](10)[/!]</code> means that it is "
-"an array of 10 integer values. In return, an array of 10 integer cells is "
-"created in memory, and the <code>T</code> variable <b>references</b> this "
-"array."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Close10.html:1
+msgid "Close to 10"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:143
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Close10.html:2
msgid ""
-"The size of an array is fixed and cannot be changed after the creation of "
-"the array. The size of a <code>T</code> array can be retrieve by consulting "
-"the variable <code>T.length</code>."
+"Given 2 int values, return whichever value is nearest to the value 10, or "
+"return 0 in the event of a tie. [!java|scala]Note that Math.abs(n) returns "
+"the absolute value of a number.[/!] [!python]Note that math.fabs(n) returns "
+"the absolute value of a number. This function can only be used if you "
+"imported the math module.[/!]"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:147
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Close10.html:7 src/lessons/welcome/bat/bool1/Diff21.html:5 src/lessons/welcome/bat/bool1/HasTeen.html:6 src/lessons/welcome/bat/bool1/IcyHot.html:5 src/lessons/welcome/bat/bool1/In1020.html:5 src/lessons/welcome/bat/bool1/In3050.html:5 src/lessons/welcome/bat/bool1/LastDigit.html:9 src/lessons/welcome/bat/bool1/LoneTeen.html:6 src/lessons/welcome/bat/bool1/Main.html:11 src/lessons/welcome/bat/bool1/Makes10.html:5 src/lessons/welcome/bat/bool1/Max1020.html [...]
msgid ""
-"While allocating, you can specify the size with a variable: "
-"<code>[!java]int[] T = new int[i];[/!][!scala]var T = new "
-"Array[Int](i);[/!]</code> In this case, the array's size will be set to the "
-"value of <code>i</code> <i>when <code>new</code> gets called</i>. The size "
-"of the array still cannot be modified : even if the variable <code>i</code> "
-"changes afterward, the size remains to the value given when it was "
-"allocated. [!java]Also, it is forbidden to write something like <code>int "
-"T[10];</code> when declaring the variable. You are required to use the "
-"<code>new</code> instruction to allocate it, as in <code>int[] T = new "
-"int[10];</code> [/!]"
+"This exercise was converted to PLM from the excellent exercising site "
+"http://javabat.com/"
msgstr ""
-#. type: Content of: <p><p><p><h4>
-#: src/lessons/welcome/array/basics/Array1.html:155
-msgid "Declaration and initialization"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/CountTeen.html:1
+msgid "Count Teen"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:156
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/CountTeen.html:2
msgid ""
-"If you know beforehand the content of your array, you can declare, allocate "
-"and initialize it in one shoot:"
+"We'll say that a number is \"teen\" if it is in the range 13..19 "
+"inclusive. Given 4 int values, return the amount of teen ones."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:157
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Diff21.html:1
+msgid "Diff 21"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/Diff21.html:2
msgid ""
-"[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = "
-"Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
+"Given an int n, return the absolute difference between n and 21, except "
+"return double the absolute difference if n is over 21."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:159
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/HasTeen.html:1
+msgid "Has Teen"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/HasTeen.html:2
msgid ""
-"To know the size of the array to allocate, the compiler counts the provided "
-"values. This code is equivalent to:"
+"We'll say that a number is \"teen\" if it is in the range 13..19 "
+"inclusive. Given 3 int values, return true if 1 or more of them are teen."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:161
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/IcyHot.html:1
+msgid "Icy Hot"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/IcyHot.html:2
msgid ""
-"[!java]int[] T = new int[10];\n"
-"T[0] = 1;\n"
-"T[1] = 2;\n"
-"...\n"
-"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
-"T(0) = 1\n"
-"T(1) = 2\n"
-"...\n"
-"T(9) = 10[/!]"
+"Given two temperatures, return true if one is less than 0 and the other is "
+"greater than 100."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:171
-msgid "It is also equivalent to:"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/In1020.html:1
+msgid "In [10;20]"
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:172
-#, no-wrap
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/In1020.html:2
msgid ""
-"[!java]int[] T = new int[10];\n"
-"for (int i=0; i<T.length; i++) {\n"
-" T[i] = i+1;\n"
-"}[/!][!scala]var T = new Array[Int](10);\n"
-"for (i <- 0 to T.length-1) {\n"
-" T(i) = i+1\n"
-"}[/!]"
+"Given 2 int values, return true if either of them is in the range 10..20 "
+"inclusive."
msgstr ""
-#. type: Content of: <p><p><p><h3>
-#: src/lessons/welcome/array/basics/Array1.html:183
-msgid "[!python]Lists[/!][!scala|java]Arrays[/!] and method parameters"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/In3050.html:1
+msgid "In [30;50]"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:184
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/In3050.html:2
msgid ""
-"It is perfectly OK to pass [!python]a list[/!][!java|scala]an array[/!] to a "
-"method as a parameter. This method can then use this parameter as if it "
-"were defined locally:"
+"Given 2 int values, return true if they are both in the range 30..40 "
+"inclusive, or they are both in the range 40..50 inclusive."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:186
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/LastDigit.html:1
+msgid "LastDigit"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/LastDigit.html:2
msgid ""
-"[!java]boolean has42First(int[] array) {\n"
-" return array[0] == 42;\n"
-"}[/!][!python]def has42First(list):\n"
-" return list[0] == 42[/!][!scala]def has42First(array:Array[Int]):Boolean = "
-"{\n"
-" return array(0) == 42\n"
-"}[/!]"
+"Given two non-negative int values, return true if they have the same last "
+"digit, such as with 27 and 57. Note that the % \"mod\" operator computes "
+"remainders, so 17 % 10 is 7."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:193
-msgid "On the caller side, that also very simple:"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/LoneTeen.html:1
+msgid "Lone Teen"
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:194
-#, no-wrap
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/LoneTeen.html:2
msgid ""
-"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] "
-"(10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
-"[!java|scala]<span class=\"comment\">// Values initialization "
-"omitted</span>\n"
-"[/!]if (has42First(tab))[!java|scala] {[/!][!python]:[/!]\n"
-" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] do "
-"something</span>\n"
-"[!java|scala]}[/!]"
+"We'll say that a number is \"teen\" if it is in the range 13..19 "
+"inclusive. Given 2 int values, return true if one or the other is teen, but "
+"not both."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:201
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Main.html:1
+msgid "Boolean fun"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Main.html:3
msgid ""
-"If you want to allocate and initialize the array in one shoot, that's a bit "
-"more complicated as the compiler has to know the type of the parameter you "
-"are creating. For that, use the following (ugly) construct:"
+"Boolean operations are one of the very basic task in programming. As long "
+"as you cannot write a not so simple boolean test under the minute, you "
+"probably will have a very bad time writing a real program."
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:204
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Main.html:8
msgid ""
-"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
-" <span class=\"comment\">// do something</span>\n"
-"}"
+"That is why this lesson provides you a bunch of such exercises, so that you "
+"can get trained in this."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:209
-msgid ""
-"Methods can also return [!java|scala]arrays[/!][!python]lists[/!] as result "
-"without any complication. Here is a method that returns [!java|scala]an "
-"array[/!][!python]a list[/!] of the requested size, filled with 42s."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Makes10.html:1
+msgid "Makes 10"
msgstr ""
-#. type: Content of: <p><p><p><pre>
-#: src/lessons/welcome/array/basics/Array1.html:212
-#, no-wrap
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/Makes10.html:2
msgid ""
-"[!java]int[] fill42(int size) {\n"
-" int[] res = new int[size];\n"
-" for (int i=0; i<size; i++) \n"
-" res[i] = 42;\n"
-" return res;\n"
-"}[/!][!scala]def fill42(size:Int):Array[Int] = {\n"
-" var res = new Array[int] (size)\n"
-" for (i <- 0 to size -1) {\n"
-" res(i) = 42;\n"
-" }\n"
-" return res;\n"
-"}[/!][!python]def fill42(size):\n"
-" res = []\n"
-" for i in range(size):\n"
-" res.append(42)\n"
-" return res[/!]"
+"Given 2 ints, a and b, return true if one if them is 10 or if their sum is "
+"10."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:231
-msgid "At least! After this long explanation, we can come back to the exercise."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/Max1020.html:1
+msgid "Max1020"
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:232
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Max1020.html:2
msgid ""
-"Your mission is rather simple actually. Your code should save the color "
-"pattern observed on the first row into [!java|scala]an array[/!][!python]a "
-"list[/!]. [!python]The easiest is to create an empty list, and then "
-"<code>append()</code> the colors one after the others as you read them (with "
-"<code>getGroundColor()</code>).[/!] [!java|scala]For that, you should "
-"declare and allocate an array of <code>Color</code>. Beware, there is "
-"several worlds, of differing size; use <code>getWorldHeight()</code> to "
-"retrieve the size of the current world. Once the array allocated, fill it "
-"by reading the ground color in each locations (with "
-"<code>getGroundColor()</code>).[/!]"
+"Given 2 positive int values, return the larger value that is in the range "
+"10..20 inclusive, or return 0 if neither is in that range."
msgstr ""
-#. type: Content of: <p><p><p><p>
-#: src/lessons/welcome/array/basics/Array1.html:240
+#. type: Content of: <p>
+#: src/lessons/welcome/bat/bool1/Max1020.html:5
msgid ""
-"Once you managed to read and save the pattern on the first row, you have to "
-"reapply the pattern on every rows, for example by executing "
-"<code>getWorldHeight()</code> times a method written specifically for this."
+"Note that Math.max(Int,Int):Int and Math.min(Int,Int):Int return the maximum "
+"and minimum of two integers"
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/basics/Array2.html:1
-msgid "[!java|scala]Arrays[/!][!python]Lists[/!], Knotting and Modulos"
+#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:1
+msgid "MonkeyTrouble"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/MonkeyTrouble.html:3
msgid ""
-"This exercise is similar to the previous one: you have to reproduce the "
-"color pattern of the first cell into the other ones."
+"We have two monkeys, a and b, and the parameters aSmile and bSmile indicate "
+"if each is smiling. We are in trouble if they are both smiling or if "
+"neither of them is smiling. Return true if we are in trouble."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:6
-msgid ""
-"The first difference is that the world is bordered of walls: you thus have "
-"to slightly modify your trajectory to ensure that the buggle does not crash "
-"into a wall. The simpler for that is to handle the first cell out of the "
-"<code>for</code> loop and do only <code>getWorldHeight()-1</code> steps in "
-"the loop."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/NearHundred.html:1
+msgid "Near Hundred"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:12
+#: src/lessons/welcome/bat/bool1/NearHundred.html:2
msgid ""
-"The other difference is that the offset to apply between columns is not "
-"fixed, but written on the first cell of each column. To get the info as an "
-"integer, we can use:"
+"Given an int n, return true if it is within 10 of 100 or 200. "
+"[!java|scala]Note that Math.abs(n) returns the absolute value of a "
+"number.[/!] [!python]Note that math.fabs(n) returns the absolute value of a "
+"number. This function can only be used if you imported the math module.[/!]"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/welcome/array/basics/Array2.html:16
-#, no-wrap
-msgid ""
-"[!java]int offset = Integer.parseInt(readMessage())[/!][!python]offset = "
-"int( readMessage() )[/!][!scala]val offset = readMessage().toInt[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/ParotTrouble.html:1
+msgid "Parot Trouble"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:18
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/ParotTrouble.html:3
msgid ""
-"<code>readMessage()</code> gets the message on the ground as a "
-"[!java|scala]String[/!][!python]string[/!], while "
-"<code>[!java]Integer.parseInt(str)[/!][!scala]str.toInt[/!][!python]int(str)[/!]</code> "
-"transforms the string <code>str</code> into an integer by <i>reading</i> it."
+"We have a loud talking parrot. The \"hour\" parameter is the current hour "
+"time in the range 0..23. We are in trouble if the parrot is talking and the "
+"hour is before 7 or after 20. Return true if we are in trouble."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:22
-msgid ""
-"Then, to pick the right color, the easier is to use the <code>%</code> "
-"(modulo) operator. For example, <code>(i + 5) % size</code> allows to "
-"retrieve the <code>i</code>th cell of an array of size <code>size</code> "
-"with an offset of <code>5</code>."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/PosNeg.html:1
+msgid "Positive Negative"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/basics/Array2.html:27
-msgid "You're up."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/PosNeg.html:2
+msgid ""
+"Given 2 int values, return true if one is negative and one is "
+"positive. Unless negative is true, then they both must be negative."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:1
-msgid "Searching for a given value"
+#: src/lessons/welcome/bat/bool1/SleepIn.html:1
+msgid "SleepDay"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/SleepIn.html:3
msgid ""
-"The goal of this exercise is to search the cell of a given value, and return "
-"its position."
+"The parameter weekday is true if it is a weekday, and the parameter vacation "
+"is true if we are on vacation. We sleep in if it is not a weekday or we're "
+"on vacation. Return true if we sleep in."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:5
-msgid ""
-"To that extend, you should fill the method <code>indexOf()</code>, which "
-"parameters are the array to explore, and the value to search. If the value "
-"<code>lookingFor</code> is not in the array <code>tab</code>, the method "
-"should return -1."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool1/SumDouble.html:1
+msgid "Sum Double"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:9
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool1/SumDouble.html:2
msgid ""
-"The idea of the algorithm is to sweep over the whole array, checking the "
-"value of each cell. If it's the searched value, you should return the index "
-"of the cell currently checked."
+"Given two int values, return their sum. Unless the two values are the same, "
+"then return double their sum."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:13
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/AlarmClock.html:1
+msgid "AlarmClock"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/AlarmClock.html:2
msgid ""
-"Remember that indices begin at 0 and not at 1. So, if there is 3 cells, "
-"their indices will be 0, 1 and 2. There would not be any cell numbered 3."
+"Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a "
+"boolean indicating if we are on vacation, return a string of the form "
+"\"7:00\" indicating when the alarm clock should ring. Weekdays, the alarm "
+"should be \"7:00\" and on the weekend it should be \"10:00\". Unless we are "
+"on vacation -- then on weekdays it should be \"10:00\" and weekends it "
+"should be \"off\"."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:16
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/AnswerCell.html:1
+msgid "AnswerCell"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/AnswerCell.html:2
msgid ""
-"Remember also that the amount of cells in an array can be retrieved using "
-"the <code>length</code> attribute. So, if your array is called "
-"<code>tab</code>, its size can be retrieved as <code>tab.length</code>. "
-"Note that there is no () after <code>length</code>. An attribute is a sort "
-"of variable embedded in another object (here, the array)."
+"Your cell phone rings. Return true if you should answer it. Normally you "
+"answer, except in the morning you only answer if it is your mom calling. In "
+"all cases, if you are asleep, you do not answer."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:21
-msgid "So, the last value of an array is given by <code>tab[tab.length - 1]</code>."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/BlueTicket.html:1
+msgid "BlueTicket"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:23
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/BlueTicket.html:2
msgid ""
-"Remember also that the amount of cells in an array can be retrieved with the "
-"<code>len()</code> function. So, if your array is called <code>tab</code>, "
-"its size can be retrieved as <code>len(tab)</code>."
+"You have a blue lottery ticket, with ints a, b, and c on it. This makes "
+"three pairs, which we'll call ab, bc, and ac. Consider the sum of the "
+"numbers in each pair. If any pair sums to exactly 10, the result is 10. "
+"Otherwise if the ab sum is exactly 10 more than either bc or ac sums, the "
+"result is 5. Otherwise the result is 0."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:27
-msgid "So, the last value of an array is given by <code>tab[ len(tab) - 1]</code>."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:1
+msgid "CaughtSpeeding"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/CaughtSpeeding.html:2
+msgid ""
+"You are driving a little too fast, and a police officer stops you. Write "
+"code to compute the result, encoded as an int value: 0=no ticket, 1=small "
+"ticket, 2=big ticket. If speed is 60 or less, the result is 0. If speed is "
+"between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the "
+"result is 2. Unless it is your birthday -- on that day, your speed can be 5 "
+"higher in all cases."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:1
-msgid "Index of the maximum value"
+#: src/lessons/welcome/bat/bool2/CigarParty.html:1
+msgid "CigarParty"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/CigarParty.html:2
msgid ""
-"In this exercise, you must compute the index of the tab cell containing the "
-"biggest value."
+"When squirrels get together for a party, they like to have cigars. A "
+"squirrel party is successful when the number of cigars is between 40 and 60, "
+"inclusive. Unless it is the weekend, in which case there is no upper bound "
+"on the number of cigars. Return true if the party with the"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:5
-msgid ""
-"For that, fill the <code>indexOfMaximum()</code> method. Its parameter is "
-"the array to explore. Should the array contain the searched value several "
-"times, you should return the index of the first occurrence."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/DateFashion.html:1
+msgid "DateFashion"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:9
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/DateFashion.html:2
msgid ""
-"To solve this exercise, you should sweep over the whole array. For each "
-"value, if it's bigger than the biggest value you saw so far, you must save "
-"this new champion and its position. You will thus need 2 extra variables; "
-"the initial value of the champion could be the value of the first cell."
+"You and your date are trying to get a table at a restaurant. The parameter "
+"\"you\" is the stylishness of your clothes, in the range 0..10, and \"date\" "
+"is the stylishness of your date's clothes. The result getting the table is "
+"encoded as an int value with 0=no, 1=maybe, 2=yes. If either of you is very "
+"stylish, 8 or more, then the result is 2 (yes). With the exception that if "
+"either of you has style of 2 or less, then the result is 0 (no). Otherwise "
+"the result is 1 (maybe)."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:1
-msgid "Average value"
+#: src/lessons/welcome/bat/bool2/GreenTicket.html:1
+msgid "GreenTicket"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:4
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/GreenTicket.html:2
msgid ""
-"The objective of this exercise is to compute the average value of the "
-"integer values stored in an array."
+"You have a green lottery ticket, with ints a, b, and c on it. If the numbers "
+"are all different from each other, the result is 0. If all of the numbers "
+"are the same, the result is 20. If two of the numbers are the same, the "
+"result is 10."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:6
-msgid ""
-"You have to fill the body of the method <code>average()</code> which takes "
-"as parameter the array of integers of which it computes and returns the "
-"average value. Please note that this method must return an integer."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/In1To10.html:1
+msgid "In1To10"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:8
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/In1To10.html:2
msgid ""
-"To compute the average value of an integer, it is necessary to traverse the "
-"whole array and to compute the sum of all its values (so you will need a "
-"variable to store this temporary result), then you have to divide this sum "
-"by the size of the array."
+"Given a number n, return true if n is in the range 1..10, inclusive. Unless "
+"\"outsideMode\" is true, in which case return true if the number is less or "
+"equal to 1, or greater or equal to 10."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:10
-msgid ""
-"In Java, you can get the size of an array <code>myarray</code> by consulting "
-"its <code>length</code> attribute (in other words, "
-"<code>myarray.length</code>). Notice that there is no parenthesis after "
-"<code>length</code>."
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/InOrderEqual.html:1
+msgid "InOrderEqual"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/averagevalue/AverageValue.html:15
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/InOrderEqual.html:2
msgid ""
-"In python, retrieving the size of an array <code>myarray</code> is as easy "
-"as calling <code>len(myarray)</code>."
+"Given three ints, a b c, return true if they are in strict increasing order, "
+"such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the "
+"exception that if \"equalOk\" is true, equality is allowed, such as 5 5 7 or "
+"5 5 5."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:1
-msgid "Maximal value"
+#: src/lessons/welcome/bat/bool2/InOrder.html:1
+msgid "InOrder"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/InOrder.html:2
msgid ""
-"In this exercise, you must compute the maximal value contained in an array. "
-"For that, fill the <code>maximum()</code> method, which parameter is the "
-"array to explore."
+"Given three ints, a b c, return true if b is greater than a, and c is "
+"greater than b. However, with the exception that if \"bOk\" is true, b does "
+"not need to be greater than a."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/maxvalue/MaxValue.html:7
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/LastDigit2.html:1
+msgid "LastDigit 2"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/LastDigit2.html:2
msgid ""
-"To compute this value, sweep over the whole parameter. For each value, if "
-"it's bigger than the biggest value you saw so far, you must save this value "
-"somewhere to remember it afterward. You thus need an extra variable, which "
-"can be initialized to the value of the first array cell."
+"Given three ints, a b c, return true if two or more of them have the same "
+"rightmost digit. The ints are non-negative. Note: the % \"mod\" operator "
+"computes the remainder, e.g. 17 % 10 is 7."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:1
-msgid "Occurrence of a value"
+#: src/lessons/welcome/bat/bool2/LessBy10.html:1
+msgid "LessBy10"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/LessBy10.html:2
msgid ""
-"In this exercise, you must compute the amount of occurrences of a given "
-"value in an array (that is, the amount of time that this value appears in "
-"the array). For that, fill the <code>occurrences()</code> method, which "
-"returns the number of occurrence of <code>lookingFor</code> in "
-"<code>tab</code>."
+"Given three ints, a b c, return true if one of them is 10 or more less than "
+"one of the others."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/Main.html:1
+msgid "Boolean (even more) fun"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:8
+#: src/lessons/welcome/bat/bool2/Main.html:3
msgid ""
-"To compute this value, simply sweep over the array counting for the amount "
-"of cells containing the searched value. You thus need an extra variable for "
-"that."
+"A very good introduction to this type is available here: "
+"http://javabat.com/doc/ifboolean.html."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/array123/Array123.html:1
-msgid "Array123"
+#: src/lessons/welcome/bat/bool2/MaxMod5.html:1
+msgid "MaxMod5"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/array123/Array123.html:2
+#: src/lessons/welcome/bat/bool2/MaxMod5.html:2
msgid ""
-"Given an array of integers, return true if .. 1, 2, 3, .. appears in the "
-"array somewhere."
+"Given two int values, return whichever value is larger. However if the two "
+"values have the same remainder when divided by 5, then the return the "
+"smaller value. However, in all cases, if the two values are the same, return "
+"0. Note: the % \"mod\" operator computes the remainder, e.g. 7 % 5 is 2."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/array667/Array667.html:1
-msgid "Array667"
+#: src/lessons/welcome/bat/bool2/NearTen.html:1
+msgid "NearTen"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/array667/Array667.html:2
+#: src/lessons/welcome/bat/bool2/NearTen.html:2
msgid ""
-"Given an array of integers, return the number of times that two 6's are next "
-"to each other in the array. Also count instances where the second \"6\" is "
-"actually a 7."
+"Given a non-negative number \"num\", return true if num is within 2 of a "
+"multiple of 10. Note: (a % b) is the remainder of dividing a by b, so (7 % "
+"5) is 2."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:1
-msgid "ArrayCount9"
+#: src/lessons/welcome/bat/bool2/RedTicket.html:1
+msgid "RedTicket"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:2
-msgid "Given an array of integers, return the number of 9's in the array."
+#: src/lessons/welcome/bat/bool2/RedTicket.html:2
+msgid ""
+"You have a red lottery ticket showing ints a, b, and c, each of which is 0, "
+"1, or 2. If they are all the value 2, the result is 10. Otherwise if they "
+"are all the same, the result is 5. Otherwise so long as both b and c are "
+"different from a, the result is 1. Otherwise the result is 0."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:1
-msgid "ArrayFront9"
+#: src/lessons/welcome/bat/bool2/ShareDigit.html:1
+msgid "ShareDigit"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:2
+#: src/lessons/welcome/bat/bool2/ShareDigit.html:2
msgid ""
-"Given an array of integers, return true if one of the first 4 elements in "
-"the array is a 9. The array length may be less than 4."
+"Given two ints, each in the range 10..99, return true if there is a digit "
+"that appears in both numbers, such as the 2 in 12 and 23. (Note: division, "
+"e.g. n/10, gives the left digit while the % \"mod\" n%10 gives the right "
+"digit.)"
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/notriples/NoTriples.html:1
-msgid "NoTriples"
+#: src/lessons/welcome/bat/bool2/SortaSum.html:1
+msgid "SortaSum"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/welcome/array/notriples/NoTriples.html:2
+#: src/lessons/welcome/bat/bool2/SortaSum.html:2
msgid ""
-"Given an array of integers, we'll say that a triple is a value appearing 3 "
-"times in a row in the array. Return true if the array does not contain any "
-"triples."
+"Given 2 ints, a and b, return their sum. However, sums in the range 10..19 "
+"inclusive, are forbidden, so in that case just return 20."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/welcome/array/has271/Has271.html:1
-msgid "Has271"
+#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:1
+msgid "SquirrelPlay"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/has271/Has271.html:2
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/SquirrelPlay.html:2
msgid ""
-"Given an array of integers, return true if it contains a 2, 7, 1 pattern -- "
-"a value, followed by the value plus 5, followed by the initial value minus "
-"1. So, 2,7,1 is such a pattern because 7 is 5+2 and 1 is 2-1. 3,8,2 is also "
-"such a pattern."
+"The squirrels in Palo Alto spend most of the day playing. In particular, "
+"they play if the temperature is between 60 and 90 (inclusive). Unless it is "
+"summer, then the upper limit is 100 instead of 90. Given an int temperature "
+"and a boolean isSummer, return true if the squirrels play and false "
+"otherwise."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/welcome/array/has271/Has271.html:6
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/TeaParty.html:1
+msgid "TeaParty"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/TeaParty.html:2
msgid ""
-"Additionally the 271 counts even if the \"1\" differs by 2 or less from the "
-"correct value."
+"We are having a party with amounts of tea and candy. Return the int outcome "
+"of the party encoded as 0=bad, 1=good, or 2=great. A party is good (1) if "
+"both tea and candy are at least 5. However, if either tea or candy is at "
+"least double the amount of the other one, the party is great (2). However, "
+"in all cases, if either tea or candy is less than 5, the party is always bad "
+"(0)."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:1
-msgid "PancakeWorld"
+#: src/lessons/welcome/bat/bool2/TeenSum.html:1
+msgid "TeenSum"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:3
-msgid "This universe is very simple, with only five functions provided."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/bat/bool2/TeenSum.html:2
+msgid ""
+"Given 2 ints, a and b, return their sum. However, \"teen\" values in the "
+"range 13..19 inclusive, are extra lucky. So if either value is a teen, just "
+"return 19."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:5
-#, no-wrap
-msgid "[!java]int [/!]getStackSize() [!scala]:Int[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/TwoAsOne.html:1
+msgid "TwoAsOne"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:6
-msgid "Returns the size of the stack, that is the amount of pancakes it contains."
+#: src/lessons/welcome/bat/bool2/TwoAsOne.html:2
+msgid ""
+"Given three ints, a b c, return true if it is possible to add two of the "
+"ints to get the third."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:8
-#, no-wrap
-msgid ""
-"[!java]int [/!]getPancakeRadius([!java]int [/!]rank[!scala]:Int[/!]) "
-"[!scala]:Int[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:1
+msgid "WithoutDoubles"
msgstr ""
#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:9
+#: src/lessons/welcome/bat/bool2/WithoutDoubles.html:2
msgid ""
-"Returns the radius of the pancake passed as argument, with the rank of the "
-"top-most pancake being 0."
+"Return the sum of two 6-sided dice rolls, each in the range 1..6. However, "
+"if noDoubles is true, if the two dice show the same value, increment one die "
+"to the next value, wrapping around to 1 if its value was 6."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:11
-#, no-wrap
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/Main.html:1
+msgid "String fun"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/bat/string1/Main.html:3
msgid ""
-"[!java]boolean [/!]isPancakeUpsideDown([!java]int [/!]rank[!scala]:Int[/!]) "
-"[!scala]:Boolean[/!]"
+"Strings are the simplest of the complex data types :) They provide several "
+"operations, such as getting the length of the string, or a substring of it.."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:12
+#. type: Content of: <p>
+#: src/lessons/bat/string1/Main.html:7
msgid ""
-"Returns whether the pancake passed as argument upside-down, that is, if its "
-"burned side is on top. As usual, the top-most pancake is of rank 0."
+"A very good introduction to this type is available here: "
+"http://javabat.com/doc/string.html."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:14
-#, no-wrap
-msgid "[!java]void [/!]flip([!java]int [/!]amount[!scala]:Int[/!])"
+#. type: Content of: <h3>
+#: src/lessons/bat/string1/short_desc.html:1
+msgid "Small exercises about strings"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:15
+#. type: Content of: <p>
+#: src/lessons/bat/string1/short_desc.html:3
msgid ""
-"Flips the <code>amount</code> first pancakes composing the stack, from the "
-"top of it."
+"These are some training exercises around strings. But unfortunately, its "
+"integration within PLM is still ongoing."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:17
-#, no-wrap
-msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
+#. type: Content of: <p>
+#: src/lessons/bat/string1/short_desc.html:6
+msgid "Please be patient with us."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:18
-msgid "Returns whether the pancake stack is correctly sorted."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/AltPairs.html:1
+msgid "AltPairs"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/pancake/universe/PancakeWorld.html:20
-#, no-wrap
-msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/AltPairs.html:2
+msgid ""
+"Given a string, return a string made of the chars at indexes 0,1, 4,5, 8,9 "
+"... so \"kittens\" yields \"kien\"."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/pancake/Main.html:1 src/lessons/sort/pancake/BasicPancake.html:1
-msgid "Pancake Sorting"
+#: src/lessons/bat/string1/FrontTimes.html:1
+msgid "FrontTimes"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/FrontTimes.html:2
msgid ""
-"This activity is inspired by a problem first introduced in 1975 by Harry "
-"Dweighter in the American Mathematical Monthly. The question is not only to "
-"sort the pancakes, but to determine <code>f(n)</code> the <i>minimal</i> "
-"amount of flips mandated to sort any stack of size <code>n</code>."
+"Given a string and a non-negative int n, we'll say that the front of the "
+"string is the first 3 chars, or whatever is there if the string is less than "
+"length 3. Return n copies of the front;"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:7
-msgid ""
-"This problem is now famous because Bill Gates authored (with "
-"C. Papadimitriou) his only scientific publication in 1979 on this topic, "
-"providing a faster algorithm and proving that <code>17n/16 ≤ f(n) ≤ "
-"(5n+5)/3</code>. This was the only publication of Bill Gates before he "
-"invented Windows and became rich."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/Last2.html:1
+msgid "Last2"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:11
+#: src/lessons/bat/string1/Last2.html:3
msgid ""
-"Then, David X. Cohen, the inventor of the Futurama comics with many "
-"mathematical references, introduced the variant with burnt pancakes and "
-"studied its complexity with Manuel Blum in 1993."
+"Given a string, return the amount of times that the two last letters appear "
+"as a substring of the string. So \"hixxxhi\" yields 1 (we won't count the "
+"end substring) while \"aaaNaa\" yields 2 (substrings may overlap)."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:14
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringBits.html:1
+msgid "StringBits"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringBits.html:2
msgid ""
-"An article of 2012 (by L. Bulteau, G. Fertin and I. Rusu) proved that "
-"determining the minimal amount of flips to sort the stack is a NP-complete "
-"problem. Naturally, the stack sorting problem is not NP-complete since it "
-"can be solved in 2n-3 steps with the naive algorithm and (5n+5)/3 steps with "
-"the Gates algorithm. That's determining the minimal amount of steps that is "
-"NP."
+"Given a string, return a new string made of every other char starting with "
+"the first, so \"Hello\" yields \"Hlo\"."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:19
-msgid "Further information can be found on the wikipedia page, as usual."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringMatch.html:1
+msgid "StringMatch"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/Main.html:22
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringMatch.html:2
msgid ""
-"This activity is also integrated to CSIRL (my repository of <i>free</i> "
-"unplugged activities to introduce computer science, available at "
-"http://www.loria.fr/~quinson/Mediation/SMN/), and it may be interesting to "
-"run the unplugged activities before implementing these algorithms in PLM."
+"Given 2 strings, a and b, return the number of the positions where they "
+"contain the same length 2 substring. So \"xxcaazz\" and \"xxbaaz\" yields 3, "
+"since the \"xx\", \"aa\", and \"az\" substrings appear in the same place in "
+"both strings."
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/Main.html:33
-msgid "A temporal view similar to the sorting universe could be helpful"
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringSplosion.html:1
+msgid "StringSplosion"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/Main.html:34
-msgid "Other exercises, for example on the Cohen's algorithm, or on the other ones."
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringSplosion.html:2
+msgid "Given a non-empty string like \"Code\" return a string like \"CCoCodCode\"."
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/sort/pancake/short_desc.html:1
-msgid "The pancake problem"
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringTimes.html:1
+msgid "StringTimes"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/short_desc.html:3
-msgid "Help the poor psychorigid pancakes' chef to sort its pancake stack!"
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringTimes.html:2
+msgid ""
+"Given a string and a non-negative int n, return a larger string that is n "
+"copies of the original string."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/short_desc.html:5
-msgid ""
-"This funny problem leads to algorithms that are somewhat more challenging to "
-"implement. You are supposed to master the bases of programming and some "
-"sorting algorithms to take this lesson."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringX.html:1
+msgid "StringX"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringX.html:2
msgid ""
-"The pancake sorting problem this is a simple puzzle where you have a set of "
-"pancakes, each of differing size. The chef cooking the pancake is a bit "
-"psychorigid: he hates when the pancakes are not correctly sorted on the "
-"plate. He loves when they are correctly ordered, with the small ones over "
-"the larger ones. As every pancake maker, he masters the pancake flipping "
-"with his spatula. He can flip the pancake on top of the stack, or even "
-"several pancakes at once. The thing is that he has only one plate and the "
-"table is too dirty to place pancakes on it, even temporary. The only allowed "
-"operation is to flip some pancakes that are on top of the stack."
+"Given a string, return a version where all the \"x\" have been "
+"removed. Except an \"x\" at the very start or end should not be removed."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:12
-msgid ""
-"Your work is to help this poor guy sorting his stack by flipping the "
-"pancakes. Each pancake is defined by its radius and rank within the stack, "
-"where the bottom pancake is at rank 0, and the one above at rank 1."
+#. type: Content of: <h1>
+#: src/lessons/bat/string1/StringYak.html:1
+msgid "StringYak"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BasicPancake.html:16
+#. type: Content of: outside any tag (error?)
+#: src/lessons/bat/string1/StringYak.html:2
msgid ""
-"Note that you can play physically with pieces of paper or wood at first to "
-"get the grasp on this problem. This is even one of the activities that I use "
-"in my CS-IRL (computer science in real life) project to introduce the "
-"concept of algorithm to absolute beginners that wonder about our "
-"science. More information at http://www.loria.fr/~quinson/Mediation/SMN/ (in "
-"French)."
+"Suppose the string \"yak\" is unlucky. Given a string, return a version "
+"where all the \"yak\" are removed, but the \"a\" can be any char. The "
+"\"yak\" strings will not overlap."
msgstr ""
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:22
-msgid "I don't get it. I need some help."
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/basics/Array1.html:1
+msgid "[!java|scala]Arrays[/!][!python]Lists[/!] and Knotting"
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:23
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/basics/Array1.html:3
msgid ""
-"You should try to first move the largest pancake to the bottom, and then the "
-"largest but one pancake on top of it, and then the one just smaller on top, "
-"and so on."
+"The goal of this exercise is to reproduce the pattern of the first row in "
+"the other rows with a shift of one cell (see the Objective tab for "
+"details). The biggest difference between this exercise and the others we had "
+"on patterns is that you have to read the pattern (on first row) before "
+"reproducing it. You cannot do otherwise because the same code will be "
+"executed on three different worlds, each of them having a specific pattern."
msgstr ""
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:27
-msgid "The first tip was not enough. I need another one."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array1.html:11
+msgid ""
+"One solution is to read the next cell, and go copy it in position before "
+"coming back to read the second cell. But since it is forbidden to use the "
+"methods to teleport the buggle to a specific position (<code>setPos()</code> "
+"and similar), this approach will be a pain to implement."
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:28
-msgid "So first, you need to move the largest pancake at the bottom of the stack."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array1.html:16
+msgid ""
+"The simplest is to store the sequence of colors that constitute the whole "
+"pattern in an [!java|scala]<b>array</b>[/!][!python]<b>list</b>[/!]. But "
+"before we can do so, we should learn a bit what "
+"[!java|scala]arrays[/!][!python]lists[/!] are."
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:29
+#. type: Content of: <h2>
+#: src/lessons/welcome/array/basics/Array1.html:20
+msgid "[!java|scala]Arrays[/!][!python]List[/!]"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array1.html:22
msgid ""
-"Can you imagine a situation in which you can easily bring this damn large "
-"pancake to the bottom?"
+"[!java|scala]An array[/!][!python]A list[/!] is an ordered sequence of "
+"variables that go together. It is somehow similar to a shelve where each "
+"level can store a separate value. Each variable of the sequence is "
+"identified by its position, and can store a specific value. [!java|scala]All "
+"cells of the array must store values of the same type because arrays are "
+"homogeneous in [!thelang]. It is possible to trick this restriction by using "
+"the datatype <code>[!java]Object[/!][!scala]Any[/!]</code> that can contain "
+"[!java]almost[/!] any other datatype. [!java]Primitive types such as the "
+"ones we saw so far (int, boolean, double, char, etc) cannot be stored in an "
+"Object variable, but their objectified counter-part (Integer, Boolean, "
+"Double, Char, Boolean, etc) can.[/!] It is however a good practice to make "
+"the type of an array as specific as possible, i.e., if you plan to store "
+"some integers in your array, make it an array of integers, not of "
+"[!java]Object[/!][!scala]Any[/!].[/!] [!python]Lists can even mix values of "
+"differing types, such as integer values in some cells and colors in other "
+"cells.[/!]"
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/BasicPancake.html:30
-msgid "How could you reach this situation from the current one?"
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:38
+msgid ""
+"T is the [!java|scala]array[/!][!python]list[/!]'s name, "
+"[!java|python]T[0][/!][!scala]T(0)[/!] is the name of the first cell, "
+"[!java|python]T[1][/!][!scala]T(1)[/!] the name of the second cell, "
+"[!java|python]T[2][/!][!scala]T(2)[/!] the third one, etc. And yes, the "
+"first cell is numbered [!java|python]T[0][/!][!scala]T(0)[/!] while the last "
+"one of [!java|scala]an array[/!][!python]a list[/!] of size N is "
+"[!java|python]T[N-1][/!][!scala]T(N-1)[/!]. It may seem funny to count "
+"starting from 0 and not from 1 as usual, but some historical reasons make it "
+"unavoidable here."
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/sort/pancake/BurnedPancake.html:1
-msgid "Burned Pancakes"
+#. type: Content of: <p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:46
+msgid "Basic usage"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/BurnedPancake.html:3
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:48
msgid ""
-"Hard blow for the chef! The pancakes got burnt on one side! There is no way "
-"he can deliver a stack of pancakes with visibly burnt pancakes! You've got "
-"to help him ensuring that no pancake is upside-down while sorting his stack."
+"We can use an integer variable <i>i</i> to access with "
+"[!java|python]T[i][/!][!scala]T(i)[/!] to the cells: when the value of "
+"<i>i</i> is 0, then [!java|python]T[i][/!][!scala]T(i)[/!] accesses "
+"[!java|python]T[0][/!][!scala]T(0)[/!]; when the value of <i>i</i> is 10, "
+"then [!java|python]T[i][/!][!scala]T(i)[/!] accesses "
+"[!java|python]T[10][/!][!scala]T(10)[/!]. <i>i</i> is said to be the "
+"<b>index</b> in T. <code>[!java|python]T[i][/!][!scala]T(i)[/!]</code> can "
+"be used just like any variable. We can set a new value:"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/sort/pancake/GatesPancake.html:1
-msgid "Faster Pancake Sorting"
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:56
+#, no-wrap
+msgid "[!java|python]T[i][/!][!scala]T(i)[/!] = 78[!java];[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:3
-msgid ""
-"Unlike others sorting problem, the expensive operation is not the comparison "
-"of values, but the flipping of pancakes. In this exercise, we will explore "
-"another algorithm that attempt to reduce the amount of stack flipping. The "
-"funny side is that this algorithm was first introduced by Bill Gates, before "
-"invented Windows."
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:58
+msgid "We can retrieve and use its value:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:8
-msgid ""
-"The basic idea is to grow sequences of sorted pancakes, not necessarily "
-"starting from the bottom. We say that a sequence of ordered pancakes "
-"constitute a <b>bloc</b> while a pancake that is not part of a bloc is said "
-"to be <b>free</b>. The algorithm then considers the topmost pancake (of "
-"radius <code>t</code>) and search for the <code>t+1</code> or "
-"<code>t-1</code> pancakes (the considered neighbor is noted "
-"<code>t+o</code>). Eight cases may happen:"
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:59
+#, no-wrap
+msgid "x = [!java|python]T[i][/!][!scala]T(i)[/!][!java];[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:15
-msgid ""
-"<b>Case a</b>: Both <code>t</code> and <code>t+o</code> are free. They are "
-"then merged in one flip."
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:61
+msgid "We can test this value:"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:19
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:62
+#, no-wrap
msgid ""
-"<b>Case b</b>: <code>t</code> is free, and <code>t+o</code> is the first of "
-"a block. They are merged in one flip."
+"if ([!java|python]T[i][/!][!scala]T(i)[/!] > 0) "
+"[!scala|java]{[/!][!python]:[/!]\n"
+" [!java|scala]//[/!][!python]#[/!] instructions...\n"
+"[!java|scala]}[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:24
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:66
msgid ""
-"<b>Case c</b>: <code>t</code> is free but both <code>t-1</code> and "
-"<code>t+1</code> are the last elements of blocks. Both blocs and "
-"<code>t</code> are merged all together in 4 flips. Beware, if either "
-"<code>t-1</code> or <code>t+1</code> does not exist (because <code>t</code> "
-"is 0 or max), only two flips are mandated."
+"It is very easy to traverse the whole "
+"[!scala|java]array[/!][!python]list[/!], for example to initialize each "
+"cells."
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:32
+#. type: Content of: <p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:69
+#, no-wrap
msgid ""
-"<b>Case d</b>: <code>t</code> is in a block but <code>t+o</code> is "
-"free. They are merged in one flip."
+"[!java]for (int i = 0; i<T.length; i++) {[/!][!python]for i in "
+"range(len(T)):[/!][!scala]for (i <- 0 to T.length-1) {[/!]\n"
+" [!java|python]T[i][/!][!scala]T(i)[/!] = 3[!java];[/!]\n"
+"[!java|scala]}[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:37
+#. type: Content of: <p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:73
msgid ""
-"<b>Case e</b>: <code>t</code> is in a block and <code>t+o</code> is the "
-"first element of a block. They are merged in one flip."
+"[!java|scala]The notation <code>T.length</code> retrieves the length of the "
+"array T,[/!] [!python]The function <code>len()</code> retrieves the length "
+"of the list T,[/!] allowing to build a classical for loop easily. "
+"[!python]Actually, the <code>len()</code> function is much more generic and "
+"can be used to retrieve the length of many objects. Applied to strings for "
+"example, it returns the amount of chars in this string.[/!] [!scala]Don't "
+"forget to start at <code>0</code> and stop at <code>T.length-1</code> "
+"instead of <code>1 to T.length</code> however.[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:41
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:81
msgid ""
-"<b>Case f</b>: <code>t</code> is in a block and <code>t+o</code> is the last "
-"element of another block. They are merged in 3 flips as follows."
+"If you just want to iterate over the values of T without keeping track of "
+"their index, you can simply write:"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:45
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:82
+#, no-wrap
msgid ""
-"<b>Case g</b>: <code>t</code> is in a block of length k+1 (the last element "
-"is <code>t+ko</code>), <code>t+(k+1)o</code> is either free or the last "
-"element of another block. Both blocks are merged in 2 flips:"
+"[!java]for (int i: T) {[/!][!scala]for (i <- T) {[/!][!python]for i in "
+"T:[/!]\n"
+" action()[!java];[/!]\n"
+"[!java|scala]}[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:48
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:85
msgid ""
-"<b>Case h</b>: <code>t</code> is in a block of length k+1 (the last element "
-"is <code>t+ko</code>), <code>t+(k+1)o</code> is the first element of another "
-"block (the difference with case g is that <code>t+(k+1)o</code> is now the "
-"<i>first</i> element of its block). Both blocks are merged in 2 flips:"
+"[!java]This construct is called an <i>extended loop</i> in Java. The "
+"variable <i>i</i> takes all values of the set located to the right of the "
+"colon (:), one after the other.[/!] [!python|scala]This is actually very "
+"similar to the previous construct. Simply, "
+"<code>[!python]range(n)[/!][!scala]i to j[/!]</code> returns a set of "
+"integers over which the for construct iterates. Actually, [!thelang] offers "
+"much more elegant ways to traverse [!python]lists[/!][!scala]arrays[/!] and "
+"other data collections, but this should be the topic of a specific set of "
+"exercises (that are still to be written in PLM).[/!]"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/pancake/GatesPancake.html:54
-msgid ""
-"<b>Case i</b>: <code>t</code> is in a block of length <code>n</code> (this "
-"block contains all pancakes). If <code>t</code> is not 1, the whole stack "
-"is fliped. The algorithm then stops."
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:96
+msgid "Declaring [!python]a list[/!][!java|scala]an array[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:57
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:99
msgid ""
-"Each iteration increases the size of the blocks, so the algorithm eventually "
-"halts in all cases. A finer analysis would show that it takes at most "
-"<code>(5n+5)/3</code> steps to sort the stack. That's better than the naïve "
-"algorithm, that requires 2n-3 steps."
-msgstr ""
-
-#. type: Content of: <h2>
-#: src/lessons/sort/pancake/GatesPancake.html:60
-msgid "Your turn"
+"If you know beforehand the content of your list, you can affect these values "
+"all together. Just put them between square braces and separated by commas "
+"as follows:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:61
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:102
+#, no-wrap
msgid ""
-"You now have almost enough information to implement this algorithm on your "
-"own. We just have to remove the last remaining ambiguities to ensure that "
-"you implement exactly the same algorithm that the correction. If several "
-"cases apply to your situation, then you should use the first given one. For "
-"example, if both cases a and b apply (e.g., with <code>t-1</code> on case "
-"<b>a</b> and <code>t+1</code> on case <b>b</b>), then you should apply the "
-"flips of case <b>a</b>. If a given case applies for both <code>t+1</code> "
-"and <code>t-1</code>, then you should apply it to <code>t+1</code>."
+"L = [1, 3, 5, 7, 9] \n"
+"<span class=\"comment\"># L is now an array of 5 values, all of them being "
+"integers</span>"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/pancake/GatesPancake.html:67
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:104
msgid ""
-"Note that it is somehow harder than the other exercises we did so far, so "
-"don't be surprised if you need more time to achieve this. But do not give "
-"hope, you can do it!"
+"Otherwise, you probably want to create an empty list and then append each "
+"values separately to the list:"
msgstr ""
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:70
-msgid "Well, I need some help to start."
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:106
+#, no-wrap
+msgid ""
+"L2 = [] \n"
+"<span class=\"comment\"># L2 is now an empty list</span>\n"
+"L2.append(1)\n"
+"L2.append(3)\n"
+"L2.append(5)\n"
+"L2.append(7)\n"
+"L2.append(9) \n"
+"<span class=\"comment\"># Its content is now the same as L previously</span>"
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:71
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:117
msgid ""
-"First write some helper functions such as <code>isFirst()</code> or "
-"<code>isFree()</code>. This will simplify your main algorithm afterward, "
-"that can be written very similarly to the explication above with a bunch of "
-"if conditions. Factorizing code this way often helps making your code more "
-"readable."
+"To declare a variable named <b>T</b> that can store arrays of integers, one "
+"should write:"
msgstr ""
-#. type: Attribute 'alt' of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:78
-msgid "My code keeps failing and I don't know how to debug it."
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:118
+#, no-wrap
+msgid "[!java]int[] T;[/!][!scala]var T:Array[Int][/!]"
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:79
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:120
msgid ""
-"To debug one world after the other and avoid that the messages of all worlds "
-"get intermixed, you can write your debug function only if the method "
-"<code>isSelected()</code> returns true. It will be so only for the entity "
-"that is currently selected in the graphical interface, that is probably the "
-"world you are currently debugging. This will help breaking the difficulty in "
-"parts by debugging the situation on after the other."
+"[!java]<code>int</code> means that the elements of the array are of type "
+"integer; <code>[]</code> means that we are speaking of an array and "
+"<code>T</code> is the name of the variable. For historical reasons, this "
+"can also be written as <code>int T[]</code> (with the [] after the variable "
+"name), but this is less readable and should probably be avoided.[/!] "
+"[!scala]The <code>[Int]</code> notation specializes the Array type (that is "
+"generic), specifying that each cell of this array is an integer. An array of "
+"booleans would simply by written <code>Array[Boolean]</code>.[/!]"
msgstr ""
-#. type: Content of: <p><div>
-#: src/lessons/sort/pancake/GatesPancake.html:85
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:128
+msgid "Allocating an array"
+msgstr ""
+
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:130
msgid ""
-"In particular, it may help to print textually the state of the world each "
-"time you enter the main loop."
+"Declaring a variable <code>T</code> that stores an array only reserve the "
+"<b>name</b> <code>T</code> for later use, but not the memory area to store "
+"the cells. The array is not initialized yet: it does not have any "
+"value. What would <code>[!java]T[4][/!][!scala]T(4)[/!]</code> mean if we "
+"didn't say that the array is 5 cells long?"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/sort/baseball/Main.html:1
-msgid "The Rainbow Baseball Game"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:135
+msgid "First and foremost, we have to give a value to <code>T</code>:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:3
-msgid ""
-"This activity is inspired from the orange game, from the \"Computer Science "
-"Unplugged\" activities repository. It was however heavily since then, first "
-"for the CSIRL (my repository of <i>free</i> unplugged activities to "
-"introduce computer science, available at "
-"http://www.loria.fr/~quinson/Mediation/SMN/) and now for PLM."
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:136
+#, no-wrap
+msgid "[!java]T = new int[10];[/!][!scala]var T = new Array[Int](10)[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:7
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:138
msgid ""
-"In the literature, the generalized form of this problem is known as the "
-"pebble motion problem (the bases can be connected by any kind of graph, and "
-"the affinity of pebbles with bases may be different). Another variant of "
-"this problem is the well known 15-puzzle, with one player per base, and a "
-"two dimensional square grid. Much more information about these problems can "
-"be found on wikipedia, as usual."
+"<code>new</code> means that we want to create something, and "
+"<code>[!java]int[10][/!][!scala]Array[Int](10)[/!]</code> means that it is "
+"an array of 10 integer values. In return, an array of 10 integer cells is "
+"created in memory, and the <code>T</code> variable <b>references</b> this "
+"array."
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/Main.html:12
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:143
msgid ""
-"How do you know that the naive algorithm won't loop on that initial "
-"situation?"
+"The size of an array is fixed and cannot be changed after the creation of "
+"the array. The size of a <code>T</code> array can be retrieve by consulting "
+"the variable <code>T.length</code>."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:14
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:147
msgid ""
-"Well, we simply tested all possible situations to see when this algorithm "
-"loops and when it finds the correct solution. We found that it works for all "
-"situations where no player is at home (there is 84 such situations for 4 "
-"bases, once you take the symmetries into account). It obviously works for "
-"some situations that do not respect this criteria (such as all situations it "
-"encounters from one of those 84 boards to the final state), but that's "
-"another story. Having such a criteria allows us to generate pseudo-random "
-"initial situations for the first exercise for which the algorithm we propose "
-"is guarenteed to work."
+"While allocating, you can specify the size with a variable: "
+"<code>[!java]int[] T = new int[i];[/!][!scala]var T = new "
+"Array[Int](i);[/!]</code> In this case, the array's size will be set to the "
+"value of <code>i</code> <i>when <code>new</code> gets called</i>. The size "
+"of the array still cannot be modified : even if the variable <code>i</code> "
+"changes afterward, the size remains to the value given when it was "
+"allocated. [!java]Also, it is forbidden to write something like <code>int "
+"T[10];</code> when declaring the variable. You are required to use the "
+"<code>new</code> instruction to allocate it, as in <code>int[] T = new "
+"int[10];</code> [/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/Main.html:21
-msgid ""
-"We also explored bigger instances of the problem, and unfortunately, we have "
-"no such criteria for them. With 5 bases, the algorithm wrongly loops for 24 "
-"of the 1824 possible boards where no player is home (that's 1.31%). With 6 "
-"bases, it fails on 1251 of the 58860 such boards (2.12%). With 7 bases, it "
-"fails for 84444 out of 2633940 (that's 3.2%). I am still looking for a "
-"criteria ensuring that the algorithm won't loop. If you discover one, please "
-"report it. Ideally, it would be simple to enforce manually so that we can "
-"use it during our unplugged activities."
+#. type: Content of: <p><p><p><h4>
+#: src/lessons/welcome/array/basics/Array1.html:155
+msgid "Declaration and initialization"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/baseball/Main.html:31
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:156
msgid ""
-"Other graphical representations could be proposed, such as a linear one (for "
-"the existing exercises) or other ones (such as a grid or a tree, if an "
-"exercise on this kind of graph proves interesting)."
+"If you know beforehand the content of your array, you can declare, allocate "
+"and initialize it in one shoot:"
msgstr ""
-#. type: Content of: <ul><li>
-#: src/lessons/sort/baseball/Main.html:33
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:157
+#, no-wrap
msgid ""
-"Other exercises on other algorithms on this variant, or on other variants "
-"such as the 15-puzzle."
+"[!java]int[] T = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };[/!][!scala]var T = "
+"Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)[/!]"
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/short_desc.html:1
-msgid "Rainbow baseball"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:159
+msgid ""
+"To know the size of the array to allocate, the compiler counts the provided "
+"values. This code is equivalent to:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/short_desc.html:3
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:161
+#, no-wrap
msgid ""
-"This is another funny variation on the sorting problem, adapting the main "
-"sorting algorithms on an unusual context."
+"[!java]int[] T = new int[10];\n"
+"T[0] = 1;\n"
+"T[1] = 2;\n"
+"...\n"
+"T[9] = 10;[/!][!scala]var T = new Array[Int](10);\n"
+"T(0) = 1\n"
+"T(1) = 2\n"
+"...\n"
+"T(9) = 10[/!]"
msgstr ""
-#. type: Content of: <h1>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:1
-msgid "Rainbow Baseball"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:171
+msgid "It is also equivalent to:"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:2
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:172
+#, no-wrap
msgid ""
-"The colors are represented by integers, between <code>0</code> and "
-"<code>amount of bases -1</code>. The hole is represented by the special "
-"value <code>-1</code>. The color of each base is its rank. So base "
-"<code>1</code> is of color <code>1</code>. In the graphical interface, the "
-"base <code>0</code> is the dark blue one while the base <code>1</code> is "
-"the fuscia one."
+"[!java]int[] T = new int[10];\n"
+"for (int i=0; i<T.length; i++) {\n"
+" T[i] = i+1;\n"
+"}[/!][!scala]var T = new Array[Int](10);\n"
+"for (i <- 0 to T.length-1) {\n"
+" T(i) = i+1\n"
+"}[/!]"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:8
-msgid ""
-"Once every players on the field are in their home base, the hole should be "
-"in the last base, that is of rank <code>getBasesAmount()-1</code>."
+#. type: Content of: <p><p><p><h3>
+#: src/lessons/welcome/array/basics/Array1.html:183
+msgid "[!python]Lists[/!][!scala|java]Arrays[/!] and method parameters"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:11
-msgid "Functions to retrieve the world's dimensions"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:184
+msgid ""
+"It is perfectly OK to pass [!python]a list[/!][!java|scala]an array[/!] to a "
+"method as a parameter. This method can then use this parameter as if it "
+"were defined locally:"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:13
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:186
#, no-wrap
-msgid "[!java]int [/!]getBasesAmount() [!scala]:Int[/!]"
+msgid ""
+"[!java]boolean has42First(int[] array) {\n"
+" return array[0] == 42;\n"
+"}[/!][!python]def has42First(list):\n"
+" return list[0] == 42[/!][!scala]def has42First(array:Array[Int]):Boolean = "
+"{\n"
+" return array(0) == 42\n"
+"}[/!]"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:14
-msgid "Returns the amount of bases on this field."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:193
+msgid "On the caller side, that also very simple:"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:16
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:194
#, no-wrap
-msgid "[!java]int [/!]getPositionsAmount() [!scala]:Int[/!]"
-msgstr ""
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:17
-msgid "Returns the amount of player's positions per base on this field."
+msgid ""
+"[!java]int[] tab = new int[10];[/!][!scala]var tab = new Array[Int] "
+"(10)[/!][!python]tab = [1, 3, 5, 7, 9][/!]\n"
+"[!java|scala]<span class=\"comment\">// Values initialization "
+"omitted</span>\n"
+"[/!]if (has42First(tab))[!java|scala] {[/!][!python]:[/!]\n"
+" <span class=\"comment\">[!java|scala]//[/!][!python]#[/!] do "
+"something</span>\n"
+"[!java|scala]}[/!]"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:19
-msgid "Functions to retrieve the world's state"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:201
+msgid ""
+"If you want to allocate and initialize the array in one shoot, that's a bit "
+"more complicated as the compiler has to know the type of the parameter you "
+"are creating. For that, use the following (ugly) construct:"
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:21
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:204
#, no-wrap
-msgid "[!java]int [/!]getHoleBase() [!scala]:Int[/!]"
+msgid ""
+"if (has42First( new int[] {1, 3, 5, 7, 9} ) {\n"
+" <span class=\"comment\">// do something</span>\n"
+"}"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:22
-msgid "Returns the base in which the hole is located."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:209
+msgid ""
+"Methods can also return [!java|scala]arrays[/!][!python]lists[/!] as result "
+"without any complication. Here is a method that returns [!java|scala]an "
+"array[/!][!python]a list[/!] of the requested size, filled with 42s."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:24
+#. type: Content of: <p><p><p><pre>
+#: src/lessons/welcome/array/basics/Array1.html:212
#, no-wrap
-msgid "[!java]int [/!]getHolePosition() [!scala]:Int[/!]"
+msgid ""
+"[!java]int[] fill42(int size) {\n"
+" int[] res = new int[size];\n"
+" for (int i=0; i<size; i++) \n"
+" res[i] = 42;\n"
+" return res;\n"
+"}[/!][!scala]def fill42(size:Int):Array[Int] = {\n"
+" var res = new Array[int] (size)\n"
+" for (i <- 0 to size -1) {\n"
+" res(i) = 42;\n"
+" }\n"
+" return res;\n"
+"}[/!][!python]def fill42(size):\n"
+" res = []\n"
+" for i in range(size):\n"
+" res.append(42)\n"
+" return res[/!]"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:25
-msgid "Returns the hole position within its base"
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:231
+msgid "At least! After this long explanation, we can come back to the exercise."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:27
-#, no-wrap
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:232
msgid ""
-"[!java]int [/!]getPlayerColor([!java]int [/!]base[!scala]:Int[/!], "
-"[!java]int [/!]position[!scala]:Int[/!]) [!scala]:Int[/!]"
+"Your mission is rather simple actually. Your code should save the color "
+"pattern observed on the first row into [!java|scala]an array[/!][!python]a "
+"list[/!]. [!python]The easiest is to create an empty list, and then "
+"<code>append()</code> the colors one after the others as you read them (with "
+"<code>getGroundColor()</code>).[/!] [!java|scala]For that, you should "
+"declare and allocate an array of <code>Color</code>. Beware, there is "
+"several worlds, of differing size; use <code>getWorldHeight()</code> to "
+"retrieve the size of the current world. Once the array allocated, fill it "
+"by reading the ground color in each locations (with "
+"<code>getGroundColor()</code>).[/!]"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:28
-msgid "Returns the color of the player at a given location."
+#. type: Content of: <p><p><p><p>
+#: src/lessons/welcome/array/basics/Array1.html:240
+msgid ""
+"Once you managed to read and save the pattern on the first row, you have to "
+"reapply the pattern on every rows, for example by executing "
+"<code>getWorldHeight()</code> times a method written specifically for this."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:30
-#, no-wrap
-msgid "[!java]boolean [/!]isSorted() [!scala]:Boolean[/!]"
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/basics/Array2.html:1
+msgid "[!java|scala]Arrays[/!][!python]Lists[/!], Knotting and Modulos"
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:31
-msgid "Returns whether all players of the field are at home."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:3
+msgid ""
+"This exercise is similar to the previous one: you have to reproduce the "
+"color pattern of the first cell into the other ones."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:33
-#, no-wrap
-msgid "[!java]boolean [/!]isBaseSorted([!java]int [/!]base) [!scala]:Boolean[/!]"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:6
+msgid ""
+"The first difference is that the world is bordered of walls: you thus have "
+"to slightly modify your trajectory to ensure that the buggle does not crash "
+"into a wall. The simpler for that is to handle the first cell out of the "
+"<code>for</code> loop and do only <code>getWorldHeight()-1</code> steps in "
+"the loop."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:34
-msgid "Returns whether all players of a given base are at home."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:12
+msgid ""
+"The other difference is that the offset to apply between columns is not "
+"fixed, but written on the first cell of each column. To get the info as an "
+"integer, we can use:"
msgstr ""
#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:36
+#: src/lessons/welcome/array/basics/Array2.html:16
#, no-wrap
-msgid "[!java]boolean [/!]isSelected() [!scala]:Boolean[/!]"
-msgstr ""
-
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:37
-msgid "Returns whether the current world is selected in the interface."
+msgid ""
+"[!java]int offset = Integer.parseInt(readMessage())[/!][!python]offset = "
+"int( readMessage() )[/!][!scala]val offset = readMessage().toInt[/!]"
msgstr ""
-#. type: Content of: <h2>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:38
-msgid "Functions to change the world"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:18
+msgid ""
+"<code>readMessage()</code> gets the message on the ground as a "
+"[!java|scala]String[/!][!python]string[/!], while "
+"<code>[!java]Integer.parseInt(str)[/!][!scala]str.toInt[/!][!python]int(str)[/!]</code> "
+"transforms the string <code>str</code> into an integer by <i>reading</i> it."
msgstr ""
-#. type: Content of: <pre>
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:40
-#, no-wrap
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:22
msgid ""
-"[!java]void [/!]move([!java]int [/!]base[!scala]:Int[/!], [!java]int "
-"[/!]position[!scala]:Int[/!])"
+"Then, to pick the right color, the easier is to use the <code>%</code> "
+"(modulo) operator. For example, <code>(i + 5) % size</code> allows to "
+"retrieve the <code>i</code>th cell of an array of size <code>size</code> "
+"with an offset of <code>5</code>."
msgstr ""
-#. type: Content of: outside any tag (error?)
-#: src/lessons/sort/baseball/universe/BaseballWorld.html:41
-msgid ""
-"Moves a given player into the hole. This throws an IllegalArgumentException "
-"if the specified player is not near the hole (at most one base away)."
+#. type: Content of: <p>
+#: src/lessons/welcome/array/basics/Array2.html:27
+msgid "You're up."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/NaiveBaseball.html:1
-msgid "Naive Rainbow Baseball"
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:1
+msgid "Searching for a given value"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:3
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:3
msgid ""
-"Today, the buggles decided to play a baseball game, but they are rather out "
-"of luck, actually. First, kinda forgot the rules, and ... well ... they "
-"cannot find the ball and bats again. So they decided to \"adapt a bit\" the "
-"rules. As the are no ball, the buggles can only running around the field, "
-"what they do happily: for a while, all attending buggle run at full speed in "
-"all directions around the field."
+"The goal of this exercise is to search the cell of a given value, and return "
+"its position."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:9
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:5
msgid ""
-"But after a few collisions, they decide to invent new rules to organize a "
-"bit the game: They make one team per base and two players per team. One of "
-"the teams has only one player so that its base has an empty location. Then, "
-"the players are dispatched randomly around the bases, and the game for them "
-"is to reach their home base. The whole game stops when all players are "
-"home. There is no winning team: either all players win, or they all "
-"lose. Actually, this game is very different from the original baseball. The "
-"only rule that remains is that you can only run around the field, from one "
-"base to the next one, without crossing middle of the field."
+"To that extend, you should fill the method <code>indexOf()</code>, which "
+"parameters are the array to explore, and the value to search. If the value "
+"<code>lookingFor</code> is not in the array <code>tab</code>, the method "
+"should return -1."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:17
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:9
msgid ""
-"Now, they are asking you to help them deciding who and when should move so "
-"that each player returns to its base. Only one buggle can move at each "
-"round, from its position to the empty spot. The maximal distance that a "
-"buggle can cover in one round is of one base."
+"The idea of the algorithm is to sweep over the whole array, checking the "
+"value of each cell. If it's the searched value, you should return the index "
+"of the cell currently checked."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:21
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:13
msgid ""
-"So, at each round, the empty spot is on one base (say <code>B</code>), and "
-"you should decide which buggle enters that empty spot. There is four "
-"candidates (two from base <code>B-1</code> and two from base "
-"<code>B+1</code>). Actually, there is a fifth candidate since the buggle "
-"that is on the same base than the empty spot can change its position, but "
-"that's not really helping."
+"Remember that indices begin at 0 and not at 1. So, if there is 3 cells, "
+"their indices will be 0, 1 and 2. There would not be any cell numbered 3."
msgstr ""
-#. type: Content of: <h3>
-#: src/lessons/sort/baseball/NaiveBaseball.html:26
-msgid "The Naïve algorithm"
+#. type: Content of: <p>
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:16
+msgid ""
+"Remember also that the amount of cells in an array can be retrieved using "
+"the <code>length</code> attribute. So, if your array is called "
+"<code>tab</code>, its size can be retrieved as <code>tab.length</code>. "
+"Note that there is no () after <code>length</code>. An attribute is a sort "
+"of variable embedded in another object (here, the array)."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:28
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:21
+msgid "So, the last value of an array is given by <code>tab[tab.length - 1]</code>."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:23
msgid ""
-"In this exercise, we will first explore a very simple algorithm. To decide "
-"which of the four candidate buggles should enter the empty spot, we first "
-"restrict ourselves and decide that buggles can only turn clockwise. Then, "
-"from the two remaining candidates, we pick the one that has the largest "
-"distance to cover to reach its base (turning clockwise). Click on the demo "
-"button: this works rather well in practice."
+"Remember also that the amount of cells in an array can be retrieved with the "
+"<code>len()</code> function. So, if your array is called <code>tab</code>, "
+"its size can be retrieved as <code>len(tab)</code>."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:34
+#: src/lessons/welcome/array/indexof/value/IndexOfValue.html:27
+msgid "So, the last value of an array is given by <code>tab[ len(tab) - 1]</code>."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:1
+msgid "Index of the maximum value"
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:3
msgid ""
-"It's hard to find a simpler algorithm for this problem: While it's not "
-"sorted, search for the base containing the candidate buggles: if the hole is "
-"in base <code>B</code>, it's the base <code>B+1</code>, modulo the amount of "
-"bases. Then, compute the distance that each buggle of that base still has to "
-"run to reach its base (0 if it's already home). Once you found the buggle "
-"that should enter the empty spot, just use the <code>move</code> method on "
-"it, and iterate."
+"In this exercise, you must compute the index of the tab cell containing the "
+"biggest value."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/NaiveBaseball.html:40
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:5
msgid ""
-"The main difficulty should be to get the few equations right: determining "
-"the base next to the hole should be easy, but determining the distance that "
-"a player has to cover may reveal a bit more challenging. Don't hesitate to "
-"draw pictures on a paper to cover all possible cases. It should not be that "
-"difficult either: there is not that many cases after all."
+"For that, fill the <code>indexOfMaximum()</code> method. Its parameter is "
+"the array to explore. Should the array contain the searched value several "
+"times, you should return the index of the first occurrence."
+msgstr ""
+
+#. type: Content of: <p>
+#: src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html:9
+msgid ""
+"To solve this exercise, you should sweep over the whole array. For each "
+"value, if it's bigger than the biggest value you saw so far, you must save "
+"this new champion and its position. You will thus need 2 extra variables; "
+"the initial value of the champion could be the value of the first cell."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/SelectBaseball.html:1
-msgid "Selection Baseball"
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:1
+msgid "Average value"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:3
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:4
msgid ""
-"The previous algorithm is very pleasant: it's rather simple and rather fast "
-"to implement, but unfortunately, it is also rather wrong! In some cases, it "
-"never stops, which is obviously bad. If you don't believe it, just copy "
-"paste your previous code, and hit the run button. The first world of this "
-"exercise is one of these unfortunate situations that drives our previous "
-"algorithm crazy."
+"The objective of this exercise is to compute the average value of the "
+"integer values stored in an array."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:9
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:6
msgid ""
-"So we have to find another algorithm, preferably one that works in all "
-"cases."
+"You have to fill the body of the method <code>average()</code> which takes "
+"as parameter the array of integers of which it computes and returns the "
+"average value. Please note that this method must return an integer."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:11
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:8
msgid ""
-"For that, the best solution is to start from a well known algorithm instead "
-"of trying to invent a new one from scratch as we just did. When you think a "
-"bit about this problem, this can is very similar to a sorting problem: Just "
-"make sure that the players are sorted by their colors and you're set. And "
-"while we are at it, let's generalize the game to allow more that 4 bases."
+"To compute the average value of an integer, it is necessary to traverse the "
+"whole array and to compute the sum of all its values (so you will need a "
+"variable to store this temporary result), then you have to divide this sum "
+"by the size of the array."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:17
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:10
msgid ""
-"Let's adapt the selection sort to our situation. The big lines of the "
-"algorithm is then \"for each base, select the players that should occupy "
-"this base and make sure that they come to their position\". This way, we "
-"will grow an sorted area where all players are already sorted (and never "
-"changed) while the unsorted area shrinks."
+"In Java, you can get the size of an array <code>myarray</code> by consulting "
+"its <code>length</code> attribute (in other words, "
+"<code>myarray.length</code>). Notice that there is no parenthesis after "
+"<code>length</code>."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:23
+#: src/lessons/welcome/array/averagevalue/AverageValue.html:15
msgid ""
-"Selecting the player should be no problem; Do not hesitate to define some "
-"methods such as <code>findPlayer()</code> or "
-"<code>findPlayerBase()</code>. This will ensure that your code remains "
-"understandable."
+"In python, retrieving the size of an array <code>myarray</code> is as easy "
+"as calling <code>len(myarray)</code>."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:1
+msgid "Maximal value"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:27
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:3
msgid ""
-"The most problematic aspect is to move the selected players into "
-"position. For that, you have to move the hole to the position where the "
-"player is, and then move both the player and the hole to the base that is "
-"next to the player's goal (probably in a loop), and finally put the player "
-"in the right position of its target base."
+"In this exercise, you must compute the maximal value contained in an array. "
+"For that, fill the <code>maximum()</code> method, which parameter is the "
+"array to explore."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/SelectBaseball.html:32
+#: src/lessons/welcome/array/maxvalue/MaxValue.html:7
msgid ""
-"As often in programming, the devil is in the details: there is a bunch of "
-"corner cases that you should detect and deal with correctly, such as the "
-"cases where the player is already in the base (but not in the position that "
-"you would like), or when the hole is on the right of the player (probably "
-"when you sort the first base). But you will find and hunt these while "
-"debugging your code."
+"To compute this value, sweep over the whole parameter. For each value, if "
+"it's bigger than the biggest value you saw so far, you must save this value "
+"somewhere to remember it afterward. You thus need an extra variable, which "
+"can be initialized to the value of the first array cell."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/InsertBaseball.html:1
-msgid "Insertion Baseball"
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:1
+msgid "Occurrence of a value"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:3
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:3
msgid ""
-"The good point of adapting the selection sort to the baseball problem is "
-"that we know that it works (provided that our adaptation is correct). That's "
-"much better than the first naive algorithm, that was unable to converge to "
-"the solution in some situations. But actually, the selection sort is not "
-"perfect either as it requires a lot of swaps: we have to bring the hole to "
-"the selected player and then both the player and hole in position, and "
-"more. We can do better."
+"In this exercise, you must compute the amount of occurrences of a given "
+"value in an array (that is, the amount of time that this value appears in "
+"the array). For that, fill the <code>occurrences()</code> method, which "
+"returns the number of occurrence of <code>lookingFor</code> in "
+"<code>tab</code>."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:9
+#: src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html:8
msgid ""
-"For example, each player can run quite a long way from its initial position "
-"to its target solution. Instead, it may be more interesting to split the "
-"field in two parts: one on the left where all players are sorted relatively "
-"to each others, and one on the right where the players are still at their "
-"initial positions. Then, at each iteration, we take the player at the border "
-"between the sorted and unsorted areas (that is, the left-most player of the "
-"unsorted area) and move it to the left (within the sorted area) until it "
-"reaches its position (that is, until the position where it's bigger that its "
-"left neighbor). This would at least reduce the travel of players to the "
-"sorted area as we use the first one on the border."
+"To compute this value, simply sweep over the array counting for the amount "
+"of cells containing the searched value. You thus need an extra variable for "
+"that."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:18
-msgid ""
-"Actually, that's exactly what an insertion sort would do: maintain a sorted "
-"area on the left, and put iteratively the player on the border to its "
-"position within the sorted area. This is good, as we know that our algorithm "
-"is not inherently flawed since we adapt a well known one."
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/array123/Array123.html:1
+msgid "Array123"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:22
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/array123/Array123.html:2
msgid ""
-"The easiest to adapt the insertion sort to the baseball problem is to "
-"consider all positions as adjacent and forget about bases. For that, we "
-"define the methods <code>getColor(pos)</code>, <code>move(pos)</code> and "
-"<code>getHole()</code> that all use a unique integer to designate a given "
-"position. These functions simply convert between the way to specify a "
-"position and then call the usual functions to interact with the world. If "
-"you have an <code>index</code> and want to convert it into a "
-"<code>base,pos</code>, then <code>base=index/2</code> and "
-"<code>pos=index%2</code>. To compute the reverse, "
-"<code>index=base*2+pos</code> (this works because "
-"<code>getPositionsAmount()</code> always returns 2)."
+"Given an array of integers, return true if .. 1, 2, 3, .. appears in the "
+"array somewhere."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:31
-msgid ""
-"For the algorithm itself, you should first move the hole to the position "
-"1. The position 0 is considered to be the sorted area (of size 1 for now) "
-"while the area above 2 is the unsorted area. Then comes an iteration to "
-"sort each element of the unsorted area. Since this iteration is a bit "
-"complex, you should think of its loop invariant, that is, the condition that "
-"is true before and after the loop and which explains that the loop fulfills "
-"its goal. Here, the loop invariant is twofold: First, the hole is between "
-"the sorted area and the unsorted area, and then, the every elements of the "
-"sorted area are ... well sorted relatively to their neighbors."
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/array667/Array667.html:1
+msgid "Array667"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:39
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/array667/Array667.html:2
msgid ""
-"Then, the loop body to sort an element should first descend the hole and the "
-"elements within the sorted area until the element is larger than the element "
-"before in the sorted area (2 moves per position to travel), and then move "
-"the hole back to its position between the sorted and unsorted areas (1 move "
-"per position)."
+"Given an array of integers, return the number of times that two 6's are next "
+"to each other in the array. Also count instances where the second \"6\" is "
+"actually a 7."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/InsertBaseball.html:43
-msgid ""
-"Once you insert the last element within the sorted area, your whole set is "
-"sorted and you're done. I preserve the surprise of the border cases that "
-"will require some little adjustments to your algorithm to make it work "
-"properly :)"
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:1
+msgid "ArrayCount9"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/arraycount9/ArrayCount9.html:2
+msgid "Given an array of integers, return the number of 9's in the array."
msgstr ""
#. type: Content of: <h1>
-#: src/lessons/sort/baseball/BubbleBaseball.html:1
-msgid "Bubble Baseball"
+#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:1
+msgid "ArrayFront9"
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:3
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/arrayfront9/ArrayFront9.html:2
msgid ""
-"Crap, we adapted the insertion sort because our selection sort required too "
-"much moves to get the selected players to their position, but the insertion "
-"sort requires an inordinate amount of changes to get the border elements to "
-"their position within the sorted area without mixing the already sorted "
-"elements. At the end of the day, our selection variant was more efficient "
-"with at most <code>3*amountOfBase</code> moves to sort one element (1 to get "
-"the hole alongside with the player, and 2 to get the hole+player in "
-"position) while our insertion variant requires at most "
-"<code>3*amountOfPlayers</code> to sort one element (2 to descend the hole "
-"and player in position, 1 to get the hole back to its position). That's "
-"twice as bad as there is two players per base. It may be possible to improve "
-"the insertion sort by moving by more than one element when descending, but "
-"it seems uneasy (at least, while not mixing the already sorted elements) and "
-"it would probably only ensure that our insertion variant becomes as "
-"efficient as our selection variant, not dramatically better."
+"Given an array of integers, return true if one of the first 4 elements in "
+"the array is a 9. The array length may be less than 4."
msgstr ""
-#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:15
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/notriples/NoTriples.html:1
+msgid "NoTriples"
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: src/lessons/welcome/array/notriples/NoTriples.html:2
msgid ""
-"If we cannot make the sort faster, we can make it easier. If you think about "
-"it, it seems rather natural to adapt the bubble sort to this problem: the "
-"hole becomes the bubble that moves up and down, sorting a bit the array "
-"during each traversal. The big lines are simply: \"while it's not sorted, "
-"move the hole down to base 0 (moving the biggest player of each base at each "
-"step) and then back to the maximal base (moving the smallest player of each "
-"base)\". After a while, <code>isSorted()</code> will return true and your "
-"algorithm will stop."
+"Given an array of integers, we'll say that a triple is a value appearing 3 "
+"times in a row in the array. Return true if the array does not contain any "
+"triples."
+msgstr ""
+
+#. type: Content of: <h1>
+#: src/lessons/welcome/array/has271/Has271.html:1
+msgid "Has271"
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:21
+#: src/lessons/welcome/array/has271/Has271.html:2
msgid ""
-"This is so easy that we introduce another variant of the problem, with more "
-"than two players per base. But actually, that shouldn't block you very "
-"long, should it?"
+"Given an array of integers, return true if it contains a 2, 7, 1 pattern -- "
+"a value, followed by the value plus 5, followed by the initial value minus "
+"1. So, 2,7,1 is such a pattern because 7 is 5+2 and 1 is 2-1. 3,8,2 is also "
+"such a pattern."
msgstr ""
#. type: Content of: <p>
-#: src/lessons/sort/baseball/BubbleBaseball.html:24
+#: src/lessons/welcome/array/has271/Has271.html:6
msgid ""
-"Surprisingly, the bubble sort variant requires ways less moves than the "
-"other variants. This is astonishing because usually, the bubble sort "
-"performs much worse than the others sorts, but it comes from the very good "
-"match between its big lines and the baseball universe. It actually happens "
-"rather often that a pleasantly written algorithm performs very decently. But "
-"this is not an universal rule either, as demonstrated by the naive algorithm "
-"of the first exercise, that was nice, simple and wrong ;)"
+"Additionally the 271 counts even if the \"1\" differs by 2 or less from the "
+"correct value."
msgstr ""
#. type: Content of: <h3>
@@ -10480,7 +10888,7 @@ msgid ""
msgstr ""
#. type: Content of: <p>
-#: src/lessons/turtleart/short_desc.html:4
+#: src/lessons/turtleart/short_desc.html:5
msgid ""
"You should know the basic syntax of the programming language you will "
"choose, but no exhaustive programming practice is required to take this "
diff --git a/lib/resources/plm.configuration.properties b/lib/resources/plm.configuration.properties
index c41b551..284b3f9 100644
--- a/lib/resources/plm.configuration.properties
+++ b/lib/resources/plm.configuration.properties
@@ -1,7 +1,7 @@
-#Mon, 16 Sep 2013 22:13:15 +0200
+#Fri, 11 Oct 2013 11:29:18 +0200
# PLM default configuration
-plm.major.version=2.2.7
-plm.minor.version=20130930
+plm.major.version=2.3beta
+plm.minor.version=20131015
# This should be self explanatory, actually
# Its value is automatically updated and saved in the personal property file
diff --git a/po4a.conf b/po4a.conf
index db48932..e33fe28 100644
--- a/po4a.conf
+++ b/po4a.conf
@@ -5,9 +5,10 @@
[type: html] lib/doc/MainWindow.html $lang:lib/doc/MainWindow.$lang.html
-[type: html] src/plm/universe/sort/SortingWorld.html $lang:src/plm/universe/sort/SortingWorld.$lang.html
-[type: html] src/plm/universe/turtles/TurtleWorld.html $lang:src/plm/universe/turtles/TurtleWorld.$lang.html
+[type: html] src/plm/universe/sort/SortingWorld.html $lang:src/plm/universe/sort/SortingWorld.$lang.html
+[type: html] src/plm/universe/turtles/TurtleWorld.html $lang:src/plm/universe/turtles/TurtleWorld.$lang.html
[type: html] src/plm/universe/bugglequest/BuggleWorld.html $lang:src/plm/universe/bugglequest/BuggleWorld.$lang.html
+[type: html] src/plm/universe/bat/BatWorld.html $lang:src/plm/universe/bat/BatWorld.$lang.html
[type: html] src/lessons/backtracking/Main.html $lang:src/lessons/backtracking/Main.$lang.html
@@ -40,16 +41,16 @@
[type: html] src/lessons/welcome/methods/picture/PictureMono2.html $lang:src/lessons/welcome/methods/picture/PictureMono2.$lang.html
[type: html] src/lessons/welcome/methods/picture/PictureMono3.html $lang:src/lessons/welcome/methods/picture/PictureMono3.$lang.html
[type: html] src/lessons/welcome/methods/returning/MethodsReturning.html $lang:src/lessons/welcome/methods/returning/MethodsReturning.$lang.html
-[type: html] src/lessons/welcome/methods/args/MethodsArgs.html $lang:src/lessons/welcome/methods/args/MethodsArgs.$lang.html
+[type: html] src/lessons/welcome/methods/args/MethodsArgs.html $lang:src/lessons/welcome/methods/args/MethodsArgs.$lang.html
-[type: html] src/lessons/welcome/methods/flowerpot/FlowerPot.html $lang:src/lessons/welcome/methods/flowerpot/FlowerPot.$lang.html
-[type: html] src/lessons/welcome/methods/flowerpot/FlowerCase.html $lang:src/lessons/welcome/methods/flowerpot/FlowerCase.$lang.html
-[type: html] src/lessons/welcome/methods/picture/MethodsPicture.html $lang:src/lessons/welcome/methods/picture/MethodsPicture.$lang.html
+[type: html] src/lessons/welcome/methods/flowerpot/FlowerPot.html $lang:src/lessons/welcome/methods/flowerpot/FlowerPot.$lang.html
+[type: html] src/lessons/welcome/methods/flowerpot/FlowerCase.html $lang:src/lessons/welcome/methods/flowerpot/FlowerCase.$lang.html
+[type: html] src/lessons/welcome/methods/picture/MethodsPicture.html $lang:src/lessons/welcome/methods/picture/MethodsPicture.$lang.html
[type: html] src/lessons/welcome/methods/picture/MethodsPictureLarge.html $lang:src/lessons/welcome/methods/picture/MethodsPictureLarge.$lang.html
-[type: html] src/lessons/welcome/methods/picture/PatternPicture.html $lang:src/lessons/welcome/methods/picture/PatternPicture.$lang.html
-[type: html] src/lessons/welcome/methods/slug/SlugHunting.html $lang:src/lessons/welcome/methods/slug/SlugHunting.$lang.html
-[type: html] src/lessons/welcome/methods/slug/SlugTracking.html $lang:src/lessons/welcome/methods/slug/SlugTracking.$lang.html
-[type: html] src/lessons/welcome/methods/slug/SlugSnail.html $lang:src/lessons/welcome/methods/slug/SlugSnail.$lang.html
+[type: html] src/lessons/welcome/methods/picture/PatternPicture.html $lang:src/lessons/welcome/methods/picture/PatternPicture.$lang.html
+[type: html] src/lessons/welcome/methods/slug/SlugHunting.html $lang:src/lessons/welcome/methods/slug/SlugHunting.$lang.html
+[type: html] src/lessons/welcome/methods/slug/SlugTracking.html $lang:src/lessons/welcome/methods/slug/SlugTracking.$lang.html
+[type: html] src/lessons/welcome/methods/slug/SlugSnail.html $lang:src/lessons/welcome/methods/slug/SlugSnail.$lang.html
[type: html] src/lessons/welcome/bdr/BDR.html $lang:src/lessons/welcome/bdr/BDR.$lang.html
[type: html] src/lessons/welcome/bdr/BDR2.html $lang:src/lessons/welcome/bdr/BDR2.$lang.html
@@ -70,28 +71,52 @@
[type: html] src/lessons/sort/basic/Main.html $lang:src/lessons/sort/basic/Main.$lang.html
[type: html] src/lessons/sort/basic/short_desc.html $lang:src/lessons/sort/basic/short_desc.$lang.html
-[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort1.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort1.$lang.html
-[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort2.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort2.$lang.html
-[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort3.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort3.$lang.html
+[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort1.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort1.$lang.html
+[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort2.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort2.$lang.html
+[type: html] src/lessons/sort/basic/bubble/AlgBubbleSort3.html $lang:src/lessons/sort/basic/bubble/AlgBubbleSort3.$lang.html
[type: html] src/lessons/sort/basic/cocktail/AlgCocktailSort1.html $lang:src/lessons/sort/basic/cocktail/AlgCocktailSort1.$lang.html
[type: html] src/lessons/sort/basic/cocktail/AlgCocktailSort2.html $lang:src/lessons/sort/basic/cocktail/AlgCocktailSort2.$lang.html
[type: html] src/lessons/sort/basic/cocktail/AlgCocktailSort3.html $lang:src/lessons/sort/basic/cocktail/AlgCocktailSort3.$lang.html
[type: html] src/lessons/sort/basic/insertion/AlgInsertionSort.html $lang:src/lessons/sort/basic/insertion/AlgInsertionSort.$lang.html
-[type: html] src/lessons/sort/basic/shell/AlgShellSort.html $lang:src/lessons/sort/basic/shell/AlgShellSort.$lang.html
+[type: html] src/lessons/sort/basic/shell/AlgShellSort.html $lang:src/lessons/sort/basic/shell/AlgShellSort.$lang.html
[type: html] src/lessons/sort/basic/selection/AlgSelectionSort.html $lang:src/lessons/sort/basic/selection/AlgSelectionSort.$lang.html
-[type: html] src/lessons/sort/basic/comb/AlgCombSort.html $lang:src/lessons/sort/basic/comb/AlgCombSort.$lang.html
-[type: html] src/lessons/sort/basic/comb/AlgCombSort11.html $lang:src/lessons/sort/basic/comb/AlgCombSort11.$lang.html
-[type: html] src/lessons/sort/basic/gnome/AlgGnomeSort.html $lang:src/lessons/sort/basic/gnome/AlgGnomeSort.$lang.html
+[type: html] src/lessons/sort/basic/comb/AlgCombSort.html $lang:src/lessons/sort/basic/comb/AlgCombSort.$lang.html
+[type: html] src/lessons/sort/basic/comb/AlgCombSort11.html $lang:src/lessons/sort/basic/comb/AlgCombSort11.$lang.html
+[type: html] src/lessons/sort/basic/gnome/AlgGnomeSort.html $lang:src/lessons/sort/basic/gnome/AlgGnomeSort.$lang.html
+
+[type: html] src/lessons/sort/dutchflag/Main.html $lang:src/lessons/sort/dutchflag/Main.$lang.html
+[type: html] src/lessons/sort/dutchflag/short_desc.html $lang:src/lessons/sort/dutchflag/short_desc.$lang.html
+[type: html] src/lessons/sort/dutchflag/DutchFlagAlgo.html $lang:src/lessons/sort/dutchflag/DutchFlagAlgo.$lang.html
+[type: html] src/lessons/sort/dutchflag/universe/DutchFlagWorld.html $lang:src/lessons/sort/dutchflag/universe/DutchFlagWorld.$lang.html
+
+[type: html] src/lessons/sort/pancake/universe/PancakeWorld.html $lang:src/lessons/sort/pancake/universe/PancakeWorld.$lang.html
+[type: html] src/lessons/sort/pancake/Main.html $lang:src/lessons/sort/pancake/Main.$lang.html
+[type: html] src/lessons/sort/pancake/short_desc.html $lang:src/lessons/sort/pancake/short_desc.$lang.html
+[type: html] src/lessons/sort/pancake/BasicPancake.html $lang:src/lessons/sort/pancake/BasicPancake.$lang.html
+[type: html] src/lessons/sort/pancake/BurnedPancake.html $lang:src/lessons/sort/pancake/BurnedPancake.$lang.html
+[type: html] src/lessons/sort/pancake/GatesPancake.html $lang:src/lessons/sort/pancake/GatesPancake.$lang.html
+
+[type: html] src/lessons/sort/baseball/Main.html $lang:src/lessons/sort/baseball/Main.$lang.html
+[type: html] src/lessons/sort/baseball/short_desc.html $lang:src/lessons/sort/baseball/short_desc.$lang.html
+[type: html] src/lessons/sort/baseball/universe/BaseballWorld.html $lang:src/lessons/sort/baseball/universe/BaseballWorld.$lang.html
+[type: html] src/lessons/sort/baseball/NaiveBaseball.html $lang:src/lessons/sort/baseball/NaiveBaseball.$lang.html
+[type: html] src/lessons/sort/baseball/SelectBaseball.html $lang:src/lessons/sort/baseball/SelectBaseball.$lang.html
+[type: html] src/lessons/sort/baseball/InsertBaseball.html $lang:src/lessons/sort/baseball/InsertBaseball.$lang.html
+[type: html] src/lessons/sort/baseball/BubbleBaseball.html $lang:src/lessons/sort/baseball/BubbleBaseball.$lang.html
-[type: html] src/lessons/recursion/Main.html $lang:src/lessons/recursion/Main.$lang.html
-[type: html] src/lessons/recursion/short_desc.html $lang:src/lessons/recursion/short_desc.$lang.html
+[type: html] src/lessons/recursion/Main.html $lang:src/lessons/recursion/Main.$lang.html
+[type: html] src/lessons/recursion/short_desc.html $lang:src/lessons/recursion/short_desc.$lang.html
[type: html] src/lessons/recursion/square/FourSquare.html $lang:src/lessons/recursion/square/FourSquare.$lang.html
[type: html] src/lessons/recursion/polygonfractal/PolygonFractal.html $lang:src/lessons/recursion/polygonfractal/PolygonFractal.$lang.html
-[type: html] src/lessons/recursion/koch/Koch.html $lang:src/lessons/recursion/koch/Koch.$lang.html
-[type: html] src/lessons/recursion/tree/Tree.html $lang:src/lessons/recursion/tree/Tree.$lang.html
-[type: html] src/lessons/recursion/sierpinski/Sierpinski.html $lang:src/lessons/recursion/sierpinski/Sierpinski.$lang.html
-[type: html] src/lessons/recursion/spiral/Spiral.html $lang:src/lessons/recursion/spiral/Spiral.$lang.html
-[type: html] src/lessons/recursion/spiral/SpiralUse.html $lang:src/lessons/recursion/spiral/SpiralUse.$lang.html
+[type: html] src/lessons/recursion/koch/Koch.html $lang:src/lessons/recursion/koch/Koch.$lang.html
+[type: html] src/lessons/recursion/koch/SquareKoch.html $lang:src/lessons/recursion/koch/SquareKoch.$lang.html
+[type: html] src/lessons/recursion/koch/PentaKoch.html $lang:src/lessons/recursion/koch/PentaKoch.$lang.html
+[type: html] src/lessons/recursion/koch/HexaKoch.html $lang:src/lessons/recursion/koch/HexaKoch.$lang.html
+[type: html] src/lessons/recursion/koch/Crab.html $lang:src/lessons/recursion/koch/Crab.$lang.html
+[type: html] src/lessons/recursion/tree/Tree.html $lang:src/lessons/recursion/tree/Tree.$lang.html
+[type: html] src/lessons/recursion/sierpinski/Sierpinski.html $lang:src/lessons/recursion/sierpinski/Sierpinski.$lang.html
+[type: html] src/lessons/recursion/spiral/Spiral.html $lang:src/lessons/recursion/spiral/Spiral.$lang.html
+[type: html] src/lessons/recursion/spiral/SpiralUse.html $lang:src/lessons/recursion/spiral/SpiralUse.$lang.html
[type: html] src/lessons/recursion/dragoncurve/DragonCurve1.html $lang:src/lessons/recursion/dragoncurve/DragonCurve1.$lang.html
[type: html] src/lessons/recursion/dragoncurve/DragonCurve2.html $lang:src/lessons/recursion/dragoncurve/DragonCurve2.$lang.html
@@ -100,14 +125,14 @@
[type: html] src/lessons/recursion/hanoi/HanoiBoard.html $lang:src/lessons/recursion/hanoi/HanoiBoard.$lang.html
[type: html] src/lessons/recursion/hanoi/universe/HanoiWorld.html $lang:src/lessons/recursion/hanoi/universe/HanoiWorld.$lang.html
-[type: html] src/lessons/maze/Main.html $lang:src/lessons/maze/Main.$lang.html
-[type: html] src/lessons/maze/short_desc.html $lang:src/lessons/maze/short_desc.$lang.html
-[type: html] src/lessons/maze/randommouse/RandomMouseMaze.html $lang:src/lessons/maze/randommouse/RandomMouseMaze.$lang.html
+[type: html] src/lessons/maze/Main.html $lang:src/lessons/maze/Main.$lang.html
+[type: html] src/lessons/maze/short_desc.html $lang:src/lessons/maze/short_desc.$lang.html
+[type: html] src/lessons/maze/randommouse/RandomMouseMaze.html $lang:src/lessons/maze/randommouse/RandomMouseMaze.$lang.html
[type: html] src/lessons/maze/wallfollower/WallFollowerMaze.html $lang:src/lessons/maze/wallfollower/WallFollowerMaze.$lang.html
-[type: html] src/lessons/maze/pledge/PledgeMaze.html $lang:src/lessons/maze/pledge/PledgeMaze.$lang.html
-[type: html] src/lessons/maze/island/IslandMaze.html $lang:src/lessons/maze/island/IslandMaze.$lang.html
-[type: html] src/lessons/maze/shortestpath/ShortestPathMaze.html $lang:src/lessons/maze/shortestpath/ShortestPathMaze.$lang.html
-[type: html] src/lessons/maze/wallfindfollow/WallFindFollowMaze.html $lang:src/lessons/maze/wallfindfollow/WallFindFollowMaze.$lang.html
+[type: html] src/lessons/maze/pledge/PledgeMaze.html $lang:src/lessons/maze/pledge/PledgeMaze.$lang.html
+[type: html] src/lessons/maze/island/IslandMaze.html $lang:src/lessons/maze/island/IslandMaze.$lang.html
+[type: html] src/lessons/maze/shortestpath/ShortestPathMaze.html $lang:src/lessons/maze/shortestpath/ShortestPathMaze.$lang.html
+[type: html] src/lessons/maze/wallfindfollow/WallFindFollowMaze.html $lang:src/lessons/maze/wallfindfollow/WallFindFollowMaze.$lang.html
[type: html] src/plm/universe/lightbot/LightBotWorld.html $lang:src/plm/universe/lightbot/LightBotWorld.$lang.html
[type: html] src/lessons/lightbot/Main.html $lang:src/lessons/lightbot/Main.$lang.html
@@ -168,7 +193,6 @@
[type: html] src/lessons/welcome/bat/bool2/TwoAsOne.html $lang:src/lessons/welcome/bat/bool2/TwoAsOne.$lang.html
[type: html] src/lessons/welcome/bat/bool2/WithoutDoubles.html $lang:src/lessons/welcome/bat/bool2/WithoutDoubles.$lang.html
-[type: html] src/plm/universe/bat/BatWorld.html $lang:src/plm/universe/bat/BatWorld.$lang.html
[type: html] src/lessons/bat/string1/Main.html $lang:src/lessons/bat/string1/Main.$lang.html
[type: html] src/lessons/bat/string1/short_desc.html $lang:src/lessons/bat/string1/short_desc.$lang.html
@@ -182,34 +206,20 @@
[type: html] src/lessons/bat/string1/StringX.html $lang:src/lessons/bat/string1/StringX.$lang.html
[type: html] src/lessons/bat/string1/StringYak.html $lang:src/lessons/bat/string1/StringYak.$lang.html
-[type: html] src/lessons/welcome/array/basics/Array1.html $lang:src/lessons/welcome/array/basics/Array1.$lang.html
-[type: html] src/lessons/welcome/array/basics/Array2.html $lang:src/lessons/welcome/array/basics/Array2.$lang.html
-[type: html] src/lessons/welcome/array/indexof/value/IndexOfValue.html $lang:src/lessons/welcome/array/indexof/value/IndexOfValue.$lang.html
-[type: html] src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html $lang:src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.$lang.html
-[type: html] src/lessons/welcome/array/averagevalue/AverageValue.html $lang:src/lessons/welcome/array/averagevalue/AverageValue.$lang.html
-[type: html] src/lessons/welcome/array/maxvalue/MaxValue.html $lang:src/lessons/welcome/array/maxvalue/MaxValue.$lang.html
-[type: html] src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html $lang:src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.$lang.html
-[type: html] src/lessons/welcome/array/array123/Array123.html $lang:src/lessons/welcome/array/array123/Array123.$lang.html
-[type: html] src/lessons/welcome/array/array667/Array667.html $lang:src/lessons/welcome/array/array667/Array667.$lang.html
-[type: html] src/lessons/welcome/array/arraycount9/ArrayCount9.html $lang:src/lessons/welcome/array/arraycount9/ArrayCount9.$lang.html
-[type: html] src/lessons/welcome/array/arrayfront9/ArrayFront9.html $lang:src/lessons/welcome/array/arrayfront9/ArrayFront9.$lang.html
-[type: html] src/lessons/welcome/array/notriples/NoTriples.html $lang:src/lessons/welcome/array/notriples/NoTriples.$lang.html
-[type: html] src/lessons/welcome/array/has271/Has271.html $lang:src/lessons/welcome/array/has271/Has271.$lang.html
-
-[type: html] src/lessons/sort/pancake/universe/PancakeWorld.html $lang:src/lessons/sort/pancake/universe/PancakeWorld.$lang.html
-[type: html] src/lessons/sort/pancake/Main.html $lang:src/lessons/sort/pancake/Main.$lang.html
-[type: html] src/lessons/sort/pancake/short_desc.html $lang:src/lessons/sort/pancake/short_desc.$lang.html
-[type: html] src/lessons/sort/pancake/BasicPancake.html $lang:src/lessons/sort/pancake/BasicPancake.$lang.html
-[type: html] src/lessons/sort/pancake/BurnedPancake.html $lang:src/lessons/sort/pancake/BurnedPancake.$lang.html
-[type: html] src/lessons/sort/pancake/GatesPancake.html $lang:src/lessons/sort/pancake/GatesPancake.$lang.html
+[type: html] src/lessons/welcome/array/basics/Array1.html $lang:src/lessons/welcome/array/basics/Array1.$lang.html
+[type: html] src/lessons/welcome/array/basics/Array2.html $lang:src/lessons/welcome/array/basics/Array2.$lang.html
+[type: html] src/lessons/welcome/array/indexof/value/IndexOfValue.html $lang:src/lessons/welcome/array/indexof/value/IndexOfValue.$lang.html
+[type: html] src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.html $lang:src/lessons/welcome/array/indexof/maxvalue/IndexOfMaxValue.$lang.html
+[type: html] src/lessons/welcome/array/averagevalue/AverageValue.html $lang:src/lessons/welcome/array/averagevalue/AverageValue.$lang.html
+[type: html] src/lessons/welcome/array/maxvalue/MaxValue.html $lang:src/lessons/welcome/array/maxvalue/MaxValue.$lang.html
+[type: html] src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.html $lang:src/lessons/welcome/array/occurenceofvalue/OccurrenceOfValue.$lang.html
+[type: html] src/lessons/welcome/array/array123/Array123.html $lang:src/lessons/welcome/array/array123/Array123.$lang.html
+[type: html] src/lessons/welcome/array/array667/Array667.html $lang:src/lessons/welcome/array/array667/Array667.$lang.html
+[type: html] src/lessons/welcome/array/arraycount9/ArrayCount9.html $lang:src/lessons/welcome/array/arraycount9/ArrayCount9.$lang.html
+[type: html] src/lessons/welcome/array/arrayfront9/ArrayFront9.html $lang:src/lessons/welcome/array/arrayfront9/ArrayFront9.$lang.html
+[type: html] src/lessons/welcome/array/notriples/NoTriples.html $lang:src/lessons/welcome/array/notriples/NoTriples.$lang.html
+[type: html] src/lessons/welcome/array/has271/Has271.html $lang:src/lessons/welcome/array/has271/Has271.$lang.html
-[type: html] src/lessons/sort/baseball/Main.html $lang:src/lessons/sort/baseball/Main.$lang.html
-[type: html] src/lessons/sort/baseball/short_desc.html $lang:src/lessons/sort/baseball/short_desc.$lang.html
-[type: html] src/lessons/sort/baseball/universe/BaseballWorld.html $lang:src/lessons/sort/baseball/universe/BaseballWorld.$lang.html
-[type: html] src/lessons/sort/baseball/NaiveBaseball.html $lang:src/lessons/sort/baseball/NaiveBaseball.$lang.html
-[type: html] src/lessons/sort/baseball/SelectBaseball.html $lang:src/lessons/sort/baseball/SelectBaseball.$lang.html
-[type: html] src/lessons/sort/baseball/InsertBaseball.html $lang:src/lessons/sort/baseball/InsertBaseball.$lang.html
-[type: html] src/lessons/sort/baseball/BubbleBaseball.html $lang:src/lessons/sort/baseball/BubbleBaseball.$lang.html
[type: html] src/lessons/turtleart/Main.html $lang:src/lessons/turtleart/Main.$lang.html
[type: html] src/lessons/turtleart/short_desc.html $lang:src/lessons/turtleart/short_desc.$lang.html
diff --git a/src/lessons/bat/string1/StringMatch.fr.html b/src/lessons/bat/string1/StringMatch.fr.html
index 4a927e9..d86ffbd 100644
--- a/src/lessons/bat/string1/StringMatch.fr.html
+++ b/src/lessons/bat/string1/StringMatch.fr.html
@@ -1,6 +1,6 @@
<h1>Comparaison de chaînes</h1>
Soit deux chaînes de caractères a et b.
-Renvoyez le nombre de position où elles contiennent la même sous-chaine de
+Renvoyez le nombre de position où elles contiennent la même sous-chaîne de
longueur 2.
Ainsi, "xxcaazz" et "xxbaaz" renvoient 3, puisque les sous-chaînes "xx",
"aa", et "az" apparaissent dans les mêmes emplacement dans les deux chaînes.
diff --git a/src/lessons/lightbot/Board01TwoSteps.fr.html b/src/lessons/lightbot/Board01TwoSteps.fr.html
index 4f0b82b..b0d4de3 100644
--- a/src/lessons/lightbot/Board01TwoSteps.fr.html
+++ b/src/lessons/lightbot/Board01TwoSteps.fr.html
@@ -10,6 +10,6 @@ en utilisant le menu <b>À propos de ce monde</b>.<</p>
ampoules du tableau à votre petit robot.</p>
<p>Ce premier exercice est une simple mise en bouche. Vous devriez pouvoir le
-résourdre simplement en avancant et en allumant la lampe, grâce aux ordres
+résoudre simplement en avancant et en allumant la lampe, grâce aux ordres
suivants:
<img src="img/lightbot_forward.png" /> et <img src="img/lightbot_light.png" />.</p>
\ No newline at end of file
diff --git a/src/lessons/recursion/Main.fr.html b/src/lessons/recursion/Main.fr.html
index 43f2b5f..75c81bc 100644
--- a/src/lessons/recursion/Main.fr.html
+++ b/src/lessons/recursion/Main.fr.html
@@ -3,4 +3,23 @@ Cette leçon vous permet d'expérimenter avec des algorithmes récursifs.
<p>Si vous cherchez d'autres algorithmes récursifs, un exercice sur les tris
récursifs (en particulier QuickSort et MergeSort) est prévu à l'avenir dans
-la leçon sur les tris.
+la leçon sur les tris.</p>
+
+<h3>Que puis-je faire pour améliorer cette leçon ?</h3>
+
+<p>Comme souvent, plusieurs points pourraient être améliorés dans cette
+leçon :</p>
+<ul>
+ <li>Le triangle de Sierpinski peut être tracé de façon bien plus simple en
+utilisant un L-système. Voir http://jpvallon.free.fr/recursivite.html</li>
+ <li>la courbe de Sierpinski est également intéressante:
+http://www.mathcurve.com/fractals/sierpinski/sierpinskitriangle.shtml</li>
+ <li>La courbe du dragon pourrait être expliquée comme un
+L-système. http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/heighway.htm</li>
+ <li>La courbe du dragon2 s'appelle la courbe des dragons jumeaux:
+http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/twindragon.htm</li>
+ <li>Les courbes remplissant l'espace (Peano, Hildebert, etc) pourraient être
+ajoutées. http://teachout1.net/village/fill.html </li>
+ <li>Un exercice sur les polygones inscrits serait intéressant:
+http://www.inrialpes.fr/helix/people/genoud/ENSJAVA/tds/sujets/dessinsReccursifs/actionsrecursives.html</li>
+</ul>
diff --git a/src/lessons/recursion/Main.html b/src/lessons/recursion/Main.html
index 3107d39..08748b6 100644
--- a/src/lessons/recursion/Main.html
+++ b/src/lessons/recursion/Main.html
@@ -3,4 +3,18 @@ This lesson allows to experiment with recursive algorithms.
<p>If you need more recursive algorithms, an exercise on recursive sorting
algorithms (in particular QuickSort and MergeSort) is planned in the future
-within the sorting lesson.
+within the sorting lesson.</p>
+
+<h3>What can I do to improve this lesson?</h3>
+
+<p>As usual, there are several things that could be done in this lesson to improve it further:</p>
+<ul>
+ <li>The Sierpinski triangle can be drawn using a simpler L-system. See http://jpvallon.free.fr/recursivite.html</li>
+ <li>The arrowhead curve is also interesting: http://www.mathcurve.com/fractals/sierpinski/sierpinskitriangle.shtml</li>
+ <li>The dragon curve could be explained as a L-system: http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/heighway.htm</li>
+ <li>The dragon2 curve is called the twin dragon: http://ecademy.agnesscott.edu/~lriddle/ifs/heighway/twindragon.htm</li>
+ <li>The space filling curves could be added (Peano, Hildebert, etc).
+ See: http://teachout1.net/village/fill.html </li>
+ <li>We could do another exercise on embeeded polygons:
+ http://www.inrialpes.fr/helix/people/genoud/ENSJAVA/tds/sujets/dessinsReccursifs/actionsrecursives.html</li>
+</ul>
diff --git a/src/lessons/recursion/Main.java b/src/lessons/recursion/Main.java
index a754c7f..5d9fcd0 100644
--- a/src/lessons/recursion/Main.java
+++ b/src/lessons/recursion/Main.java
@@ -2,7 +2,11 @@ package lessons.recursion;
import lessons.recursion.dragoncurve.DragonCurve1;
import lessons.recursion.dragoncurve.DragonCurve2;
+import lessons.recursion.koch.Crab;
+import lessons.recursion.koch.HexaKoch;
import lessons.recursion.koch.Koch;
+import lessons.recursion.koch.PentaKoch;
+import lessons.recursion.koch.SquareKoch;
import lessons.recursion.polygonfractal.PolygonFractal;
import lessons.recursion.sierpinski.Sierpinski;
import lessons.recursion.spiral.Spiral;
@@ -19,6 +23,10 @@ public class Main extends Lesson {
addExercise(new SpiralUse(this));
addExercise(new Tree(this));
addExercise(new Koch(this));
+ addExercise(new SquareKoch(this));
+ addExercise(new PentaKoch(this));
+ addExercise(new HexaKoch(this));
+ addExercise(new Crab(this));
addExercise(new Sierpinski(this));
addExercise(new PolygonFractal(this));
addExercise(new DragonCurve1(this));
diff --git a/src/lessons/recursion/dragoncurve/DragonCurve1.fr.html b/src/lessons/recursion/dragoncurve/DragonCurve1.fr.html
index 1b3bada..06e8f67 100644
--- a/src/lessons/recursion/dragoncurve/DragonCurve1.fr.html
+++ b/src/lessons/recursion/dragoncurve/DragonCurve1.fr.html
@@ -6,10 +6,10 @@
la courbe du Dragon d'ordre 1 est un vecteur entre deux points quelconques P
et Q,<br/>
la courbe du Dragon d'ordre n est la courbe du Dragon d'ordre n-1 entre P et
-R suivie de la même courbe d'ordre n-1 entre R et Q (à l'envers), où PRQ est
-le triangle isocèle rectangle en R, et R est à droite du vecteur PQ. Donc,
-si P et Q sont les points de coordonnées (x, y) et (z,t), les coordonnées
-(u, v) de R sont</p>
+R suivie de la même courbe d'ordre n-1 entre Q et R, où PRQ est le triangle
+isocèle rectangle en R, et R est à droite du vecteur PQ. Donc, si P et Q
+sont les points de coordonnées (x, y) et (z,t), les coordonnées (u, v) de R
+sont les suivantes:</p>
<pre>
u = (x + z)/2 + (t - y)/2
v = (y + t)/2 - (z - x)/2
diff --git a/src/lessons/recursion/dragoncurve/DragonCurve1.html b/src/lessons/recursion/dragoncurve/DragonCurve1.html
index 70957f8..311317c 100644
--- a/src/lessons/recursion/dragoncurve/DragonCurve1.html
+++ b/src/lessons/recursion/dragoncurve/DragonCurve1.html
@@ -5,8 +5,8 @@
<p>The definition of this curve is the following:<br/>
the dragon curve of order 1 is a vector between to arbitrary points P and Q,<br/>
the dragon curve of order n is the dragon curve of order n-1 between P and
-R, followed by the same curve of order n-1 between R and Q (reverse side),
-where PRQ is an isoscele triangle with angle R being a right angle, and R
+R, followed by the same curve of order n-1 between Q and R,
+where PRQ is an isosceles triangle with angle R being a right angle, and R
being at the right of the PQ vector. Thus, if P and Q coordinates are (x, y)
and (z, t), the coordinate (u, v) of R are given by:</p>
<pre>
diff --git a/src/lessons/recursion/hanoi/Main.html b/src/lessons/recursion/hanoi/Main.html
index df86d3c..d9910c4 100644
--- a/src/lessons/recursion/hanoi/Main.html
+++ b/src/lessons/recursion/hanoi/Main.html
@@ -1,4 +1,4 @@
<h1>Hanoi towers</h1>
<p>Here comes the super classical exercise on recursion. It's not very
-developped here, I'm not sure of what I could add to this lesson. If
+developed here, I'm not sure of what I could add to this lesson. If
you have any idea, please submit them.</p>
diff --git a/src/lessons/recursion/hanoi/universe/HanoiWorld.fr.html b/src/lessons/recursion/hanoi/universe/HanoiWorld.fr.html
index 438c2b8..ded6412 100644
--- a/src/lessons/recursion/hanoi/universe/HanoiWorld.fr.html
+++ b/src/lessons/recursion/hanoi/universe/HanoiWorld.fr.html
@@ -8,7 +8,7 @@ pour le monde par défaut). Il y a quelques contraintes supplémentaires: il
est interdit de déplacer plus d'un disque à la fois, ainsi que de placer un
disque plus grand sur un disque plus petit.</p>
-<p>Seules trois fonctions sont fournies :</p>
+<p>Seules quatre fonctions sont fournies :</p>
<pre>[!java]void [/!]deplace([!java]int [/!]src, [!java]int [/!]dst)</pre>
@@ -22,5 +22,8 @@ Retourne le nombre de disques placés sur un piquet donné. Cette fonction est
surtout utile pour initialiser la récursion et déterminer le nombre d'appels
récursifs à réaliser.
+<pre>[!java]int [/!]getRayon([!java]int [/!]slot)[!scala]:Int[/!]</pre>
+Retourne le rayon du disque placé en haut du piquet spécifié.
+
<pre>[!java]boolean [/!]estChoisie()[!scala]:Boolean[/!]</pre>
Renvoi si le monde actuel est sélectionné dans l'interface graphique.
diff --git a/src/lessons/recursion/hanoi/universe/HanoiWorld.html b/src/lessons/recursion/hanoi/universe/HanoiWorld.html
index c796b07..b764296 100644
--- a/src/lessons/recursion/hanoi/universe/HanoiWorld.html
+++ b/src/lessons/recursion/hanoi/universe/HanoiWorld.html
@@ -8,7 +8,7 @@ the default world). There is some extra constraint: you can only move
one disk at a time, and you cannot move a big disk over a smaller
one.</p>
-<p>Only 3 functions are provided:</p>
+<p>Only 4 functions are provided:</p>
<pre>[!java]void [/!]move([!java]int [/!]src, [!java]int [/!]dst)</pre>
@@ -20,5 +20,8 @@ over a smaller one), an IllegalArgumentException is thrown.
Returns the amount of disks placed on the specified slot. This is mainly
used to initialize the recursion and set the amount of recursive call to execute.
+<pre>[!java]int [/!]getRadius([!java]int [/!]slot)[!scala]:Int[/!]</pre>
+Returns the radius of the top-most disk of the specified slot.
+
<pre>[!java]boolean [/!]isSelected()[!scala]:Boolean[/!]</pre>
Returns whether the current world is selected in the graphical interface.
diff --git a/src/lessons/recursion/hanoi/universe/HanoiWorld.java b/src/lessons/recursion/hanoi/universe/HanoiWorld.java
index 6bfa137..41b1fa8 100644
--- a/src/lessons/recursion/hanoi/universe/HanoiWorld.java
+++ b/src/lessons/recursion/hanoi/universe/HanoiWorld.java
@@ -148,6 +148,9 @@ public class HanoiWorld extends World {
public int getSlotSize(int slot) {
return slots[slot].size();
}
+ public int getRadius(int slot) {
+ return slots[slot].isEmpty()?99:slots[slot].lastElement();
+ }
@Override
public void setupBindings(ProgrammingLanguage lang, ScriptEngine e) throws ScriptException {
if (lang.equals(Game.PYTHON)) {
@@ -155,11 +158,15 @@ public class HanoiWorld extends World {
" entity.move(src,dst)\n"+
"def getSlotSize(slot):\n"+
" return entity.getSlotSize(slot)\n"+
+ "def getRadius(slot):\n"+
+ " return entity.getRadius(slot)\n"+
/* BINDINGS TRANSLATION: French */
"def deplace(src,dst):\n"+
" entity.move(src,dst)\n"+
"def getTaillePiquet(slot):\n"+
- " return entity.getSlotSize(slot)\n");
+ " return entity.getSlotSize(slot)\n"+
+ "def getRayon(piquet):\n"+
+ " return entity.getRadius(piquet)\n");
} else {
throw new RuntimeException("No binding of HanoiWorld for "+lang);
}
diff --git a/src/lessons/recursion/hanoi/universe/HanoiWorldView.java b/src/lessons/recursion/hanoi/universe/HanoiWorldView.java
index 00ae3cb..acccf85 100644
--- a/src/lessons/recursion/hanoi/universe/HanoiWorldView.java
+++ b/src/lessons/recursion/hanoi/universe/HanoiWorldView.java
@@ -1,64 +1,230 @@
package lessons.recursion.hanoi.universe;
import java.awt.Color;
+import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import javax.swing.JOptionPane;
+
+import plm.core.model.Game;
import plm.core.ui.WorldView;
+import plm.universe.EntityControlPanel;
import plm.universe.World;
public class HanoiWorldView extends WorldView {
private static final long serialVersionUID = 1L;
+ int pegFrom = -1;
+ boolean buggyMove = false;
public HanoiWorldView(World w) {
super(w);
+
+ new DragSource().createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new HanoiDragGestureListener());
+ DropTarget dropTarget=new DropTarget(this,new HanoiDropTargetListener());
+ dropTarget.setActive(true); // We accept drops
+ this.setDropTarget(dropTarget);
+
}
@Override
public void paintComponent(Graphics g) {
- HanoiWorld hw = (HanoiWorld)world;
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ /* clear board */
+ g2.setColor(Color.white);
+ g2.fill(new Rectangle2D.Double(0., 0., getWidth(), getHeight()));
+
double renderedX = 300.;
double renderedY = 250.;
double ratio = Math.min(((double) getWidth()) / renderedX, ((double) getHeight()) / renderedY);
g2.translate(Math.abs(getWidth() - ratio * renderedX)/2., Math.abs(getHeight() - ratio * renderedY)/2.);
g2.scale(ratio, ratio);
- /* clear board */
- g2.setColor(Color.white);
- g2.fill(new Rectangle2D.Double(0., 0., renderedX, renderedY));
-
-
- drawSlot(g2,hw.values(0), 50.);
- drawSlot(g2,hw.values(1), 150.);
- drawSlot(g2,hw.values(2), 250.);
+ drawSlot(g2, 0, 50.);
+ drawSlot(g2, 1, 150.);
+ drawSlot(g2, 2, 250.);
}
- private void drawSlot(Graphics2D g2, Integer[] values, double xoffset) {
+ private void drawSlot(Graphics2D g2, int rank, double xoffset) {
+ HanoiWorld board = (HanoiWorld)world;
+
/* draw bar */
- g2.setColor(Color.black);
+ if (pegFrom == -1)
+ g2.setColor(Color.black);
+ else if (board.getRadius(pegFrom) >= board.getRadius(rank))
+ g2.setColor(Color.red);
+ else
+ g2.setColor(Color.green);
g2.fill(new Rectangle2D.Double(xoffset-2, 55., 2., 125.));
- if (values==null)
+ if (board.values(rank)==null)
return;
/* draw discs */
int height = 1;
- for (int size : values) {
- g2.setColor(Color.yellow);
+ for (int i=0; i<board.values(rank).length; i++) {
+ int size = board.values(rank)[i];
+ if (rank == pegFrom && i==board.values(rank).length-1)
+ g2.setColor(buggyMove ? Color.red : Color.green);
+ else
+ g2.setColor(Color.yellow);
g2.fill(new Rectangle2D.Double( xoffset-size*5-3, 180-(15.*height), size*10+3, 10));
g2.setColor(Color.black);
g2.draw(new Rectangle2D.Double( xoffset-size*5-3, 180-(15.*height), size*10+3, 10));
height++;
}
}
+
+
+ class HanoiDragGestureListener implements DragGestureListener {
+ @Override
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ if (world.isAnswerWorld()) // Don't change the correction
+ return;
+ HanoiWorld board = (HanoiWorld) world;
+
+ pegFrom = dge.getDragOrigin().x / (HanoiWorldView.this.getWidth()/3);
+ if (pegFrom >2 || pegFrom<0 || board.getSlotSize(pegFrom) == 0) {
+ pegFrom = -1;
+ return;
+ }
+ HanoiWorldView.this.paintImmediately(getVisibleRect());
+
+ dge.startDrag(DragSource.DefaultMoveDrop,new TransferableHanoiPiece(pegFrom),new HanoiDragSourceListener());
+ }
+ }
+ class HanoiDropTargetListener implements DropTargetListener {
+ @Override
+ public void dragEnter(DropTargetDragEvent dtde) {
+ setCursor(DragSource.DefaultMoveDrop);
+ }
+ int lastPeg = -1;
+ @Override
+ public void dragOver(DropTargetDragEvent dtde) {
+ int peg = dtde.getLocation().x / ( HanoiWorldView.this.getWidth() / 3);
+ if (peg == lastPeg)
+ return;
+ lastPeg = peg;
+ HanoiWorld board = (HanoiWorld) world;
+ if (board.getRadius(pegFrom) >= board.getRadius(lastPeg)){
+ HanoiWorldView.this.setCursor(DragSource.DefaultMoveNoDrop);
+ buggyMove = true;
+ } else {
+ HanoiWorldView.this.setCursor(DragSource.DefaultMoveDrop);
+ buggyMove = false;
+ }
+ HanoiWorldView.this.paintImmediately(HanoiWorldView.this.getVisibleRect());
+ }
+ @Override
+ public void dropActionChanged(DropTargetDragEvent dtde) {/* tell your mum */}
+ @Override
+ public void dragExit(DropTargetEvent dte) {
+ setCursor(Cursor.getDefaultCursor());
+ }
+ @Override
+ public void drop(DropTargetDropEvent dtde) {
+ dtde.acceptDrop(DnDConstants.ACTION_MOVE);
+ HanoiWorld board = (HanoiWorld) world;
+ int pegTo = dtde.getLocation().x/( HanoiWorldView.this.getWidth() / 3);
+ if (pegTo <0 || pegTo>2) {
+ System.out.println("Ignore the buggy drop onto peg "+pegTo);
+ dtde.dropComplete(false);
+ return;
+ }
+
+ // That's unheaven: we get the rankFrom directly from a global, not from the transferable...
+ //Integer rankFrom = (Integer) dtde.getTransferable().getTransferData(TransferableLine.dutchLineFlavor);
+ dtde.dropComplete(true);
+ if (pegFrom != pegTo) {
+ EntityControlPanel.echo(Game.i18n.tr("move({0},{1})",pegFrom,pegTo));
+ try {
+ board.move(pegFrom, pegTo);
+ } catch (IllegalArgumentException iae) {
+ JOptionPane.showMessageDialog(null, iae.getLocalizedMessage(),Game.i18n.tr("Invalid move"), JOptionPane.ERROR_MESSAGE);
+ }
+ }
+
+ pegFrom = -1;
+ buggyMove = false;
+ HanoiWorldView.this.setCursor(Cursor.getDefaultCursor());
+ HanoiWorldView.this.paintImmediately(HanoiWorldView.this.getVisibleRect());
+
+ }
+ }
+ class HanoiDragSourceListener implements DragSourceListener {
+ boolean outside = false;
+ @Override
+ public void dragEnter(DragSourceDragEvent dsde) {
+ outside = false;
+ }
+ @Override
+ public void dragOver(DragSourceDragEvent dsde) { /* */ }
+ @Override
+ public void dropActionChanged(DragSourceDragEvent dsde) { /* */ }
+ @Override
+ public void dragExit(DragSourceEvent dse) {
+ outside = true;
+ }
+ @Override
+ public void dragDropEnd(DragSourceDropEvent dsde) {
+ if (outside) { // Dropped outside of our area
+ pegFrom = -1;
+ buggyMove = false;
+ HanoiWorldView.this.paintImmediately(HanoiWorldView.this.getVisibleRect());
+ }
+ }
+ }
}
+class TransferableHanoiPiece implements Transferable {
+ static DataFlavor hanoiDataFlavor = new DataFlavor(Integer.class,"Hanoi piece");
+ private Integer pegFrom;
+ public TransferableHanoiPiece(int _pegFrom) {
+ pegFrom = _pegFrom;
+ }
+
+ @Override
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] {hanoiDataFlavor};
+ }
+
+ @Override
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return flavor.equals(hanoiDataFlavor);
+ }
+
+ @Override
+ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+
+ if (flavor.equals(hanoiDataFlavor))
+ return pegFrom;
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+}
+
diff --git a/src/lessons/recursion/koch/Crab.fr.html b/src/lessons/recursion/koch/Crab.fr.html
new file mode 100644
index 0000000..86c6b1f
--- /dev/null
+++ b/src/lessons/recursion/koch/Crab.fr.html
@@ -0,0 +1,18 @@
+<h2>La fractale du crabe</h2>
+
+<p>La courbe du crabe n'est pas exactement une courbe de Koch, mais cette
+fractale est construite de façon très similaire. Cette fois, nous ne
+remplaçons pas le tiers central de chaque segment, mais le segment entier. À
+la place, il faut faire pousser des triangles isocèles et
+rectangles. L'angle initial est de 45°, et la longueur est divisée par
+[!java|scala]Math.sqrt(2)[/!][!python]math.sqrt(2)[/!] à chaque étape.</p>
+
+<p>Vérifiez les figures produites par les premiers niveaux de récursivité pour
+comprendre le motif.</p>
+
+<h3>Note bibliographique</h3>
+<p>Cette courbe, également appelée la courbe C de Lévy, a été inventée en 1938
+par le mathématicien Français Paul Lévy. Comme souvent, la page wikipédia
+sur le sujet est très instructive. La page suivante apporte également des
+compléments intéressants : <a
+href="http://www.mathcurve.com/fractals/c/c.shtml">http://www.mathcurve.com/fractals/c/c.shtml</a>.</p>
\ No newline at end of file
diff --git a/src/lessons/recursion/koch/Crab.html b/src/lessons/recursion/koch/Crab.html
new file mode 100644
index 0000000..17a5684
--- /dev/null
+++ b/src/lessons/recursion/koch/Crab.html
@@ -0,0 +1,12 @@
+<h2>Fractal Crab</h2>
+
+<p>The Crab curve is not exactly a Koch curve, but that's still a fractal and it's built rather similarly.
+This time, we grow square triangle on the side of the figure: the angle is 45 degrees, and the length is divided by
+[!java|scala]Math.sqrt(2)[/!][!python]math.sqrt(2)[/!] at each step.</p>
+
+<p>Check the figures produced by the first steps of recursion to understand the pattern.</p>
+
+<h3>Bibliographical note</h3>
+<p>This curve, also called the Lévy C curve was invented in 1938 by the French mathematician Paul Lévy in 1938.
+As usual, the wikipedia page is very instructive, and the page provide a very good additions:
+<a href="http://www.mathcurve.com/fractals/c/c.shtml">http://www.mathcurve.com/fractals/c/c.shtml</a>.</p>
\ No newline at end of file
diff --git a/src/lessons/recursion/koch/Crab.java b/src/lessons/recursion/koch/Crab.java
new file mode 100644
index 0000000..1eab2e0
--- /dev/null
+++ b/src/lessons/recursion/koch/Crab.java
@@ -0,0 +1,52 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.core.model.lesson.ExerciseTemplated;
+import plm.core.model.lesson.Lesson;
+import plm.universe.World;
+import plm.universe.turtles.Turtle;
+import plm.universe.turtles.TurtleWorld;
+
+public class Crab extends ExerciseTemplated {
+
+ public Crab(Lesson lesson) {
+ super(lesson);
+
+ /* Create initial situation */
+ World[] myWorlds = new World[8];
+ myWorlds[0] = new TurtleWorld("crab(0,200)", 400, 400);
+ myWorlds[0].setParameter(new Object[] {0,200.});
+ new Turtle(myWorlds[0], "Hawksbill", 200, 300, -90, Color.red);
+
+ myWorlds[1] = new TurtleWorld("crab(1,200)", 400, 400);
+ myWorlds[1].setParameter(new Object[] {1,200.});
+ new Turtle(myWorlds[1], "Hawksbill", 200, 300, -90, Color.red);
+
+ myWorlds[2] = new TurtleWorld("crab(2,200)", 400, 400);
+ myWorlds[2].setParameter(new Object[] {2,200.});
+ new Turtle(myWorlds[2], "Hawksbill", 200, 300, -90, Color.red);
+
+ myWorlds[3] = new TurtleWorld("crab(3,200)", 400, 400);
+ myWorlds[3].setParameter(new Object[] {3,200.});
+ new Turtle(myWorlds[3], "Hawksbill", 200, 300,-90, Color.red);
+
+ myWorlds[4] = new TurtleWorld("crab(4,200)", 400, 400);
+ myWorlds[4].setParameter(new Object[] {4,200.});
+ new Turtle(myWorlds[4], "Hawksbill", 200, 300,-90, Color.red);
+
+ myWorlds[5] = new TurtleWorld("crab(7,200)", 400, 400);
+ myWorlds[5].setParameter(new Object[] {7,200.});
+ new Turtle(myWorlds[5], "Hawksbill", 200, 300,-90, Color.red);
+
+ myWorlds[6] = new TurtleWorld("crab(9,200)", 400, 400);
+ myWorlds[6].setParameter(new Object[] {9,200.});
+ new Turtle(myWorlds[6], "Hawksbill", 200, 300,-90, Color.red);
+
+ myWorlds[7] = new TurtleWorld("crab(12,200)", 400, 400);
+ myWorlds[7].setParameter(new Object[] {12,200.});
+ new Turtle(myWorlds[7], "Hawksbill", 200, 300,-90, Color.red);
+
+ setup(myWorlds);
+ }
+}
diff --git a/src/lessons/recursion/koch/CrabEntity.java b/src/lessons/recursion/koch/CrabEntity.java
new file mode 100644
index 0000000..389239e
--- /dev/null
+++ b/src/lessons/recursion/koch/CrabEntity.java
@@ -0,0 +1,26 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+
+public class CrabEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ void crab(int levels, double length) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ left(45);
+ crab(levels-1, length/Math.sqrt(2));
+ right(90);
+ crab(levels-1, length/Math.sqrt(2));
+ left(45);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ public void run() {
+ crab((Integer)getParam(0),(Double)getParam(1));
+ }
+}
diff --git a/src/lessons/recursion/koch/CrabEntity.py b/src/lessons/recursion/koch/CrabEntity.py
new file mode 100644
index 0000000..b53eeb4
--- /dev/null
+++ b/src/lessons/recursion/koch/CrabEntity.py
@@ -0,0 +1,18 @@
+# BEGIN TEMPLATE
+import math
+
+def crab(levels, length):
+ # BEGIN SOLUTION
+ if levels == 0:
+ forward(length)
+ else:
+ left(45)
+ crab(levels-1, length/math.sqrt(2))
+ right(90)
+ crab(levels-1, length/math.sqrt(2))
+ left(45)
+ # END SOLUTION
+
+# END TEMPLATE
+
+crab(getParam(0), getParam(1))
diff --git a/src/lessons/recursion/koch/CrabEntity.scala b/src/lessons/recursion/koch/CrabEntity.scala
new file mode 100644
index 0000000..ccb75d0
--- /dev/null
+++ b/src/lessons/recursion/koch/CrabEntity.scala
@@ -0,0 +1,27 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+import java.awt.Color
+
+class ScalaKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ def crab(levels:Int, length:Double) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ left(45);
+ crab(levels-1, length/Math.sqrt(2));
+ right(90);
+ crab(levels-1, length/Math.sqrt(2));
+ left(45);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ override def run() {
+ crab(getParam(0).asInstanceOf[Int],getParam(1).asInstanceOf[Double]);
+ }
+}
diff --git a/src/lessons/recursion/koch/HexaKoch.fr.html b/src/lessons/recursion/koch/HexaKoch.fr.html
new file mode 100644
index 0000000..3cdbbd0
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKoch.fr.html
@@ -0,0 +1,15 @@
+<h2>Hexagone de neige</h2>
+
+<p>Cette fois, nous allons dessiner une courbe surnommée la courbe de Koch-(6;
+0,14). Cela signifie que nous allons faire pousser des hexagones (des
+polygones à 6 faces) sur les segments, et que les longueurs doivent être
+multipliées par 0,14 à chaque étage de la récursion. </p>
+
+<p>Pour info, la courbe de Koch originale est la (3; 1/3). Le carré de neige
+est la courbe (4; 1/3). Le pentagone de neige est la courbe (5; 0,4). Si
+vous le souhaitez, vous pouvez passer en mode créatif pour explorer d'autres
+courbes de Koch. Remplacez simplement l'appel à hexaKoch par ce que vous
+voulez.</p>
+
+<p>Pour plus d'informations, référez vous à <a
+href="http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm">http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm</a>.
\ No newline at end of file
diff --git a/src/lessons/recursion/koch/HexaKoch.html b/src/lessons/recursion/koch/HexaKoch.html
new file mode 100644
index 0000000..0b0bfc8
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKoch.html
@@ -0,0 +1,13 @@
+<h2>Snow hexagon</h2>
+
+<p>This time, we will draw the curve that is known as the (6, 0.14)-Koch curve. This means that
+you have to grow 6-sided polygons on the segments, and that the length should be multiplied by 0.14
+at each recursion level. </p>
+
+<p>For the record, the origical Koch curve is the (3, 1/3)-Koch curve,
+the Snow square would be (4,1/3)-Koch curve while the Snow pentagon
+is also called the (5, 0.4)-Koch curve. If you want, you can switch to the creative mode in the menu
+and explore freely other Koch curves. Just change the initial call to hexaKoch to what you want.</p>
+
+<p>For further reference, please see
+<a href="http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm">http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm</a>.
\ No newline at end of file
diff --git a/src/lessons/recursion/koch/HexaKoch.java b/src/lessons/recursion/koch/HexaKoch.java
new file mode 100644
index 0000000..5ca55ca
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKoch.java
@@ -0,0 +1,44 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.core.model.lesson.ExerciseTemplated;
+import plm.core.model.lesson.Lesson;
+import plm.universe.World;
+import plm.universe.turtles.Turtle;
+import plm.universe.turtles.TurtleWorld;
+
+public class HexaKoch extends ExerciseTemplated {
+
+ public HexaKoch(Lesson lesson) {
+ super(lesson);
+
+ /* Create initial situation */
+ World[] myWorlds = new World[6];
+ myWorlds[0] = new TurtleWorld("hexaKoch(0,200)", 400, 400);
+ myWorlds[0].setParameter(new Object[] {0,200.});
+ new Turtle(myWorlds[0], "Hawksbill", 100, 250, 0, Color.red);
+
+ myWorlds[1] = new TurtleWorld("hexaKoch(1,500)", 400, 400);
+ myWorlds[1].setParameter(new Object[] {1,500.});
+ new Turtle(myWorlds[1], "Hawksbill", 100, 250, 0, Color.red);
+
+ myWorlds[2] = new TurtleWorld("hexaKoch(2,1400)", 400, 400);
+ myWorlds[2].setParameter(new Object[] {2,1400.});
+ new Turtle(myWorlds[2], "Hawksbill", 100, 250, 0, Color.red);
+
+ myWorlds[3] = new TurtleWorld("hexaKoch(3,3500)", 400, 400);
+ myWorlds[3].setParameter(new Object[] {3,3500.});
+ new Turtle(myWorlds[3], "Hawksbill", 100, 250, 0, Color.red);
+
+ myWorlds[4] = new TurtleWorld("hexaKoch(4,7000)", 400, 400);
+ myWorlds[4].setParameter(new Object[] {4,7500.});
+ new Turtle(myWorlds[4], "Hawksbill", 100, 250,0, Color.red);
+
+ myWorlds[5] = new TurtleWorld("hexaKoch(5,15000)", 400, 400);
+ myWorlds[5].setParameter(new Object[] {5,15000.});
+ new Turtle(myWorlds[5], "Hawksbill", 100, 250,0, Color.red);
+
+ setup(myWorlds);
+ }
+}
diff --git a/src/lessons/recursion/koch/HexaKochEntity.java b/src/lessons/recursion/koch/HexaKochEntity.java
new file mode 100644
index 0000000..13b90af
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKochEntity.java
@@ -0,0 +1,32 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+
+public class HexaKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ void drawCurve(int levels, double length) {
+ hexaKoch(levels, length);
+ }
+ void hexaKoch(int levels, double length) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ hexaKoch(levels-1, length*.14);
+ left(120);
+ for (int i=0;i<5;i++) {
+ hexaKoch(levels-1, length*.14);
+ right(60);
+ }
+ left(180);
+ hexaKoch(levels-1, length*.14);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ public void run() {
+ drawCurve((Integer)getParam(0),(Double)getParam(1));
+ }
+}
diff --git a/src/lessons/recursion/koch/HexaKochEntity.py b/src/lessons/recursion/koch/HexaKochEntity.py
new file mode 100644
index 0000000..751f3cb
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKochEntity.py
@@ -0,0 +1,22 @@
+# BEGIN TEMPLATE
+
+def hexaKoch(levels, length):
+ # BEGIN SOLUTION
+ if levels == 0:
+ forward(length)
+ else:
+ hexaKoch(levels-1, length*.14)
+ left(120)
+ for i in range(5):
+ hexaKoch(levels-1, length*.14)
+ right(60)
+ left(180)
+ hexaKoch(levels-1, length*.14)
+ # END SOLUTION
+
+def drawCurve(levels, length):
+ hexaKoch(levels, length)
+
+# END TEMPLATE
+
+drawCurve(getParam(0), getParam(1))
diff --git a/src/lessons/recursion/koch/HexaKochEntity.scala b/src/lessons/recursion/koch/HexaKochEntity.scala
new file mode 100644
index 0000000..f8cb31a
--- /dev/null
+++ b/src/lessons/recursion/koch/HexaKochEntity.scala
@@ -0,0 +1,33 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+import java.awt.Color
+
+class ScalaHexaKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ def drawCurve(levels:Int, length:Double) {
+ hexaKoch(levels, length);
+ }
+ def hexaKoch(levels:Int, length:Double) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);;
+ } else {
+ hexaKoch(levels-1, length*.14);
+ left(120);
+ for (i <- 1 to 5) {
+ hexaKoch(levels-1, length*.14);
+ right(60);
+ }
+ left(180);
+ hexaKoch(levels-1, length*.14);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ override def run() {
+ drawCurve(getParam(0).asInstanceOf[Int],getParam(1).asInstanceOf[Double]);
+ }
+}
diff --git a/src/lessons/recursion/koch/Koch.fr.html b/src/lessons/recursion/koch/Koch.fr.html
index 0f039c5..13d02be 100644
--- a/src/lessons/recursion/koch/Koch.fr.html
+++ b/src/lessons/recursion/koch/Koch.fr.html
@@ -12,7 +12,20 @@ Pour simplifier les choses, chaque coté a une couleur
particulière. Contentez vous de dessiner les choses en rouge (sans changer
votre couleur), et les autres couleurs seront dessinées automatiquement. </p>
-<p>Observez le dessin dans chaque monde objectif pour comprendre la logique de
-ce motif afin de la reproduire. Vous devez écrire la fonction snowSide, qui
-est récursive. Mais <b>n'appelez pas snowFlake depuis snowSide</b>, car
-sinon le résultat sera vraiment étrange et inattendu.</p>
+<p>Observez l'objectif de chaque monde pour comprendre la logique du motif à
+dessiner, puis reproduisez-le.
+Au niveau 0, la courbe de Koch est une simple ligne droite.
+Au niveau 1, elle est divisée en trois tiers, et la partie du milieu est
+remplacée par deux cotés d'un triangle équilatéral de même longueur que le
+segment supprimé.
+Au niveau 2, le processus est répété avec le tiers central de chaque segment
+remplacé par un petit triangle équilatéral.</p>
+
+<p><div class="tip" id="tip-1" alt="TL;DR. Vous pouvez me dessiner tout ça ?">
+<p>Voici le résultat des premiers niveaux de recusion.</p>
+<img src="KochHint.png" />
+</div></p>
+
+<p>Vous devez écrire la fonction snowSide, qui est récursive. Mais <b>n'appelez
+pas snowFlake depuis snowSide</b>, car sinon le résultat sera vraiment
+étrange et inattendu.</p>
diff --git a/src/lessons/recursion/koch/Koch.html b/src/lessons/recursion/koch/Koch.html
index 11ec7d4..98d31c5 100644
--- a/src/lessons/recursion/koch/Koch.html
+++ b/src/lessons/recursion/koch/Koch.html
@@ -10,6 +10,17 @@ in a specific color. Just draw the red things (without changing your pen color),
and the other colors will be drawn automatically. </p>
<p>Observe the drawing in each world's objective to understand the pattern's
-logic, and then reproduce it. You must write the <code>snowSide()</code>
-method, which is recursive but <b>do not call snowFlake from snowSide</b>,
-or you will get very strange unexpected behaviors.</p>
+logic, and then reproduce it. At level 0, the Koch curve is just a straight line.
+At level 1, the curve is divided in three thirds, and the middle part is replaced by
+the two sides of an equilateral triangle of the same length as the segment being removed.
+At level 2, the process is repeated, whith each segments split in three parts and the
+middle part being replaced by the two sides of an equilateral triangle.</p>
+
+<p><div class="tip" id="tip-1" alt="Too much letters. Please picture it.">
+<p>Here are the results of the first levels of recursion.</p>
+<img src="KochHint.png" />
+</div></p>
+
+<p>You must write the <code>snowSide()</code> method, which is recursive but
+<b>do not call snowFlake from snowSide</b>, or you will get very strange and unexpected
+behaviors.</p>
diff --git a/src/lessons/recursion/koch/Koch.java b/src/lessons/recursion/koch/Koch.java
index b296d48..eafd6d5 100644
--- a/src/lessons/recursion/koch/Koch.java
+++ b/src/lessons/recursion/koch/Koch.java
@@ -17,27 +17,27 @@ public class Koch extends ExerciseTemplated {
World[] myWorlds = new World[6];
myWorlds[0] = new TurtleWorld("snowFlake(0,200)", 400, 400);
myWorlds[0].setParameter(new Object[] {0,200.});
- new Turtle(myWorlds[0], "Hawksbill", 200, 350, -90, Color.red);
+ new Turtle(myWorlds[0], "Hawksbill", 100, 300, -90, Color.red);
myWorlds[1] = new TurtleWorld("snowFlake(1,200)", 400, 400);
myWorlds[1].setParameter(new Object[] {1,200.});
- new Turtle(myWorlds[1], "Hawksbill", 200, 350, -90, Color.red);
+ new Turtle(myWorlds[1], "Hawksbill", 100, 300, -90, Color.red);
myWorlds[2] = new TurtleWorld("snowFlake(2,200)", 400, 400);
myWorlds[2].setParameter(new Object[] {2,200.});
- new Turtle(myWorlds[2], "Hawksbill", 200, 350, -90, Color.red);
+ new Turtle(myWorlds[2], "Hawksbill", 100, 300, -90, Color.red);
myWorlds[3] = new TurtleWorld("snowFlake(3,200)", 400, 400);
myWorlds[3].setParameter(new Object[] {3,200.});
- new Turtle(myWorlds[3], "Hawksbill", 200, 350,-90, Color.red);
+ new Turtle(myWorlds[3], "Hawksbill", 100, 300,-90, Color.red);
myWorlds[4] = new TurtleWorld("snowFlake(4,200)", 400, 400);
myWorlds[4].setParameter(new Object[] {4,200.});
- new Turtle(myWorlds[4], "Hawksbill", 200, 350,-90, Color.red);
+ new Turtle(myWorlds[4], "Hawksbill", 100, 300,-90, Color.red);
myWorlds[5] = new TurtleWorld("snowFlake(5,200)", 400, 400);
myWorlds[5].setParameter(new Object[] {5,200.});
- new Turtle(myWorlds[5], "Hawksbill", 200, 350,-90, Color.red);
+ new Turtle(myWorlds[5], "Hawksbill", 100, 300,-90, Color.red);
setup(myWorlds);
}
diff --git a/src/lessons/recursion/koch/KochEntity.java b/src/lessons/recursion/koch/KochEntity.java
index 33bfe21..d215796 100644
--- a/src/lessons/recursion/koch/KochEntity.java
+++ b/src/lessons/recursion/koch/KochEntity.java
@@ -5,7 +5,6 @@ import java.awt.Color;
import plm.universe.turtles.Turtle;
public class KochEntity extends Turtle {
-
/* BEGIN TEMPLATE */
void snowFlake (int levels, double length) {
snowSide(levels, length);
@@ -33,8 +32,26 @@ public class KochEntity extends Turtle {
/* END SOLUTION */
}
/* END TEMPLATE */
-
+
public void run() {
snowFlake((Integer)getParam(0),(Double)getParam(1));
}
+
+ public void drawHint() {
+ clear();
+ hide();
+ setColor(Color.red);
+ setPos(100,50);setHeading(0);
+ snowSide(0,200);
+
+ setPos(100,150); setHeading(0);
+ snowSide(1,200);
+
+ setPos(100,250); setHeading(0);
+ snowSide(2,200);
+
+ setPos(100,350); setHeading(0);
+ snowSide(3,200);
+ }
+
}
diff --git a/src/lessons/recursion/koch/KochEntity.scala b/src/lessons/recursion/koch/KochEntity.scala
index 4de65df..eae4c2b 100644
--- a/src/lessons/recursion/koch/KochEntity.scala
+++ b/src/lessons/recursion/koch/KochEntity.scala
@@ -3,7 +3,7 @@ package lessons.recursion.koch;
import plm.universe.turtles.Turtle;
import java.awt.Color
-class ScalaKochEntity extends Turtle {
+class ScalaCrabEntity extends Turtle {
/* BEGIN TEMPLATE */
def snowFlake (levels:Int, length:Double) {
diff --git a/src/lessons/recursion/koch/KochHint.png b/src/lessons/recursion/koch/KochHint.png
new file mode 100644
index 0000000..553b0b2
Binary files /dev/null and b/src/lessons/recursion/koch/KochHint.png differ
diff --git a/src/lessons/recursion/koch/PentaKoch.fr.html b/src/lessons/recursion/koch/PentaKoch.fr.html
new file mode 100644
index 0000000..ba212e3
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKoch.fr.html
@@ -0,0 +1,13 @@
+<h2>Pentagone de neige</h2>
+
+<p>Voici une autre variation de la courbe de Koch. Cette fois, ce sont de
+petits pentagones (càd des polygones à 5 cotés) qui doivent pousser sur les
+faces de la figure. Je suis sûr que vous commencez à prendre le truc.</p>
+
+<p>Une autre différence avec les exercices précédents est que cette fois, vous
+ne devez pas diviser la taille du segment par 3 à chaque niveau de
+récursion, mais vous devez le multiplier par 0,4. La courbe est plus jolie
+ainsi :)</p>
+
+<p>Nous dessinons un seul coté dans cet exercice, donc votre code ne sera
+appellé qu'une seule fois.</p>
diff --git a/src/lessons/recursion/koch/PentaKoch.html b/src/lessons/recursion/koch/PentaKoch.html
new file mode 100644
index 0000000..d4f76f4
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKoch.html
@@ -0,0 +1,9 @@
+<h2>Snow pentagon</h2>
+
+<p>Here comes yet another variation of the Koch curve. This time, we grow little pentagons
+(ie, polygons with five sides each). I'm sure you get it now.</p>
+
+<p>Another difference with earlier is that the length is not divided by three at each step anymore,
+but multiplied by 0.4. The curve looks better this way :)</p>
+
+<p>We draw only one side in this exercise so your code will be called only once this time.</p>
diff --git a/src/lessons/recursion/koch/PentaKoch.java b/src/lessons/recursion/koch/PentaKoch.java
new file mode 100644
index 0000000..53aaf9f
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKoch.java
@@ -0,0 +1,44 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.core.model.lesson.ExerciseTemplated;
+import plm.core.model.lesson.Lesson;
+import plm.universe.World;
+import plm.universe.turtles.Turtle;
+import plm.universe.turtles.TurtleWorld;
+
+public class PentaKoch extends ExerciseTemplated {
+
+ public PentaKoch(Lesson lesson) {
+ super(lesson);
+
+ /* Create initial situation */
+ World[] myWorlds = new World[6];
+ myWorlds[0] = new TurtleWorld("pentaKoch(0,200)", 400, 400);
+ myWorlds[0].setParameter(new Object[] {0,200.});
+ new Turtle(myWorlds[0], "Hawksbill", 100, 250, 0, Color.red);
+
+ myWorlds[1] = new TurtleWorld("pentaKoch(1,200)", 400, 400);
+ myWorlds[1].setParameter(new Object[] {1,200.});
+ new Turtle(myWorlds[1], "Hawksbill", 75, 250, 0, Color.red);
+
+ myWorlds[2] = new TurtleWorld("pentaKoch(2,200)", 400, 400);
+ myWorlds[2].setParameter(new Object[] {2,200.});
+ new Turtle(myWorlds[2], "Hawksbill", 50, 250, 0, Color.red);
+
+ myWorlds[3] = new TurtleWorld("pentaKoch(3,200)", 400, 400);
+ myWorlds[3].setParameter(new Object[] {3,200.});
+ new Turtle(myWorlds[3], "Hawksbill", 35, 250, 0, Color.red);
+
+ myWorlds[4] = new TurtleWorld("pentaKoch(4,175)", 400, 400);
+ myWorlds[4].setParameter(new Object[] {4,175.});
+ new Turtle(myWorlds[4], "Hawksbill", 25, 250,0, Color.red);
+
+ myWorlds[5] = new TurtleWorld("pentaKoch(5,150)", 400, 400);
+ myWorlds[5].setParameter(new Object[] {5,150.});
+ new Turtle(myWorlds[5], "Hawksbill", 15, 250,0, Color.red);
+
+ setup(myWorlds);
+ }
+}
diff --git a/src/lessons/recursion/koch/PentaKochEntity.java b/src/lessons/recursion/koch/PentaKochEntity.java
new file mode 100644
index 0000000..54e1dea
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKochEntity.java
@@ -0,0 +1,50 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.universe.turtles.Turtle;
+
+public class PentaKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ void pentaKoch(int levels, double length) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ pentaKoch(levels-1, length*.4);
+ left(108);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ left(108);
+ pentaKoch(levels-1, length*.4);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+ public void drawHint() {
+ clear();
+ hide();
+ setColor(Color.red);
+ setPos(100,50);setHeading(0);
+ pentaKoch(0,200);
+
+ setPos(100,150); setHeading(0);
+ pentaKoch(1,200);
+
+ setPos(100,250); setHeading(0);
+ pentaKoch(2,200);
+
+ setPos(100,350); setHeading(0);
+ pentaKoch(3,200);
+ }
+
+ public void run() {
+ pentaKoch((Integer)getParam(0),(Double)getParam(1));
+ }
+}
diff --git a/src/lessons/recursion/koch/PentaKochEntity.py b/src/lessons/recursion/koch/PentaKochEntity.py
new file mode 100644
index 0000000..9654e6b
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKochEntity.py
@@ -0,0 +1,19 @@
+# BEGIN TEMPLATE
+
+def pentaKoch(levels, length):
+ # BEGIN SOLUTION
+ if levels == 0:
+ forward(length)
+ else:
+ pentaKoch(levels-1, length*.4)
+ left(108);
+ for i in range(4):
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ left(180);
+ pentaKoch(levels-1, length*.4)
+ # END SOLUTION
+
+# END TEMPLATE
+
+pentaKoch(getParam(0), getParam(1))
diff --git a/src/lessons/recursion/koch/PentaKochEntity.scala b/src/lessons/recursion/koch/PentaKochEntity.scala
new file mode 100644
index 0000000..38685e7
--- /dev/null
+++ b/src/lessons/recursion/koch/PentaKochEntity.scala
@@ -0,0 +1,33 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+import java.awt.Color
+
+class ScalaPentaKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ def pentaKoch(levels:Int, length:Double) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ pentaKoch(levels-1, length*.4);
+ left(108);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ right(72);
+ pentaKoch(levels-1, length*.4);
+ left(108);
+ pentaKoch(levels-1, length*.4);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ override def run() {
+ pentaKoch(getParam(0).asInstanceOf[Int],getParam(1).asInstanceOf[Double]);
+ }
+}
diff --git a/src/lessons/recursion/koch/SquareKoch.fr.html b/src/lessons/recursion/koch/SquareKoch.fr.html
new file mode 100644
index 0000000..f0b5b58
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKoch.fr.html
@@ -0,0 +1,15 @@
+<h2>Carrés de neige</h2>
+
+<p>Cet exercice est une variation sur le flocon de neige vu précédemment.
+La principale différence est qu'il faut maintenant faire pousser des petits
+carrés au lieu des triangles sur les segments de cette figure.</p>
+
+<p><div class="tip" id="tip-1" alt="Je ne vois pas. Je peux voir un dessin ?">
+<p>Voici le résultat des premiers niveaux de recusion.</p>
+<img src="SquareKochHint.png" />
+</div></p>
+
+
+<p>Comme précédement, votre fonction <code>squareSide</code> doit seulement
+dessiner un coté de la figure, et le code fourni l'appellera 4 fois pour
+dessiner tous les cotés (chacun avec sa couleur).</p>
diff --git a/src/lessons/recursion/koch/SquareKoch.html b/src/lessons/recursion/koch/SquareKoch.html
new file mode 100644
index 0000000..9ce69fd
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKoch.html
@@ -0,0 +1,15 @@
+<h2>Snow square</h2>
+
+<p>This exercise is a variation over the snow flake that we saw previously.
+The main difference is that we are growing little squares instead of triangles
+on the sides of the figure.</p>
+
+<p><div class="tip" id="tip-1" alt="I don't see it, sorry. Please picture it.">
+<p>Here are the results of the first levels of recursion.</p>
+<img src="SquareKochHint.png" />
+</div></p>
+
+
+<p>As previously, your <code>squareSide</code> function should only draw one side
+of the figure, and the template will call it for all sides automatically (with one
+color per side).</p>
diff --git a/src/lessons/recursion/koch/SquareKoch.java b/src/lessons/recursion/koch/SquareKoch.java
new file mode 100644
index 0000000..3f9b4c3
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKoch.java
@@ -0,0 +1,44 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.core.model.lesson.ExerciseTemplated;
+import plm.core.model.lesson.Lesson;
+import plm.universe.World;
+import plm.universe.turtles.Turtle;
+import plm.universe.turtles.TurtleWorld;
+
+public class SquareKoch extends ExerciseTemplated {
+
+ public SquareKoch(Lesson lesson) {
+ super(lesson);
+
+ /* Create initial situation */
+ World[] myWorlds = new World[6];
+ myWorlds[0] = new TurtleWorld("snowSquare(0,200)", 400, 400);
+ myWorlds[0].setParameter(new Object[] {0,200.});
+ new Turtle(myWorlds[0], "Hawksbill", 100, 300, -90, Color.red);
+
+ myWorlds[1] = new TurtleWorld("snowSquare(1,200)", 400, 400);
+ myWorlds[1].setParameter(new Object[] {1,200.});
+ new Turtle(myWorlds[1], "Hawksbill", 100, 300, -90, Color.red);
+
+ myWorlds[2] = new TurtleWorld("snowSquare(2,200)", 400, 400);
+ myWorlds[2].setParameter(new Object[] {2,200.});
+ new Turtle(myWorlds[2], "Hawksbill", 100, 300, -90, Color.red);
+
+ myWorlds[3] = new TurtleWorld("snowSquare(3,200)", 400, 400);
+ myWorlds[3].setParameter(new Object[] {3,200.});
+ new Turtle(myWorlds[3], "Hawksbill", 100, 300,-90, Color.red);
+
+ myWorlds[4] = new TurtleWorld("snowSquare(4,200)", 400, 400);
+ myWorlds[4].setParameter(new Object[] {4,200.});
+ new Turtle(myWorlds[4], "Hawksbill", 100, 300,-90, Color.red);
+
+ myWorlds[5] = new TurtleWorld("snowSquare(5,200)", 400, 400);
+ myWorlds[5].setParameter(new Object[] {5,200.});
+ new Turtle(myWorlds[5], "Hawksbill", 100, 300,-90, Color.red);
+
+ setup(myWorlds);
+ }
+}
diff --git a/src/lessons/recursion/koch/SquareKochEntity.java b/src/lessons/recursion/koch/SquareKochEntity.java
new file mode 100644
index 0000000..7c4ffb7
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKochEntity.java
@@ -0,0 +1,61 @@
+package lessons.recursion.koch;
+
+import java.awt.Color;
+
+import plm.universe.turtles.Turtle;
+
+public class SquareKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ void snowSquare (int levels, double length) {
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.blue);
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.orange);
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.magenta);
+ squareSide(levels, length);
+ right(90);
+ }
+ void squareSide(int levels, double length) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ squareSide(levels-1, length/3);
+ left(90);
+ squareSide(levels-1, length/3);
+ right(90);
+ squareSide(levels-1, length/3);
+ right(90);
+ squareSide(levels-1, length/3);
+ left(90);
+ squareSide(levels-1, length/3);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+ public void drawHint() {
+ clear();
+ hide();
+ setColor(Color.red);
+ setPos(100,50);setHeading(0);
+ squareSide(0,200);
+
+ setPos(100,150); setHeading(0);
+ squareSide(1,200);
+
+ setPos(100,250); setHeading(0);
+ squareSide(2,200);
+
+ setPos(100,350); setHeading(0);
+ squareSide(3,200);
+ }
+
+ public void run() {
+ snowSquare((Integer)getParam(0),(Double)getParam(1));
+ }
+}
diff --git a/src/lessons/recursion/koch/SquareKochEntity.py b/src/lessons/recursion/koch/SquareKochEntity.py
new file mode 100644
index 0000000..4505075
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKochEntity.py
@@ -0,0 +1,33 @@
+# BEGIN TEMPLATE
+
+def squareSide(levels, length):
+ # BEGIN SOLUTION
+ if levels == 0:
+ forward(length)
+ else:
+ squareSide(levels-1, length/3)
+ left(90)
+ squareSide(levels-1, length/3)
+ right(90)
+ squareSide(levels-1, length/3)
+ right(90)
+ squareSide(levels-1, length/3)
+ left(90)
+ squareSide(levels-1, length/3)
+ # END SOLUTION
+
+def snowSquare (levels, length):
+ squareSide(levels, length)
+ right(90)
+ setColor(Color.blue)
+ squareSide(levels, length)
+ right(90)
+ setColor(Color.orange)
+ squareSide(levels, length)
+ right(90)
+ setColor(Color.magenta)
+ squareSide(levels, length)
+ right(90)
+# END TEMPLATE
+
+snowSquare(getParam(0), getParam(1))
diff --git a/src/lessons/recursion/koch/SquareKochEntity.scala b/src/lessons/recursion/koch/SquareKochEntity.scala
new file mode 100644
index 0000000..ef2630f
--- /dev/null
+++ b/src/lessons/recursion/koch/SquareKochEntity.scala
@@ -0,0 +1,44 @@
+package lessons.recursion.koch;
+
+import plm.universe.turtles.Turtle;
+import java.awt.Color
+
+class ScalaSquareKochEntity extends Turtle {
+
+ /* BEGIN TEMPLATE */
+ def snowSquare (levels:Int, length:Double) {
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.blue);
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.orange);
+ squareSide(levels, length);
+ right(90);
+ setColor(Color.magenta);
+ squareSide(levels, length);
+ right(90);
+ }
+ def squareSide(levels:Int, length:Double) {
+ /* BEGIN SOLUTION */
+ if (levels == 0) {
+ forward(length);
+ } else {
+ squareSide(levels-1, length/3);
+ left(90);
+ squareSide(levels-1, length/3);
+ right(90);
+ squareSide(levels-1, length/3);
+ right(90);
+ squareSide(levels-1, length/3);
+ left(90);
+ squareSide(levels-1, length/3);
+ }
+ /* END SOLUTION */
+ }
+ /* END TEMPLATE */
+
+ override def run() {
+ snowSquare(getParam(0).asInstanceOf[Int],getParam(1).asInstanceOf[Double]);
+ }
+}
diff --git a/src/lessons/recursion/koch/SquareKochHint.png b/src/lessons/recursion/koch/SquareKochHint.png
new file mode 100644
index 0000000..ccfaafc
Binary files /dev/null and b/src/lessons/recursion/koch/SquareKochHint.png differ
diff --git a/src/lessons/sort/dutchflag/DutchFlagAlgo.fr.html b/src/lessons/sort/dutchflag/DutchFlagAlgo.fr.html
new file mode 100644
index 0000000..e116c32
--- /dev/null
+++ b/src/lessons/sort/dutchflag/DutchFlagAlgo.fr.html
@@ -0,0 +1,33 @@
+<h1>Le problème du drapeau hollandais</h1>
+
+<p>Votre travail est de trier les couleurs du drapeau hollandais. La seule
+primitive à votre disposition permet d'échanger deux lignes données. De
+plus, vous ne devez pas créer de nouvelles variables (à l'exception de
+quelques indices).</p>
+
+<p>À la réflexion, on peut le faire en temps linéaire, en triant un élément à
+chaque étape de la boucle. Vous devriez peut-être réviser comment se passe
+le <a href="plm://lessons.sort.basic/insertion.AlgInsertionSort">tri par
+insertion</a>, car le tri du drapeau hollandais est une variation sur le
+thème. La principale différence est que vous n'avez pas un seul point
+d'insertion, mais 3...</p>
+
+ <div class="tip" id="tip-1" alt="J'ai besoin d'un indice pour commencer.">
+ Traversez vos données, en maintenant trois indices :
+ <ul>
+ <li><code>apresBleu</code> est initialisé à 0. Assurez vous de n'avoir que des
+cellules bleues entre 0 et <code>apresBleu</code> à tout moment.</li>
+ <li><code>blancRouge</code> est initialisé à taille-1. Assurez vous de n'avoir
+que des cellules rouges après <code>blancRouge</code>.</li>
+ <li><code>avantBlanc</code> est iniitialisé à taille-1. Assurez vous de n'avoir
+que des cellules blanches entre <code>avantBlanc</code> et
+<code>blancRouge</code>.</li>
+ </ul>
+ Remarques que les cellules non triées sont toujours entre
+<code>apresBleu</code> et <code>avantBlanc</code>.<br/>
+
+ À chaque étape de votre traversée, regardez la couleur de la case pointée
+par <code>apresBleu</code> et effectuez les échanges qui s'imposent. La
+boucle s'arrête quand <code>apresBleu</code> devient plus grand que
+<code>avantBlanc</code>.<br/>
+ </div>
\ No newline at end of file
diff --git a/src/lessons/sort/dutchflag/DutchFlagAlgo.html b/src/lessons/sort/dutchflag/DutchFlagAlgo.html
index 3ef5718..622fd1b 100644
--- a/src/lessons/sort/dutchflag/DutchFlagAlgo.html
+++ b/src/lessons/sort/dutchflag/DutchFlagAlgo.html
@@ -8,14 +8,14 @@ You may want to check again the <a href="plm://lessons.sort.basic/insertion.AlgI
of which the Dutch Flag sort is a variation. The main difference is that you have 3 insertion points, not only one...</p>
<div class="tip" id="tip-1" alt="I need an hint to start">
- <p>Do a traversal over your data, saving 3 indices:
+ Do a traversal over your data, saving 3 indices:
<ul>
<li><code>afterBlue</code> is initialized to 0. Make sure that every cell below <code>afterBlue</code> is filled with blue elements.</li>
<li><code>whiteRed</code> is initialized to size-1. Make sure that every cell after <code>whiteRed</code> is filled with red elements.</li>
<li><code>beforeWhite</code> is initialized to size-1. Make sure that every cell after <code>beforeWhite</code> and before <code>whiteRed</code> is filled with while elements.</li>
</ul>
- <p>Note that the unsorted cells are always between <code>afterBlue</code> and <code>beforeWhite</code>.</p>
+ Note that the unsorted cells are always between <code>afterBlue</code> and <code>beforeWhite</code>.<br/>
- <p>At each step of your traversal, check the color of the cell at <code>afterBlue</code> and do the required exchanges.
- The loop ending condition is when <code>afterBlue</code> becomes larger than <code>beforeWhite</code>.</p>
+ At each step of your traversal, check the color of the cell at <code>afterBlue</code> and do the required exchanges.
+ The loop ending condition is when <code>afterBlue</code> becomes larger than <code>beforeWhite</code>.<br/>
</div>
\ No newline at end of file
diff --git a/src/lessons/sort/dutchflag/Main.fr.html b/src/lessons/sort/dutchflag/Main.fr.html
new file mode 100644
index 0000000..9bd58dc
--- /dev/null
+++ b/src/lessons/sort/dutchflag/Main.fr.html
@@ -0,0 +1,19 @@
+<h1>Le problème du drapeau hollandais</h1>
+
+<p>Ce problème a été proposé pour la première fois par E.W.Dijkstra en 1976
+(dans le chapitre 14 de son livre «A discipline of Programming»). C'est une
+variation très étudiée du tri par insertion depuis. Ce tri est parfois utile
+dans la vraie vie, mais il est surtout célèbre pour ses vertus pédagogiques
+: calculer sa complexité n'est ni trop simple ni trop dur, démontrer sa
+correction est très accessible sans être complètement trivial. </p>
+
+<h3>Que puis-je faire pour améliorer cet univers de PLM?</h3>
+
+<p>Comme souvent, plusieurs points pourraient être améliorés dans le code de
+cet univers pour l'améliorer :</p>
+<ul>
+ <li>Une vue temporelle serait bienvenue.</li>
+ <li>D'autres exercices, par exemple avec seulement deux couleurs ou avec plus de
+3 couleurs, pourraient généraliser l'approche.</li>
+ <li>Ce problème peut être résolu récursivement.</li>
+</ul>
\ No newline at end of file
diff --git a/src/lessons/sort/dutchflag/short_desc.fr.html b/src/lessons/sort/dutchflag/short_desc.fr.html
new file mode 100644
index 0000000..749969b
--- /dev/null
+++ b/src/lessons/sort/dutchflag/short_desc.fr.html
@@ -0,0 +1,4 @@
+<h3>Le problème du drapeau hollandais</h3>
+
+<p>C'est un problème classique, qui constitue une variation du tri par
+insertion.</p>
diff --git a/src/lessons/sort/dutchflag/universe/DutchFlagWorld.fr.html b/src/lessons/sort/dutchflag/universe/DutchFlagWorld.fr.html
new file mode 100644
index 0000000..6acde80
--- /dev/null
+++ b/src/lessons/sort/dutchflag/universe/DutchFlagWorld.fr.html
@@ -0,0 +1,26 @@
+<h1>Le problème du drapeau hollandais</h1>
+
+<h2>Valeurs fournies</h2>
+
+<p>Les couleurs sont représentées par les constantes suivantes : BLEU, BLANC et
+ROUGE. Vous pouvez les utiliser directement dans votre code.</p>
+
+<h2>Fonctions fournies</h2>
+
+<p>Cet univers est très simple, avec seulement cinq fonctions fournies. </p>
+
+<pre>[!java]void [/!]echange([!java]int [/!]x[!scala]:Int[/!], [!java]int [/!]y[!scala]:Int[/!])</pre>
+Échange les lignes numéros <code>x</code> et <code>y</code>.
+
+<pre>[!java]int [/!]getTaille() [!scala]:Int[/!]</pre>
+Retourne le nombre de lignes sur ce drapeau.
+
+<pre>[!java]int [/!]getCouleur([!java]int [/!]line[!scala]:Int[/!]) [!scala]:Int[/!]</pre>
+Retourne la couleur d'une ligne donnée.
+
+<pre>[!java]boolean [/!]estTrie() [!scala]:Boolean[/!]</pre>
+Renvoie si le drapeau est correctement trié.
+
+<pre>[!java]boolean [/!]estSelectionne() [!scala]:Boolean[/!]</pre>
+Renvoi si le monde actuel est sélectionné dans l'interface graphique.
+
diff --git a/src/lessons/sort/dutchflag/universe/DutchFlagWorld.html b/src/lessons/sort/dutchflag/universe/DutchFlagWorld.html
index 8b01251..77dda5c 100644
--- a/src/lessons/sort/dutchflag/universe/DutchFlagWorld.html
+++ b/src/lessons/sort/dutchflag/universe/DutchFlagWorld.html
@@ -1,5 +1,9 @@
<h1>The Dutch Flag Problem</h1>
-<p>The colors are represented by integers (either 0, 1 or 2). </p>
+
+<h2>Provided values</h2>
+
+<p>The colors are represented through the following constants: BLUE, WHITE and RED.
+You can use them directly in your code.</p>
<h2>Provided functions</h2>
diff --git a/src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java b/src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java
index abbc87f..26f1f1e 100644
--- a/src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java
+++ b/src/lessons/sort/dutchflag/universe/DutchFlagWorldView.java
@@ -1,49 +1,46 @@
package lessons.sort.dutchflag.universe;
import java.awt.Color;
+import java.awt.Cursor;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Shape;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import plm.core.model.Game;
import plm.core.ui.WorldView;
+import plm.universe.EntityControlPanel;
import plm.universe.World;
-public class DutchFlagWorldView extends WorldView {
+public class DutchFlagWorldView extends WorldView {
private static final long serialVersionUID = 1L;
private double height;
-
+ private int rankFrom=-1; // DnD marker
+
public DutchFlagWorldView(World w) {
super(w);
-
- addMouseListener(new MouseListener() {
- @Override
- public void mouseReleased(MouseEvent e) {}
- @Override
- public void mousePressed(MouseEvent e) {}
- @Override
- public void mouseExited(MouseEvent e) {}
- @Override
- public void mouseEntered(MouseEvent e) {}
-
- @Override
- public void mouseClicked(MouseEvent e) {
-// int rank = (int) (e.getY()/height);
-
-// ((DutchFlagWorld) world).setSelectedPancake(rank+1);
-// if (e.getClickCount()==2)
-// ((DutchFlagWorld) world).doMove();
- }
- });
-
+ new DragSource().createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, new DutchDragGestureListener());
+ DropTarget dropTarget=new DropTarget(this,new DutchDropTargetListener());
+ dropTarget.setActive(true); // We accept drops
+ this.setDropTarget(dropTarget);
}
-
private static final Color dutchRed = new Color(174,28,40);
private static final Color dutchBlue = new Color(33,70,139);
/**
@@ -63,7 +60,7 @@ public class DutchFlagWorldView extends WorldView {
g2.setColor(Color.white);
g2.fill(new Rectangle2D.Double(0., 0., getWidth(), getHeight()));
- /* Draw the pancakes */
+ /* Draw the lines */
int stackSize = flag.getSize();
height = ((double)getHeight()) / stackSize;
@@ -87,13 +84,100 @@ public class DutchFlagWorldView extends WorldView {
g2.setColor(Color.black);
g2.draw(rect);
}
-
}
+ // Display the amount of moves
if (flag.getColor(stackSize-1) == DutchFlagEntity.WHITE)
g2.setColor(Color.black);
else
g2.setColor(Color.yellow);
g2.drawString(""+flag.moveCount+" moves", 0, 15);
+
+ // Display the DnD markers
+ if (flag.getSize()<100 && rankFrom != -1) {
+ g2.setColor(Color.red);
+ g2.draw(new Rectangle2D.Double(0, height*(stackSize-rankFrom-1), getWidth(), height));
+ g2.draw(new Rectangle2D.Double(1, height*(stackSize-rankFrom-1)+1, getWidth()-2, height-2));
+ g2.setColor(Color.white);
+ g2.draw(new Rectangle2D.Double(2, height*(stackSize-rankFrom-1)+2, getWidth()-4, height-4));
+ g2.draw(new Rectangle2D.Double(3, height*(stackSize-rankFrom-1)+3, getWidth()-6, height-6));
+ }
+ }
+
+
+ class DutchDragGestureListener implements DragGestureListener {
+ @Override
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ if (world.isAnswerWorld()) // Don't change the correction
+ return;
+
+ DutchFlagWorld flag = (DutchFlagWorld) world;
+
+ rankFrom = flag.getSize() - dge.getDragOrigin().y/((int)height) - 1;
+ DutchFlagWorldView.this.paintImmediately(getVisibleRect());
+
+ dge.startDrag(DragSource.DefaultMoveDrop,new TransferableLine(rankFrom));
+ }
+ }
+ class DutchDropTargetListener implements DropTargetListener {
+ @Override
+ public void dragEnter(DropTargetDragEvent dtde) {
+ setCursor(DragSource.DefaultMoveDrop);
+ }
+ @Override
+ public void dragOver(DropTargetDragEvent dtde) {/* */}
+ @Override
+ public void dropActionChanged(DropTargetDragEvent dtde) {/* tell your mum */}
+ @Override
+ public void dragExit(DropTargetEvent dte) {
+ setCursor(Cursor.getDefaultCursor());
+ }
+ @Override
+ public void drop(DropTargetDropEvent dtde) {
+ dtde.acceptDrop(DnDConstants.ACTION_MOVE);
+ DutchFlagWorld flag = (DutchFlagWorld) world;
+ int rankTo = flag.getSize() - dtde.getLocation().y/((int)height) - 1;
+
+ // That's unheaven: we get the rankFrom directly from a global, not from the transferable...
+ //Integer rankFrom = (Integer) dtde.getTransferable().getTransferData(TransferableLine.dutchLineFlavor);
+ dtde.dropComplete(true);
+ if (rankFrom != rankTo) {
+ EntityControlPanel.echo(Game.i18n.tr("swap({0},{1})",rankFrom,rankTo));
+ flag.swap(rankFrom, rankTo);
+ }
+
+ rankFrom = -1;
+ paintImmediately(getVisibleRect());
+ DutchFlagWorldView.this.setCursor(Cursor.getDefaultCursor());
+
+ }
+ }
+}
+
+
+class TransferableLine implements Transferable { // Actually not used, but to prevent people from accepting our own drops
+ static DataFlavor dutchLineFlavor = new DataFlavor(Integer.class,"DutchFlag line");
+ private Integer rank;
+ public TransferableLine(int _rank) {
+ rank = _rank;
+ }
+
+ @Override
+ public DataFlavor[] getTransferDataFlavors() {
+ return new DataFlavor[] {dutchLineFlavor};
+ }
+
+ @Override
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return flavor.equals(dutchLineFlavor);
+ }
+
+ @Override
+ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
+
+ if (flavor.equals(dutchLineFlavor))
+ return rank;
+ throw new UnsupportedFlavorException(flavor);
}
+
}
diff --git a/src/lessons/sort/pancake/universe/PancakeWorld.java b/src/lessons/sort/pancake/universe/PancakeWorld.java
index b040714..a0a1033 100644
--- a/src/lessons/sort/pancake/universe/PancakeWorld.java
+++ b/src/lessons/sort/pancake/universe/PancakeWorld.java
@@ -35,7 +35,7 @@ public class PancakeWorld extends World {
// http://omgwtflols.deviantart.com/art/Pixel-Art-Pancakes-with-syrup-298700868
@Override
public ImageIcon getIcon() {
- return ResourcesCache.getIcon(this,"../img/world_pancake.png");
+ return ResourcesCache.getIcon(this,"world_pancake.png");
}
PancakeFlipButtonPanel panel = null;
/** Returns the panel which let the user to interact dynamically with the world */
@@ -236,7 +236,7 @@ public class PancakeWorld extends World {
*/
public int getPancakeRadius(int rank) {
if ( rank < 0 || rank >= getStackSize())
- throw new IllegalArgumentException(Game.i18n.tr("Cannot get the radius of pancake #{0} because it''s not between 0 and {1}",rank, getStackSize()));
+ throw new IllegalArgumentException(Game.i18n.tr("Cannot get the radius of pancake #{0} because it''s not between 0 and {1}",rank, getStackSize()-1));
return pancakeStack[rank].getRadius();
}
diff --git a/src/lessons/sort/pancake/img/world_pancake.png b/src/lessons/sort/pancake/universe/world_pancake.png
similarity index 100%
rename from src/lessons/sort/pancake/img/world_pancake.png
rename to src/lessons/sort/pancake/universe/world_pancake.png
diff --git a/src/lessons/sort/pancake/img/world_pancake.svg b/src/lessons/sort/pancake/universe/world_pancake.svg
similarity index 100%
rename from src/lessons/sort/pancake/img/world_pancake.svg
rename to src/lessons/sort/pancake/universe/world_pancake.svg
diff --git a/src/lessons/turtleart/short_desc.html b/src/lessons/turtleart/short_desc.html
index 5426877..5e482f5 100644
--- a/src/lessons/turtleart/short_desc.html
+++ b/src/lessons/turtleart/short_desc.html
@@ -1,5 +1,6 @@
<h3>Turtle Art</h3>
-<p>Draw beautiful figures with the Logo turtle, and learn programming while playing.</p>
+<p>Draw beautiful figures with the Logo turtle, and learn programming
+while playing.</p>
<p>You should know the basic syntax of the programming language you will choose,
but no exhaustive programming practice is required to take this lesson.</p>
diff --git a/src/lessons/welcome/array/basics/Array1.fr.html b/src/lessons/welcome/array/basics/Array1.fr.html
index 571743b..a9444d9 100644
--- a/src/lessons/welcome/array/basics/Array1.fr.html
+++ b/src/lessons/welcome/array/basics/Array1.fr.html
@@ -286,11 +286,11 @@ liste[/!].
[!python]Le plus simple pour cela est de créer une liste vide puis d'y
adjoindre (avec <code>append()</code> les différentes couleurs lues sur le
sol de la première colonne (avec <code>getCouleurSol()</code>).[/!]
-[!java|scala]Pour cela, il faut déclarer et créer un tableau de
-<code>Color</code>s. Attention, les différents mondes ne sont pas tous de la
-même taille et il faut utiliser <code>getMondeHauteur()</code> pour trouver
-la taille du monde courant. Une fois créé, remplissez le tableau en lisant
-les couleurs au sol de la première colonne (avec
+[!java|scala]Pour cela, il faut déclarer et créer un tableau de variables de
+type <code>Color</code>. Attention, les différents mondes ne sont pas tous
+de la même taille et il faut utiliser <code>getMondeHauteur()</code> pour
+trouver la taille du monde courant. Une fois créé, remplissez le tableau en
+lisant les couleurs au sol de la première colonne (avec
<code>getCouleurSol()</code>).[/!]</p>
<p>Une fois le motif de la première colonne lu et sauvegardé, il faut le
diff --git a/src/lessons/welcome/bat/bool1/HasTeen.fr.html b/src/lessons/welcome/bat/bool1/HasTeen.fr.html
index 189109f..01e5b88 100644
--- a/src/lessons/welcome/bat/bool1/HasTeen.fr.html
+++ b/src/lessons/welcome/bat/bool1/HasTeen.fr.html
@@ -1,5 +1,5 @@
<h1>A des ados</h1>
-On dira qu'un nombre est "ado" s'il appartient à l'intervale [13;19]. Étant
+On dira qu'un nombre est "ado" s'il appartient à l'intervalle [13;19]. Étant
donné trois nombres entiers, retournez vrai ssi un ou plusieurs d'entre eux
sont ados.
diff --git a/src/lessons/welcome/bat/bool1/In1020.fr.html b/src/lessons/welcome/bat/bool1/In1020.fr.html
index 846bacf..136aee9 100644
--- a/src/lessons/welcome/bat/bool1/In1020.fr.html
+++ b/src/lessons/welcome/bat/bool1/In1020.fr.html
@@ -1,6 +1,6 @@
<h1>Dans [10;20]</h1>
Étant donné deux nombres entiers, retournez vrai s'un d'entre eux est dans
-l'intervale [10;20].
+l'intervalle [10;20].
<p>Cet exercice a été extrait de l'excellent site d'exercices
http://javabat.com/ pour PLM.</p>
diff --git a/src/lessons/welcome/bat/bool1/In3050.fr.html b/src/lessons/welcome/bat/bool1/In3050.fr.html
index e5f5791..cd2373a 100644
--- a/src/lessons/welcome/bat/bool1/In3050.fr.html
+++ b/src/lessons/welcome/bat/bool1/In3050.fr.html
@@ -1,6 +1,6 @@
<h1>Dans [30;50]</h1>
Étant donné deux nombres entiers, retournez vrai s'ils sont tous les deux
-dans l'intervale [30;40], ou s'ils sont tous les deux dans l'intervale
+dans l'intervalle [30;40], ou s'ils sont tous les deux dans l'intervalle
[40;50].
<p>Cet exercice a été extrait de l'excellent site d'exercices
diff --git a/src/lessons/welcome/bat/bool1/LoneTeen.fr.html b/src/lessons/welcome/bat/bool1/LoneTeen.fr.html
index 8eec9aa..53b1f96 100644
--- a/src/lessons/welcome/bat/bool1/LoneTeen.fr.html
+++ b/src/lessons/welcome/bat/bool1/LoneTeen.fr.html
@@ -1,5 +1,5 @@
<h1>Ado solitaire</h1>
-On dira qu'un nombre est "ado" s'il appartient à l'intervale [13;19]. Étant
+On dira qu'un nombre est "ado" s'il appartient à l'intervalle [13;19]. Étant
donné deux nombres entiers, retournez vrai si l'un d'entre eux est ado, mais
pas les deux.
diff --git a/src/lessons/welcome/bat/bool1/Max1020.fr.html b/src/lessons/welcome/bat/bool1/Max1020.fr.html
index 542f7f6..f9844b8 100644
--- a/src/lessons/welcome/bat/bool1/Max1020.fr.html
+++ b/src/lessons/welcome/bat/bool1/Max1020.fr.html
@@ -1,7 +1,7 @@
<h1>Max1020</h1>
<p>Étant donné deux nombres entiers, retournez la plus grande valeur dans
-l'intervale 10..20 inclus, ou retournez 0 si aucun des nombres n'est dans
-cet intervale.</p>
+l'intervalle 10..20 inclus, ou retournez 0 si aucun des nombres n'est dans
+cet intervalle.</p>
[!scala]<p>Notez que Math.max(Int,Int):Int et Math.min(Int,Int):Int retournent
respectivement le maximum et le minimum de deux entiers.</p>[/!]
diff --git a/src/lessons/welcome/bat/bool1/ParotTrouble.fr.html b/src/lessons/welcome/bat/bool1/ParotTrouble.fr.html
index 6bc1311..d86815d 100644
--- a/src/lessons/welcome/bat/bool1/ParotTrouble.fr.html
+++ b/src/lessons/welcome/bat/bool1/ParotTrouble.fr.html
@@ -1,7 +1,7 @@
<h1>Problème de perroquet</h1>
Nous avons un perroquet très bruyant. Le paramètre "hour" indique l'heure
-courante (dans l'intervale [0;23]). Nous avons un problème si le perroquet
+courante (dans l'intervalle [0;23]). Nous avons un problème si le perroquet
parle avant 7h ou après 20h. Retournez vrai si nous avons un problème.
<p>Cet exercice a été extrait de l'excellent site d'exercices
diff --git a/src/lessons/welcome/bat/bool2/AlarmClock.fr.html b/src/lessons/welcome/bat/bool2/AlarmClock.fr.html
index 9258b05..443bb49 100644
--- a/src/lessons/welcome/bat/bool2/AlarmClock.fr.html
+++ b/src/lessons/welcome/bat/bool2/AlarmClock.fr.html
@@ -1,7 +1,7 @@
<h1>Radio réveil</h1>
Étant donné le jour de la semaine, codé de la façon suivante : 0=Dimanche,
1=Lundi, 2=Mardi, ... 6=Samedi, et un booléen vacation indiquant si nous
-sommes en vacances, retournez une chaine de caractères de la forme "7:00"
+sommes en vacances, retournez une chaîne de caractères de la forme "7:00"
indiquant à quelle heure nous devons régler le radio-réveil. Les jours de la
semaine, nous devons nous réveiller à 7h tandis que nous pouvons dormir
jusqu'à 10h le week-end. Pendant les vacances, il nous faut nous lever à 10h
diff --git a/src/lessons/welcome/bat/bool2/GreenTicket.fr.html b/src/lessons/welcome/bat/bool2/GreenTicket.fr.html
index 2549464..672a07b 100644
--- a/src/lessons/welcome/bat/bool2/GreenTicket.fr.html
+++ b/src/lessons/welcome/bat/bool2/GreenTicket.fr.html
@@ -1,5 +1,5 @@
<h1>Ticket vert</h1>
-Vous avez un ticket de lotterie vert, avec des entiers a, b et c inscrits
+Vous avez un ticket de loterie vert, avec des entiers a, b et c inscrits
dessus. Si les nombres sont tous différents les uns des autres, le résultat
est 0. Si tous les nombres sont identiques, le résultat est 20. Si deux des
nombres sont les mêmes, le résultat est 10.
diff --git a/src/lessons/welcome/bat/bool2/In1To10.fr.html b/src/lessons/welcome/bat/bool2/In1To10.fr.html
index 223c2e3..21c7687 100644
--- a/src/lessons/welcome/bat/bool2/In1To10.fr.html
+++ b/src/lessons/welcome/bat/bool2/In1To10.fr.html
@@ -1,7 +1,7 @@
<h1>De 1 à 10</h1>
-Soit un nombre n, renvoyez vrai si n est dans l'intervalle [1,10]. Sauf
-si"outsideMode" est vrai, auquel cas renvoyez vrai si le nombre est plus
-petit ou égal à 1 ou bien s'il est plus grand ou égal à 10
+Soit un nombre n, renvoyez vrai si n est dans l'intervalle [1,10]. Sauf si
+"outsideMode" est vrai, auquel cas renvoyez vrai si le nombre est plus petit
+ou égal à 1 ou bien s'il est plus grand ou égal à 10
<p>Cet exercice a été extrait de l'excellent site d'exercices
diff --git a/src/lessons/welcome/bat/bool2/RedTicket.fr.html b/src/lessons/welcome/bat/bool2/RedTicket.fr.html
index e5fa44e..60a51f2 100644
--- a/src/lessons/welcome/bat/bool2/RedTicket.fr.html
+++ b/src/lessons/welcome/bat/bool2/RedTicket.fr.html
@@ -1,5 +1,5 @@
<h1>Ticket rouge</h1>
-Vous avez un ticket de lotterie rouge comportant trois entiers a, b et
+Vous avez un ticket de loterie rouge comportant trois entiers a, b et
c. Chacun d'entre eux est 0, 1, ou 2. Si ils sont tous comme valeur 2, le
résultat vaut 10. Sinon, si ils sont égaux, le résultat vaut 5. Sinon, tant
que b et c sont différents de a, le résultat vaut 1. Sinon, le résultat est
diff --git a/src/lessons/welcome/bat/bool2/SquirrelPlay.fr.html b/src/lessons/welcome/bat/bool2/SquirrelPlay.fr.html
index 6ee7e8a..6154da6 100644
--- a/src/lessons/welcome/bat/bool2/SquirrelPlay.fr.html
+++ b/src/lessons/welcome/bat/bool2/SquirrelPlay.fr.html
@@ -1,8 +1,8 @@
<h1>Jeu de l'écureuil</h1>
Les écureuils dans Palo Alto passent la majorité de leurs journées à
-jouer. En particulier, ils jouent si la température est entre 60 et 90 (
-inclus ). A moins que ce soit l'été, alors la limite supérieure est de 100
-au lieu de 90.Soit une température entière et un booléen isSummer.
+jouer. En particulier, ils jouent si la température est entre 60 et 90
+(inclus). A moins que ce soit l'été, alors la limite supérieure est de 100
+au lieu de 90. Soit une température entière et un booléen isSummer.
Renvoyez vrai si les écureuils jouent et faux sinon.
diff --git a/src/lessons/welcome/bat/bool2/TeenSum.fr.html b/src/lessons/welcome/bat/bool2/TeenSum.fr.html
index 9b473a9..1b45319 100644
--- a/src/lessons/welcome/bat/bool2/TeenSum.fr.html
+++ b/src/lessons/welcome/bat/bool2/TeenSum.fr.html
@@ -1,6 +1,6 @@
<h1>Somme d'ados</h1>
Étant donné deux nombres entiers (a et b), renvoyez leur somme. Cependant,
-les valeurs ados (dans l'intervale [13;19]) sont particulièrement
+les valeurs ados (dans l'intervalle [13;19]) sont particulièrement
chanceuses. Donc, si l'un des nombres est ado, renvoyez simplement 19.
diff --git a/src/lessons/welcome/loopfor/LoopForEntity.py b/src/lessons/welcome/loopfor/LoopForEntity.py
index 1326f7d..1c965c6 100644
--- a/src/lessons/welcome/loopfor/LoopForEntity.py
+++ b/src/lessons/welcome/loopfor/LoopForEntity.py
@@ -1,10 +1,10 @@
-def forward(i=-1):
- if i==-1:
+def forward(i=1):
+ if i==1:
entity.forward()
else:
errorMsg("Sorry Dave, I cannot let you use forward with an argument in this exercise. Use a loop instead.")
-def backward(i=-1):
- if i==-1:
+def backward(i=1):
+ if i==1:
entity.backward()
else:
errorMsg("Sorry Dave, I cannot let you use backward with an argument in this exercise. Use a loop instead.")
diff --git a/src/lessons/welcome/methods/args/MethodsArgsEntity.py b/src/lessons/welcome/methods/args/MethodsArgsEntity.py
index 9f5cde3..480604e 100644
--- a/src/lessons/welcome/methods/args/MethodsArgsEntity.py
+++ b/src/lessons/welcome/methods/args/MethodsArgsEntity.py
@@ -20,4 +20,4 @@ def move(nbPas, doforward):
backward()
# END SOLUTION
-move(getY(), entity.getDirection().toString() == "NORTH")
+move(getY(), entity.getDirection() == Direction.NORTH)
diff --git a/src/plm/core/model/LessonRunner.java b/src/plm/core/model/LessonRunner.java
index 5dbf7e1..16d46b4 100644
--- a/src/plm/core/model/LessonRunner.java
+++ b/src/plm/core/model/LessonRunner.java
@@ -108,7 +108,8 @@ public class LessonRunner extends Thread {
if (exo.lastResult.passedTests > 1) {
selectedValue = (Lecture) JOptionPane.showInputDialog(null,
- i18n.tr("Congratulations, you passed this exercise.\n({0} tests passed)\nWhich exercise will you do now?"),
+ i18n.tr("Congratulations, you passed this exercise.\n({0} tests passed)\nWhich exercise will you do now?",
+ exo.lastResult.passedTests),
i18n.tr("Exercice passed \\o/"),
JOptionPane.PLAIN_MESSAGE, ResourcesCache.getIcon("img/trophy.png"),
nextExercises.toArray(), nextExercises.get(0));
diff --git a/src/plm/core/model/session/SourceFile.java b/src/plm/core/model/session/SourceFile.java
index dcb9e93..6bfc96e 100644
--- a/src/plm/core/model/session/SourceFile.java
+++ b/src/plm/core/model/session/SourceFile.java
@@ -85,7 +85,7 @@ public class SourceFile {
System.out.println("pattern key: "+pattern.getKey());
System.out.println("pattern value: "+pattern.getValue());
System.out.println("Exercise: "+Game.getInstance().getCurrentLesson().getCurrentExercise().getName());
- System.out.println("JLM version: "+Game.getProperty("plm.major.version","internal",false)+" ("+Game.getProperty("plm.major.version","internal",false)+"."+Game.getProperty("plm.minor.version","",false)+")");
+ System.out.println("PLM version: "+Game.getProperty("plm.major.version","internal",false)+" ("+Game.getProperty("plm.major.version","internal",false)+"."+Game.getProperty("plm.minor.version","",false)+")");
System.out.println("Java version: "+System.getProperty("java.version")+" (VM version: "+ System.getProperty("java.vm.version")+")");
System.out.println("System: " +System.getProperty("os.name")+" (version: "+System.getProperty("os.version")+"; arch: "+ System.getProperty("os.arch")+")");
}
diff --git a/src/plm/core/ui/AboutLessonDialog.java b/src/plm/core/ui/AboutLessonDialog.java
index 0f5a91c..a097ea2 100644
--- a/src/plm/core/ui/AboutLessonDialog.java
+++ b/src/plm/core/ui/AboutLessonDialog.java
@@ -2,9 +2,6 @@ package plm.core.ui;
import javax.swing.JFrame;
-import org.xnap.commons.i18n.I18n;
-import org.xnap.commons.i18n.I18nFactory;
-
import plm.core.model.Game;
@@ -12,8 +9,6 @@ public class AboutLessonDialog extends AbstractAboutDialog {
private static final long serialVersionUID = 1766486738385426108L;
- public I18n i18n = I18nFactory.getI18n(getClass(),"org.plm.i18n.Messages",getLocale(), I18nFactory.FALLBACK);
-
public AboutLessonDialog(JFrame parent) {
super(parent);
currentLessonHasChanged();
@@ -21,7 +16,7 @@ public class AboutLessonDialog extends AbstractAboutDialog {
@Override
public void currentLessonHasChanged() {
- setTitle(i18n.tr("About lesson - ") + Game.getInstance().getCurrentLesson().getName());
+ setTitle(Game.i18n.tr("About lesson - ") + Game.getInstance().getCurrentLesson().getName());
area.setText(Game.getInstance().getCurrentLesson().getAbout());
area.setCaretPosition(0);
diff --git a/src/plm/core/ui/AboutPLMDialog.java b/src/plm/core/ui/AboutPLMDialog.java
index 8d06191..b757fb3 100644
--- a/src/plm/core/ui/AboutPLMDialog.java
+++ b/src/plm/core/ui/AboutPLMDialog.java
@@ -2,26 +2,28 @@ package plm.core.ui;
import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.regex.Pattern;
import javax.swing.JButton;
import javax.swing.JDialog;
+import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JPanel;
-
-import org.xnap.commons.i18n.I18n;
-import org.xnap.commons.i18n.I18nFactory;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.ScrollPaneConstants;
import plm.core.model.Game;
+import plm.core.utils.FileUtils;
public class AboutPLMDialog extends JDialog {
private static final long serialVersionUID = -1800747039420103759L;
private static AboutPLMDialog instance = null;
- public I18n i18n = I18nFactory.getI18n(getClass(),"org.plm.i18n.Messages",getLocale(), I18nFactory.FALLBACK);
-
public static AboutPLMDialog getInstance() {
if (AboutPLMDialog.instance == null)
@@ -31,44 +33,106 @@ public class AboutPLMDialog extends JDialog {
private AboutPLMDialog() {
super(MainFrame.getInstance(), "About PLM", true);
- this.setTitle(i18n.tr("About PLM dialogTitle"));
+ this.setTitle(Game.i18n.tr("About PLM"));
initComponent();
}
public void initComponent() {
+ JTabbedPane tabs = new JTabbedPane();
- JPanel upperPane = new JPanel();
- upperPane.setLayout(new BorderLayout());
+ JPanel aboutPane = new JPanel();
+ aboutPane.setBackground(Color.white);
+ aboutPane.setLayout(new BorderLayout());
JLabel icon = new JLabel(ResourcesCache.getIcon("img/BuggleQuestBack.png"));
- upperPane.add(BorderLayout.NORTH, icon);
+ aboutPane.add(BorderLayout.NORTH, icon);
JLabel iconTitle = new JLabel(ResourcesCache.getIcon("img/BuggleQuestBETA.png"));
- upperPane.add(BorderLayout.CENTER, iconTitle);
+ aboutPane.add(BorderLayout.CENTER, iconTitle);
- JLabel text = new JLabel(
+ JLabel text = new JLabel(Game.i18n.tr(
"<html>"+
- "<h3 style=\"color:#666666;margin:0px;padding:0px;\">version "+Game.getProperty("plm.major.version","internal",false)+" "+
- "<span style=\"font-size:8px; color:#AAAAAA;margin:0px;padding:0px;\">("+Game.getProperty("plm.major.version","internal",false)+"."+Game.getProperty("plm.minor.version","",false)+")</span>"+
+ "<h3 style=\"color:#666666;margin:0px;padding:0px;\">version {0} "+
+ "<span style=\"font-size:8px; color:#AAAAAA;margin:0px;padding:0px;\">({1})</span>"+
"</h3>"+
"<br/>"+
"© 2008-2011 Contributors. All rights reserved.<br/>"+
"<ul style=\"margin-left:20px;\">" +
"<li>Original idea: <i>L. Turbak (Wellesley College)</i></li>"+
"<li>Design and code: <i>M. Quinson and G. Oster</i></li>"+
- "<li>Tests: <i>esial students (class '11, '12, '13, '14)</i></li>"+
+ "<li>Tests: <i>Telecom Nancy students (all classes since ''11)</i></li>"+
"</ul><br/>"+
- "Your code is saved to "+Game.getSavingLocation()+"<br/>"+
- "</html>"
+ "Your code is saved to {2}<br/>"+
+ "</html>",
+ Game.getProperty("plm.major.version","internal",false),
+ Game.getProperty("plm.major.version","internal",false)+"."+Game.getProperty("plm.minor.version","",false),
+ Game.getSavingLocation())
);
text.setBackground(Color.white);
text.setOpaque(true);
- upperPane.add(BorderLayout.SOUTH, text);
+ aboutPane.add(BorderLayout.SOUTH, text);
+
+ tabs.add(Game.i18n.tr("About"),aboutPane);
+
+ JEditorPane changelogArea = new JEditorPane("text/html","");
+ changelogArea.setEditorKit(new PlmHtmlEditorKit());
+ changelogArea.setEditable(false);
+ try {
+ StringBuffer ctn = new StringBuffer();
+ Pattern itemPattern = Pattern.compile("^ +[*].*");
+ for (String s:FileUtils.readContentAsText("ChangeLog",null,false).toString().split("\n")) {
+ if (s.startsWith("20")) // all releases are done in this century
+ ctn.append("</ul><h2>"+s+"</h2><ul>\n");
+ else if (itemPattern.matcher(s).matches())
+ ctn.append(s.replaceFirst("[*]", "<li>"));
+ else
+ ctn.append(s+"\n");
+ }
+ changelogArea.setText(ctn.toString());
+ changelogArea.setCaretPosition(0);
+ } catch (Exception e) {
+ System.out.println("ChangeLog not found. Broken jarfile.");
+ }
+ JScrollPane sp = new JScrollPane(changelogArea);
+ sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ tabs.add(Game.i18n.tr("Changes"),sp);
+
+ JEditorPane licenseArea = new JEditorPane("text/html","");
+ licenseArea.setEditorKit(new PlmHtmlEditorKit());
+ licenseArea.setEditable(false);
+ licenseArea.setText(Game.i18n.tr(
+ "<h2>PLM is proudly Free Software</h2>"
+ + ""
+ + "<p>Copyright (c) 2008-2013.<br/> "
+ + "The PLM Team: Martin Quinson, Gérald Oster and others.<br/> "
+ + "(see the git logs for the exact authorship of each file).</p> "
+ + ""
+ + "<p>The PLM software was written internally by the team. This software is "
+ + "distributed under the GNU general public license version 3 (GPLv3).</p> "
+ + ""
+ + "<p>The pedagogical material distributed with the PLM is covered both by "
+ + "the GPLv3 license (mainly for the included code) and by the CC-BY-SA "
+ + "license (mainly for the other media files). But the exact boundary "
+ + "here between the source code and the media is left as an exercise to "
+ + "the reader, so this material is distributed under both licenses for "
+ + "sake of simplicity.</p>"
+ + ""
+ + "<p>The GPLv3 license can be found in the archive under the name "
+ + "LICENSE-GPL-3. The CC-BY-SA license can be found online: "
+ + "http://creativecommons.org/licenses/by-sa/3.0/</p>"
+ + ""
+ + "<p>The whole artwork is free content, licenced under CC-BY-SA, GPL, LGPL "
+ + "and/or CC0-public domain. Some parts were done by us, other parts were "
+ + "borowed from free collections. The specific license and origin of each "
+ + "files is listed in the COPYING file distributed with the archive.</p>"
+ ));
+ licenseArea.setCaretPosition(0);
+ tabs.add(Game.i18n.tr("Copying"),new JScrollPane(licenseArea));
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
- pane.add(BorderLayout.CENTER, upperPane);
+ pane.add(BorderLayout.CENTER, tabs);
- JButton close = new JButton(i18n.tr("Close"));
+ JButton close = new JButton(Game.i18n.tr("Close"));
close.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -78,10 +142,12 @@ public class AboutPLMDialog extends JDialog {
pane.add(BorderLayout.SOUTH, close);
setContentPane(pane);
+ pane.setPreferredSize(new Dimension(400, MainFrame.getInstance().getSize().height));
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
pack();
- setResizable(false);
+ setResizable(true);
+ close.requestFocusInWindow();
setLocationRelativeTo(getParent());
}
diff --git a/src/plm/core/ui/ChooseLectureDialog.java b/src/plm/core/ui/ChooseLectureDialog.java
index 2a71a19..051c607 100644
--- a/src/plm/core/ui/ChooseLectureDialog.java
+++ b/src/plm/core/ui/ChooseLectureDialog.java
@@ -1,6 +1,7 @@
package plm.core.ui;
import java.awt.Component;
+import java.awt.Dimension;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
@@ -66,9 +67,12 @@ public class ChooseLectureDialog implements TreeSelectionListener {
tree.setSelectionPath(path);
JScrollPane jsp = new JScrollPane(tree);
+ jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+ jsp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
JPanel p = new JPanel();
p.add(jsp);
+ p.setMaximumSize(new Dimension(250,MainFrame.getInstance().getHeight()-120));
int result = JOptionPane.showConfirmDialog(MainFrame.getInstance(), p, Game.i18n.tr("Choose your next exercise"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (result == JOptionPane.OK_OPTION) {
diff --git a/src/plm/core/ui/FeedbackDialog.java b/src/plm/core/ui/FeedbackDialog.java
index dbb4e91..eff5b4a 100644
--- a/src/plm/core/ui/FeedbackDialog.java
+++ b/src/plm/core/ui/FeedbackDialog.java
@@ -70,7 +70,7 @@ public class FeedbackDialog extends JDialog {
"automatically be added to your feedback. None of these automatic information <br/>" +
"are personal and you still have to identify yourself if you want to.</p>" +
- "<p>Alternatively, you can use the <a href='http://github.com/oster/JLM/issues'>github interface</a> for feedback.</p></html>"));
+ "<p>Alternatively, you can use the <a href='http://github.com/oster/PLM/issues'>github interface</a> for feedback.</p></html>"));
explain.setBackground(new Color(235,235,235));
explain.setOpaque(true);
explain.setEditable(false);
diff --git a/src/plm/core/ui/MainFrame.java b/src/plm/core/ui/MainFrame.java
index a25dcb6..3ecc04f 100644
--- a/src/plm/core/ui/MainFrame.java
+++ b/src/plm/core/ui/MainFrame.java
@@ -1,15 +1,20 @@
package plm.core.ui;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
+import java.awt.image.BufferedImage;
import java.io.File;
+import java.io.IOException;
import java.util.Locale;
+import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
+import javax.swing.CellRendererPane;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBoxMenuItem;
@@ -75,7 +80,7 @@ public class MainFrame extends JFrame implements GameStateListener, GameListener
private JButton exoChangeButton;
private JMenu menuFile;
- private JMenuItem miFileLoad,miFileSwitch,miFileExercise,miFileConsole=null,miFileCourse,miFileQuit;
+ private JMenuItem miFileSavePicture,miFileLoad,miFileSwitch,miFileExercise,miFileConsole=null,miFileCourse,miFileQuit;
private JMenu menuSession;
private JMenuItem miSessionRevert, miSessionExport, miSessionImport, miSessionExportToCloud, miSessionImportFromCloud, miSessionDebug, miSessionCreative;
@@ -158,27 +163,69 @@ public class MainFrame extends JFrame implements GameStateListener, GameListener
menuFile.setMnemonic(KeyEvent.VK_F);
menuFile.getAccessibleContext().setAccessibleDescription(i18n.tr("File related functions"));
+ miFileSavePicture = new JMenuItem(new AbstractGameAction(g, i18n.tr("Save a picture"), null, KeyEvent.VK_S) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JFileChooser fc = new JFileChooser();
+ fc.setFileFilter(new FileNameExtensionFilter(i18n.tr("PNG Image Files"), "png"));
+ fc.setDialogType(JFileChooser.OPEN_DIALOG);
+ fc.showOpenDialog(MainFrame.getInstance());
+ File selectedFile = fc.getSelectedFile();
+
+ if (selectedFile != null) {
+ if (selectedFile.exists()) {
+ int dialogResult = JOptionPane.showConfirmDialog (null,
+ Game.i18n.tr("Do you want to overwrite {0}?",selectedFile.getName()),
+ Game.i18n.tr("{0} exists",selectedFile.getName()),JOptionPane.YES_NO_OPTION);
+ if (dialogResult != JOptionPane.YES_OPTION)
+ return;
+ }
+ int iconSize = 500;
+
+ WorldView wv = game.getSelectedWorld().getView();
+ wv.setSize(new Dimension(iconSize, iconSize));
+ wv.doLayout();
+ wv.setVisible(true);
+
+ BufferedImage img = new BufferedImage(wv.getWidth(), wv.getHeight(), BufferedImage.TYPE_INT_RGB);
+
+ CellRendererPane crp = new CellRendererPane();
+ crp.add(wv);
+ crp.paintComponent(img.createGraphics(), wv, crp, wv.getBounds());
+
+ try {
+ ImageIO.write(img, "png", selectedFile);
+ JOptionPane.showMessageDialog(MainFrame.this, Game.i18n.tr("Image saved into {0}.",selectedFile.getName()));
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ });
+ menuFile.add(miFileSavePicture);
miFileLoad = new JMenuItem(new AbstractGameAction(g, i18n.tr("Load lesson"), null, KeyEvent.VK_L) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void actionPerformed(ActionEvent e) {
- JFileChooser fc = new JFileChooser();
- fc.setFileFilter(new FileNameExtensionFilter(i18n.tr("PLM lesson files"), "plm"));
- fc.setDialogType(JFileChooser.OPEN_DIALOG);
- fc.showOpenDialog(MainFrame.getInstance());
- File selectedFile = fc.getSelectedFile();
-
- try {
- if (selectedFile != null)
- game.loadLessonFromJAR(fc.getSelectedFile());
- } catch (LessonLoadingException lle) {
- JOptionPane.showMessageDialog(null, lle.getMessage(), i18n.tr("Error"), JOptionPane.ERROR_MESSAGE);
- }
- }
- });
- menuFile.add(miFileLoad);
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JFileChooser fc = new JFileChooser();
+ fc.setFileFilter(new FileNameExtensionFilter(i18n.tr("PLM lesson files"), "plm"));
+ fc.setDialogType(JFileChooser.OPEN_DIALOG);
+ fc.showOpenDialog(MainFrame.getInstance());
+ File selectedFile = fc.getSelectedFile();
+
+ try {
+ if (selectedFile != null)
+ game.loadLessonFromJAR(fc.getSelectedFile());
+ } catch (LessonLoadingException lle) {
+ JOptionPane.showMessageDialog(null, lle.getMessage(), i18n.tr("Error"), JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ });
+ menuFile.add(miFileLoad);
miFileSwitch = new JMenuItem(new AbstractGameAction(g, i18n.tr("Switch lesson"), null, KeyEvent.VK_L) {
@@ -673,6 +720,7 @@ public class MainFrame extends JFrame implements GameStateListener, GameListener
// Menus
menuFile.setText(i18n.tr("File"));
+ miFileSavePicture.setText(i18n.tr("Save a picture"));
miFileLoad.setText(i18n.tr("Load lesson"));
miFileSwitch.setText(i18n.tr("Switch lesson"));
miFileExercise.setText(i18n.tr("Switch exercise"));
@@ -690,7 +738,7 @@ public class MainFrame extends JFrame implements GameStateListener, GameListener
miSessionImportFromCloud.setText(i18n.tr("Import Session Cache from Cloud"));
miSessionDebug.setText(i18n.tr("Debug mode"));
- miSessionDebug.setText(i18n.tr("Creative mode"));
+ miSessionCreative.setText(i18n.tr("Creative mode"));
menuLanguage.setText(i18n.tr("Language"));
diff --git a/src/plm/core/ui/TipsDialog.java b/src/plm/core/ui/TipsDialog.java
index faed4ad..4881457 100644
--- a/src/plm/core/ui/TipsDialog.java
+++ b/src/plm/core/ui/TipsDialog.java
@@ -11,12 +11,14 @@ public class TipsDialog extends AbstractAboutDialog {
public TipsDialog(JFrame parent) {
super(parent);
currentExerciseHasChanged(Game.getInstance().getCurrentLesson().getCurrentExercise());
+ area.setEditorKit(new PlmHtmlEditorKit(Game.getInstance().getCurrentLesson().getCurrentExercise()));
+
}
@Override
public void currentExerciseHasChanged(Lecture lect) {
- setTitle("Tips");
- this.area.setText("no tips");
+ setTitle(Game.i18n.tr("Tips"));
+ this.area.setText(Game.i18n.tr("(no tips to display)"));
this.area.setCaretPosition(0);
}
diff --git a/src/plm/core/ui/editor/MissionEditor.java b/src/plm/core/ui/editor/MissionEditor.java
index 3fe1cda..4ea06d4 100644
--- a/src/plm/core/ui/editor/MissionEditor.java
+++ b/src/plm/core/ui/editor/MissionEditor.java
@@ -324,7 +324,7 @@ public class MissionEditor extends JFrame {
int choice = JOptionPane.showConfirmDialog(MissionEditor.this,
Game.i18n.tr("You chose a translated mission text for edition ({0}).\n"
+ "This is wrong. The translations should be handled with po4a in PLM.\n"
- + "Please refer to https://github.com/oster/JLM/wiki/Working-with-the-translations for more information.\n\n"
+ + "Please refer to https://github.com/oster/PLM/wiki/Working-with-the-translations for more information.\n\n"
+ "Proceed anyway?",path),
Game.i18n.tr("This is a translated mission text"),
JOptionPane.YES_NO_OPTION,
diff --git a/src/plm/universe/EntityControlPanel.java b/src/plm/universe/EntityControlPanel.java
index 38f32c1..d555fcb 100644
--- a/src/plm/universe/EntityControlPanel.java
+++ b/src/plm/universe/EntityControlPanel.java
@@ -22,7 +22,7 @@ public abstract class EntityControlPanel extends JPanel implements HumanLangChan
}
/** Do a textual output corresponding to the fact that a button was pressed. This is a direct help */
- protected void echo(String name) {
+ public static void echo(String name) {
System.out.println(name+(Game.getProgrammingLanguage()==Game.JAVA?";":""));
}
}
diff --git a/src/plm/universe/bugglequest/BuggleWorld.java b/src/plm/universe/bugglequest/BuggleWorld.java
index c69c1f3..09eb3c4 100644
--- a/src/plm/universe/bugglequest/BuggleWorld.java
+++ b/src/plm/universe/bugglequest/BuggleWorld.java
@@ -481,63 +481,64 @@ public class BuggleWorld extends GridWorld {
/* BINDINGS TRANSLATION: French */
"def avance(pas=1):\n"+
- " entity.forward(pas)\n"+
+ " forward(pas)\n"+
"def recule(pas=1):\n"+
- " entity.backward(pas)\n"+
+ " backward(pas)\n"+
"def gauche():\n"+
- " entity.left()\n"+
+ " left()\n"+
"def retourne():\n"+
- " entity.back()\n"+
+ " back()\n"+
"def droite():\n"+
- " entity.right()\n"+
+ " right()\n"+
"\n"+
"def getMondeHauteur():\n"+
- " return entity.getWorldHeight()\n"+
+ " return getWorldHeight()\n"+
"def getMondeLargeur():\n"+
- " return entity.getWorldWidth()\n"+
+ " return getWorldWidth()\n"+
"def baisseBrosse():\n"+
- " entity.brushDown()\n"+
+ " brushDown()\n"+
"def leveBrosse():\n"+
- " entity.brushUp()\n" +
+ " brushUp()\n" +
"def estBrosseBaissee():\n"+
- " entity.isBrushDown()\n" +
+ " isBrushDown()\n" +
"def estFaceMur():" +
- " return entity.isFacingWall()\n"+
+ " return isFacingWall()\n"+
"def estDosMur():" +
- " return entity.isBackingWall()\n"+
+ " return isBackingWall()\n"+
"def getCouleurSol():\n"+
- " return entity.getGroundColor()\n"+
-
- "def errorMsg(str):\n"+
- " entity.seenError(str)\n"+
+ " return getGroundColor()\n"+
"def estSurBiscuit():\n"+
- " return entity.isOverBaggle()\n"+
+ " return isOverBaggle()\n"+
"def porteBiscuit():\n"+
- " return entity.isCarryingBaggle()\n"+
+ " return isCarryingBaggle()\n"+
"def prendBiscuit():\n"+
- " return entity.pickupBaggle()\n"+
+ " return pickupBaggle()\n"+
"def poseBiscuit():\n"+
- " return entity.dropBaggle()\n"+
+ " return dropBaggle()\n"+
"def estSurMessage():\n"+
- " return entity.isOverMessage()\n"+
+ " return isOverMessage()\n"+
"def litMessage():\n"+
- " return entity.readMessage()\n"+
+ " return readMessage()\n"+
"def effaceMessage():\n"+
- " entity.clearMessage()\n"+
+ " clearMessage()\n"+
"def ecritMessage(msg):\n"+
- " entity.writeMessage(msg)\n"+
+ " writeMessage(msg)\n"+
"def getCouleurCorps():\n"+
- " return entity.getBodyColor()\n"+
+ " return getBodyColor()\n"+
"def setCouleurCorps(c):\n"+
- " return setBodyColor(c)\n"+
+ " setBodyColor(c)\n"+
"def setCouleurBrosse(c):\n"+
- " entity.setBrushColor(c)\n"+
+ " setBrushColor(c)\n"+
"def getCouleurBrosse():\n"+
- " return entity.getBrushColor()\n"
+ " return getBrushColor()\n"+
+
+ "def errorMsg(str):\n"+
+ " entity.seenError(str)\n"
+
);
} else {
throw new RuntimeException("No binding of BuggleWorld for "+lang);
diff --git a/src/plm/universe/sort/SortingWorld.java b/src/plm/universe/sort/SortingWorld.java
index ad7444d..80e6b50 100644
--- a/src/plm/universe/sort/SortingWorld.java
+++ b/src/plm/universe/sort/SortingWorld.java
@@ -292,19 +292,19 @@ public class SortingWorld extends World {
" return entity.isSmallerThan(i,j)\n"+
/* BINDINGS TRANSLATION: French */
"def getNombreValeurs():\n" +
- " return entity.getValueCount()\n" +
+ " return getValueCount()\n" +
"def echange(i,j):\n" +
- " entity.swap(i,j)\n" +
+ " swap(i,j)\n" +
"def copie(i,j):\n" +
- " entity.copy(i,j)\n" +
+ " copy(i,j)\n" +
"def getValeur(i):\n" +
- " return entity.getValue(i)\n" +
+ " return getValue(i)\n" +
"def setValeur(i,j):\n" +
- " entity.setValue(i,j)\n" +
+ " setValue(i,j)\n" +
"def plusPetit(i,j):\n"+
- " return entity.isSmaller(i,j)\n"+
+ " return isSmaller(i,j)\n"+
"def plusPetitQue(i,j):\n"+
- " return entity.isSmallerThan(i,j)\n"
+ " return isSmallerThan(i,j)\n"
);
} else {
diff --git a/src/plm/universe/turtles/Turtle.java b/src/plm/universe/turtles/Turtle.java
index 978aa23..d746a8d 100644
--- a/src/plm/universe/turtles/Turtle.java
+++ b/src/plm/universe/turtles/Turtle.java
@@ -22,6 +22,8 @@ public class Turtle extends Entity {
private double heading = 0.;
private boolean penDown = true;
private int angularUnit = Turtle.DEGREE;
+
+ private boolean visible = true;
/**
* Constructor with no argument so that child classes can avoid declaring a
@@ -235,6 +237,18 @@ public class Turtle extends Entity {
public void penUp() {
this.penDown = false;
}
+
+ public void hide() {
+ this.visible = false;
+ stepUI();
+ }
+ public void show() {
+ this.visible = true;
+ stepUI();
+ }
+ public boolean isVisible() {
+ return this.visible;
+ }
public void clear() {
getWorld().clear();
}
@@ -427,4 +441,7 @@ public class Turtle extends Entity {
public boolean estChoisi() { return isSelected(); } // we have to document the version without e, since po4a allows for one variant only
public boolean estChoisie() { return isSelected(); } // But we want to have the grammatically correct form also possible (turtles are feminine)
public void efface() { clear(); }
+ public void cache() { hide(); }
+ public void montre() { show(); }
+ public boolean estVisible() { return isVisible(); }
}
diff --git a/src/plm/universe/turtles/TurtleWorld.fr.html b/src/plm/universe/turtles/TurtleWorld.fr.html
index 5881b36..e018fed 100644
--- a/src/plm/universe/turtles/TurtleWorld.fr.html
+++ b/src/plm/universe/turtles/TurtleWorld.fr.html
@@ -33,6 +33,15 @@ Déplace la tortue à une nouvelle position.
<pre>[!java]void [/!]cercle([!java]double [/!]rayon[!scala]:Double[/!])</pre>
Dessine un cercle du rayon demandé et centré sur la tortue.
+<pre>[!java]void [/!]cache()</pre>
+Cache la tortue.
+
+<pre>[!java]void [/!]montre()</pre>
+Montre la tortue.
+
+<pre>[!java]boolean [/!]estVisible()[!scala]:Boolean[/!]</pre>
+Renvoie vrai si la tortue est actuellement visible.
+
<pre>[!java]void [/!]efface()</pre>
Efface toutes les traces de la feuille.
diff --git a/src/plm/universe/turtles/TurtleWorld.html b/src/plm/universe/turtles/TurtleWorld.html
index 3659b49..d1f03bb 100644
--- a/src/plm/universe/turtles/TurtleWorld.html
+++ b/src/plm/universe/turtles/TurtleWorld.html
@@ -33,6 +33,15 @@ Moves the turtle to a new position.
<pre>[!java]void [/!]circle([!java]double [/!]radius[!scala]:Double[/!])</pre>
Draw a circle of the specified radius centered on the turtle.
+<pre>[!java]void [/!]hide()</pre>
+Hides the turtle.
+
+<pre>[!java]void [/!]show()</pre>
+Shows the turtle back.
+
+<pre>[!java]boolean [/!]isVisible()[!scala]:Boolean[/!]</pre>
+Returns whether the turtle is currently visible.
+
<pre>[!java]void [/!]clear()</pre>
Removes any trail on the sheet.
diff --git a/src/plm/universe/turtles/TurtleWorld.java b/src/plm/universe/turtles/TurtleWorld.java
index 50934f0..dec963e 100644
--- a/src/plm/universe/turtles/TurtleWorld.java
+++ b/src/plm/universe/turtles/TurtleWorld.java
@@ -196,29 +196,41 @@ public class TurtleWorld extends World {
" entity.circle(radius)\n"+
"def clear():\n"+
" entity.clear()\n"+
+ "def hide():\n"+
+ " entity.hide()\n"+
+ "def show():\n"+
+ " entity.show()\n"+
+ "def isVisible():\n"+
+ " return entity.isVisible()\n"+
/* BINDINGS TRANSLATION: French */
"def recule(i):\n"+
- " entity.backward(i)\n"+
+ " backward(i)\n"+
"def avance(i):\n"+
- " entity.forward(i)\n"+
+ " forward(i)\n"+
"def leveCrayon():\n"+
- " entity.penUp()\n"+
+ " penUp()\n"+
"def baisseCrayon():\n"+
- " entity.penDown()\n"+
+ " penDown()\n"+
"def estCrayonBaisse():\n"+
- " return entity.isPenDown()\n"+
+ " return isPenDown()\n"+
"def gauche(i):\n"+
- " entity.left(i)\n"+
+ " left(i)\n"+
"def droite(i):\n"+
- " entity.right(i)\n"+
+ " right(i)\n"+
"def setCouleur(c):\n"+
- " entity.setColor(c)\n" +
+ " setColor(c)\n" +
"def allerVers(x,y):\n" +
- " entity.moveTo(x,y)\n"+
+ " moveTo(x,y)\n"+
"def cercle(radius):\n"+
- " entity.circle(radius)\n"+
+ " circle(radius)\n"+
"def efface():\n"+
- " entity.clear()\n"
+ " clear()\n"+
+ "def cache():\n"+
+ " hide()\n"+
+ "def montre():\n"+
+ " show()\n"+
+ "def estVisible():\n"+
+ " return isVisible()\n"
);
} else {
throw new RuntimeException("No binding of TurtleWorld for "+lang);
@@ -234,7 +246,7 @@ public class TurtleWorld extends World {
Collections.sort(shapes, cmp);
Collections.sort(other.shapes, cmp);
if (shapes.size() != other.shapes.size())
- sb.append(Game.i18n.tr(" There is only {0} shapes where {1} shapes were expected\n",other.shapes.size()+shapes.size()));
+ return Game.i18n.tr(" There is {0} shapes, but {1} shapes were expected\n",other.shapes.size(),shapes.size());
for (int i=0;i<other.shapes.size();i++)
if (! other.shapes.get(i).equals(shapes.get(i)))
sb.append(Game.i18n.tr(" {0} (got {1} instead of {2})\n",
diff --git a/src/plm/universe/turtles/TurtleWorldView.java b/src/plm/universe/turtles/TurtleWorldView.java
index 0cbde11..5f6853c 100644
--- a/src/plm/universe/turtles/TurtleWorldView.java
+++ b/src/plm/universe/turtles/TurtleWorldView.java
@@ -85,9 +85,11 @@ public class TurtleWorldView extends WorldView {
}
private void drawTurtle(Graphics2D g, Turtle b) {
- ImageIcon ic = ResourcesCache.getIcon("img/world_turtle.png");
- AffineTransform t = new AffineTransform(1.0, 0, 0, 1.0, b.getX()-ic.getIconWidth()/2., b.getY()-ic.getIconHeight()/2.);
- t.rotate(b.getHeadingRadian(), ic.getIconWidth()/2., ic.getIconHeight()/2.);
- g.drawImage(ic.getImage(), t, null);
+ if (b.isVisible()) {
+ ImageIcon ic = ResourcesCache.getIcon("img/world_turtle.png");
+ AffineTransform t = new AffineTransform(1.0, 0, 0, 1.0, b.getX()-ic.getIconWidth()/2., b.getY()-ic.getIconHeight()/2.);
+ t.rotate(b.getHeadingRadian(), ic.getIconWidth()/2., ic.getIconHeight()/2.);
+ g.drawImage(ic.getImage(), t, null);
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/plm.git
More information about the pkg-java-commits
mailing list