forked from Open-CT/openct-tasks
260 lines
8.8 KiB
HTML
260 lines
8.8 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>2017-EN-06</title>
|
|
<script>
|
|
window.stringsLanguage = 'en';
|
|
</script>
|
|
<script class="remove" type="text/javascript" src="../../../_common/modules/pemFioi/importModules-1.1.js" id="import-modules"></script>
|
|
<script class="remove" type="text/javascript">
|
|
var modulesPath = '../../../_common/modules';
|
|
importModules([
|
|
'jquery-1.7.1', 'jquery-ui.touch-punch', 'raphael-2.2.1', 'JSON-js',
|
|
'beav-1.0', 'beaver-task-2.0', 'simulation-2.0', 'raphaelFactory-1.0',
|
|
'delayFactory-1.0', 'simulationFactory-1.0', 'grid-1.0', 'raphaelButton-1.0',
|
|
'platform-pr', 'buttonsAndMessages', 'installationAPI.01', 'miniPlatform',
|
|
'taskStyles-0.1']);
|
|
</script>
|
|
<script class="remove" type="text/javascript">
|
|
var json = {
|
|
"id": "http://castor-informatique.fr/tasks/2017/2017-FR-06-pacman/",
|
|
"language": "en",
|
|
"version": "fr.01",
|
|
"authors": "Arthur Charguéraud, Mathias Hiron, Nir Lavee, France-ioi",
|
|
"translators": "Mohamed El-Sherif",
|
|
"license": "CC BY-SA 3.0",
|
|
"taskPathPrefix": "",
|
|
"modulesPathPrefix": "",
|
|
"browserSupport": [],
|
|
"fullFeedback": true,
|
|
"acceptedAnswers": [],
|
|
"usesRandomSeed": false
|
|
};
|
|
</script>
|
|
<script type="text/javascript">
|
|
var taskStrings = {
|
|
success: "Congratulations, you have succeeded !",
|
|
error: "Beaver was caught by a ghost. You can restart or cancel the last steps.", //"Recommencer"
|
|
undoOption: "Cancel the last step",
|
|
restartOption: "Restart",
|
|
partial: "Beaver has been caught! You get some of the points. <br> You can start again or cancel the last steps.",
|
|
// DEPRECATD invalid: "Castor ne peut pas se déplacer sur une case grise.",
|
|
livesLeft: function(lives) {
|
|
return "lives :<br>" + lives;
|
|
},
|
|
livesFeedback: function(livesLost, livesLeft) {
|
|
return "";
|
|
//return "Castor a perdu " + livesLost + " vie(s). Il lui reste " + livesLeft + " vie(s).";
|
|
}
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="task.js"></script>
|
|
<style>
|
|
#anim_container {
|
|
text-align: center;
|
|
}
|
|
#anim_container table {
|
|
margin: auto;
|
|
}
|
|
#anim {
|
|
display: inline-block;
|
|
}
|
|
#feedback {
|
|
height: 2em;
|
|
margin-top: 0.5em;
|
|
margin-bottom: 0.1em;
|
|
text-align: center;
|
|
font-weight: bold;
|
|
color: red;
|
|
}
|
|
#controlsContainer {
|
|
text-align: center;
|
|
padding-left: 20px;
|
|
}
|
|
#controlsContainer input {
|
|
min-width: 80px;
|
|
padding: 10px;
|
|
}
|
|
#arrowsTable td {
|
|
width: 30px;
|
|
height: 30px;
|
|
}
|
|
.livesStatus {
|
|
margin-top: 30px;
|
|
font-size: 24px;
|
|
display: none;
|
|
}
|
|
#restart {
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="task">
|
|
<h1>Ghost</h1>
|
|
<div id="tabsContainer"></div>
|
|
<div id="taskContent">
|
|
<p class="hard" id="difficultyWarning"></p>
|
|
<p>
|
|
Move the Beaver to the yellow dot without getting caught by <span class="easy medium">the ghost</span><span class="hard">the ghosts</span>. </p>
|
|
<p>You can move the Beaver with the arrow keys or by clicking on the grid.
|
|
</p>
|
|
<p class="easy medium">
|
|
Observe that the ghost always moves using the same strategy. Try to avoid it !
|
|
</p>
|
|
<p class="hard">
|
|
Observe that ghosts always moves using the same strategy. Try to avoid them !
|
|
</p>
|
|
|
|
<div id="anim_container">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<div id="anim"></div>
|
|
</td>
|
|
<td id="controlsContainer">
|
|
<input type="button" id="undo" value="Undo" />
|
|
<br>
|
|
<div class="livesStatus"></span>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div id="feedback"></div>
|
|
<input type="button" id="restart" value="Restart" />
|
|
</div>
|
|
<img src="icon.png" style="display:none">
|
|
<img src="castor.png" style="display:none">
|
|
<img id="image_ghost1" src="ghost1.png" style="display:none">
|
|
<img id="image_ghost2" src="ghost2.png" style="display:none">
|
|
</div>
|
|
</div><!-- task -->
|
|
<div id="solution">
|
|
|
|
<h2>Solution</h2>
|
|
|
|
|
|
<style>
|
|
.table-sol img {
|
|
width: 240px;
|
|
}
|
|
.table-sol td {
|
|
width: 250px;
|
|
padding-bottom: 20px;
|
|
vertical-align: bottom;
|
|
}
|
|
.table-sol p {
|
|
margin: 0px 0px 5px 0px;
|
|
}
|
|
</style>
|
|
|
|
<div class="easy">
|
|
<table class="table-sol"><tr>
|
|
<td>
|
|
<p>The goal is to trap the ghost.</p>
|
|
<img src="Sol_easy_1.png">
|
|
</td>
|
|
<td>
|
|
<p>It is first moved to the right.</p>
|
|
<img src="Sol_easy_2.png">
|
|
</td>
|
|
<td>
|
|
<p>Then we go back to the left.</p>
|
|
<img src="Sol_easy_3.png">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>We can then go down.</p>
|
|
<img src="Sol_easy_4.png">
|
|
</td>
|
|
<td>
|
|
<p>And we won !</p>
|
|
<img src="Sol_easy_5.png">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="medium">
|
|
|
|
<table class="table-sol"><tr>
|
|
<td>
|
|
<p>The goal is to trap the ghost.</p>
|
|
<img src="Sol_medium_1.png">
|
|
</td>
|
|
<td>
|
|
<p>It is first moved to the right.</p>
|
|
<img src="Sol_medium_2.png">
|
|
</td>
|
|
<td>
|
|
<p>Then we go back to the left.</p>
|
|
<img src="Sol_medium_3.png">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>Then we can go down.</p>
|
|
<img src="Sol_medium_4.png">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="hard">
|
|
|
|
<table class="table-sol"><tr>
|
|
<td>
|
|
<p>We attract the two ghosts.</p>
|
|
<img src="Sol_hard_0.png">
|
|
</td>
|
|
<td>
|
|
<p>Towards corners.</p>
|
|
<img src="Sol_hard_1.png">
|
|
</td>
|
|
<td>
|
|
<p>That way they're stuck.</p>
|
|
<img src="Sol_hard_2.png">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>We go down on the left edge.</p>
|
|
<img src="Sol_hard_3.png">
|
|
</td>
|
|
<td>
|
|
<p>Then we go back just in time.</p>
|
|
<img src="Sol_hard_4.png">
|
|
</td>
|
|
<td>
|
|
<p>We draw the ghost to the right.</p>
|
|
<img src="Sol_hard_5.png">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>We left the ghost to the left.</p>
|
|
<img src="Sol_hard_6.png">
|
|
</td>
|
|
<td>
|
|
<p>Then we can go down.</p>
|
|
<img src="Sol_hard_7.png">
|
|
</td>
|
|
<td>
|
|
<p>And get to the yellow dot.</p>
|
|
<img src="Sol_hard_8.png">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<h2>It's computer science !</h2>
|
|
|
|
<p>In this topic, it was necessary to do <b> reverse engineering </b>, in order to deduce the displacement behavior of a ghost. A ghost is still heading in the direction of Castor. It's a pretty good way to reach your target, except of course when there are obstacles. In this subject, it was precisely necessary to exploit the obstacles in order to manage to catch the ghost and then to be able to pick up speed. </P>
|
|
|
|
</div> <!-- task-solution -->
|
|
</body>
|
|
</html>
|