Skip to content

Commit

Permalink
[fr] translation
Browse files Browse the repository at this point in the history
Colors + Basic Programming et Basic Ruby common.
  • Loading branch information
bootis committed Jul 6, 2012
1 parent 8b53e37 commit 6f0013f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 45 deletions.
22 changes: 11 additions & 11 deletions public/help/fr/hacketyhack/basic_programming.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Basic Programming</title>
<title>Bases de la Programmation</title>

<!-- Load styles -->
<link rel="stylesheet" href="../../../css/blitzer/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" title="style" charset="utf-8">
Expand All @@ -26,11 +26,11 @@
</head>

<body class="lesson-set">
<h1>Basic Programming</h1>
<h1>Bases de la Programmation</h1>
<nav id="top">
<a href="#back" class="prev-lesson">&laquo; Back</a>
<a href="index.html">Back to Lessons</a>
<a href="#next" class="next-lesson">Next &raquo;</a>
<a href="#back" class="prev-lesson">&laquo; Précédent</a>
<a href="index.html">Retour aux Leçons</a>
<a href="#next" class="next-lesson">Suivant &raquo;</a>
</nav>


Expand Down Expand Up @@ -117,7 +117,7 @@ <h1>Basic Programming</h1>

<section class="page"><h1>Changing the background</h1>
<p>Let's try this: we can tell the <code>Turtle</code> that we want to use a different background color by using the <code>background</code> command. Check it out:</p>
<pre id="code-1-1" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-1-1" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Type this in and click 'Run'!</p>
</section>

Expand All @@ -136,13 +136,13 @@ <h1>Basic Programming</h1>
<article class="lesson"><h1>Drawing lines</h1>
<section class="page"><h1>Sally forth!</h1>
<p>Okay, enough dilly-dallying. Let's tell the turtle to draw a line! Here's my line. Give this one a shot, then try your own colors and numbers!</p>
<pre id="code-1-2" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-1-2" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>50 is the number of pixels to move forward, by the way.</p>
</section>

<section class="page"><h1>You spin me right round, baby</h1>
<p>Great! So you've got a line. But what if you don't want the <code>Turtle</code> to move forward? Well, you can tell it to turn by using a <code>turnleft</code> or <code>turnright</code> command, like this:</p>
<pre id="code-1-3" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-1-3" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Give that a shot, then play with it a bit!</p>
<p>If you're wondering what 90 means, it's the number of degrees that it'll turn.</p>
</section>
Expand All @@ -163,7 +163,7 @@ <h1>Basic Programming</h1>

<section class="page"><h1>Here's my version</h1>
<p>Here's how I did it:</p>
<pre id="code-1-4" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-1-4" class="sampleCode">Code inséré automatiquement ici...</pre>
</section>
</article>

Expand All @@ -176,7 +176,7 @@ <h1>Basic Programming</h1>

<section class="page"><h1>Repeating repeating ourselves ourselves</h1>
<p>Check it out: our <code>Turtle</code> actually knows numbers. For example:</p>
<pre id="code-1-5" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-1-5" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Try running this example. It also draws a square! Wow!</p>
</section>

Expand All @@ -198,7 +198,7 @@ <h1>Basic Programming</h1>
</section>
</article>

<a href="#top">Back to top</a>
<a href="#top">Retour en haut</a>

</body>
</html>
52 changes: 26 additions & 26 deletions public/help/fr/hacketyhack/basic_ruby.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Basic Ruby</title>
<title>Bases de Ruby</title>

<!-- Load styles -->
<link rel="stylesheet" href="../../../css/blitzer/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" title="style" charset="utf-8">
Expand Down Expand Up @@ -39,11 +39,11 @@
</script>
</head>
<body class="lesson-set">
<h1>Basic Ruby</h1>
<h1>Bases de Ruby</h1>
<nav id="top">
<a href="#back" class="prev-lesson">&laquo; Back</a>
<a href="index.html">Back to Lessons</a>
<a href="#next" class="next-lesson">Next &raquo;</a>
<a href="#back" class="prev-lesson">&laquo; Précédent</a>
<a href="index.html">Retour aux Leçons</a>
<a href="#next" class="next-lesson">Suivant &raquo;</a>
</nav>


Expand Down Expand Up @@ -75,13 +75,13 @@ <h1>Basic Ruby</h1>
</section>
<section class="page"><h1>Hello, World!</h1>
<p>There are two ways of doing this. Here's the first: alert</p>
<pre id="code-2-1" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-1" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Type this in and press the 'Run' button.</p>
</section>
<section class="page"><h1>alert</h1>
<p>Okay, let's break this down: There's two main parts to this little program: you have an <code>alert</code> and a <code>"Hello, world!"</code>. These two parts work just like an English sentence: The <code>alert</code> is a verb and the stuff in the ""s is an object. In Ruby, we call verbs <strong>methods</strong>. The <code>alert</code> verb says 'Put an alert box on the screen, and the content of the box is whatever thing you give me.'</p>
<p>We'll talk about the <code>"Hello, world!"</code> in just a second. Here's the other way of making this happen:</p>
<pre id="code-2-2" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-2" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>If you try that here, it will work! The <code>puts</code> method doesn't display a dialog box, it puts text out to the output instead. We'll be using <code>alert</code>s throughout these tutorials, but if you look at other Ruby tutorials, you may see <code>puts</code>.</p>
</section>
</article>
Expand All @@ -90,14 +90,14 @@ <h1>Basic Ruby</h1>
<article class="lesson"><h1>Letters, words, and sentences</h1>
<section class="page"><h1> Strings </h1>
<p>Okay! Now that you've got that verb bit down, it's time to learn about <em>String</em>s. Strings are what we call a bunch of words between a pair of " characters. The "s are used to tell the computer what words you actually want to say. Let's think about our example:</p>
<pre id="code-2-1-1" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-1-1" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>If you didn't have the "s, the computer wouldn't know which words were methods and which ones were part of the string! And consider this:</p>
<pre id="code-2-3" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-3" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Without making all of those words a string, how would Ruby know that the second alert was some text you wanted to say, rather than another alert box?</p>
</section>
<section class="page"><h1>Adding Strings </h1>
<p>Now, if you want to put two bits of strings together, you can use the <code>+</code> character to do it. Try typing this:</p>
<pre id="code-2-4" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-4" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Same thing! The <code>+</code> sticks the two strings together. This will end up being super useful later!</p>
</section>
</article>
Expand All @@ -106,17 +106,17 @@ <h1>Basic Ruby</h1>
<article class="lesson"><h1>Numbers and Math</h1>
<section class="page"><h1> Numbers </h1>
<p>You can just use numbers, and Ruby understands them:</p>
<pre id="code-2-5" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-5" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>You can even use numbers that have a decimal point in them:</p>
<pre id="code-2-6" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-6" class="sampleCode">Code inséré automatiquement ici...</pre>
</section>
<section class="page"><h1> Basic Math </h1>
<p>You can also do math with numbers, and it'll work out pretty well:</p>
<pre id="code-2-7" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-7" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>But if you try this, nothing happens:</p>
<pre id="code-2-8" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-8" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>This is kind of fun and silly, though:</p>
<pre id="code-2-9" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-9" class="sampleCode">Code inséré automatiquement ici...</pre>
</section>
<section class="page"><h1>Errors </h1>
<p>You know how nothing happened when you hit the Run button earlier? That was because there was an error. You can see any errors in the 'Output' tab.</p>
Expand All @@ -134,13 +134,13 @@ <h1>Basic Ruby</h1>
</section>
<section class="page"><h1>Adding numbers to words</h1>
<p>That's why</p>
<pre id="code-2-10" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-10" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>doesn't really work: "hey" is a <code>String</code> object, and 2 is a <code>Fixnum</code> object. And adding <code>String</code>s and <code>Fixnum</code>s doesn't make any sense. We can make this code work, though!</p>
<p>All we need to do is turn the <code>Fixnum</code> into a <code>String</code>. We can do this by using the <code>to_s</code> method.</p>
<pre id="code-2-11" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-11" class="sampleCode">Code inséré automatiquement ici...</pre>
</section>
<section class="page"><h1>Let's look at that again</h1>
<pre id="code-2-11-1" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-11-1" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Okay, this isn't bad. We have our <code>alert</code> method. We're giving it <code>"hey" + 2.to_s</code>. The <code>2.to_s</code> turns a <code>Fixnum</code> 2, which is like the mathematical idea of a 2, into the <code>String</code> 2, which is like when you write a 2 down on a piece of paper.</p>
</section>
</article>
Expand All @@ -150,13 +150,13 @@ <h1>Basic Ruby</h1>
<section class="page"><h1> They're like boxes </h1>
<p>What happens if we want to keep something around? Most programs are not one line, I assure you. You can use a <em>variable</em> to hold a value and use it later. It's like a box that you put things in.</p>
<p>Let's try one out:</p>
<pre id="code-2-12" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-12" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Give that a run.</p>
</section>
<section class="page"><h1> Assignment </h1>
<p>Cool stuff! We used an <code>=</code> to <em>assign</em> the <code>String</code> "Hello, world!" into the variable <code>message</code>. We then passed that <code>message</code> to the <code>alert</code> method.</p>
<p>As you can see, we can use variables in place of another value. Try this:</p>
<pre id="code-2-13" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-13" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>Make a guess before you run this program.</p>
</section>
</article>
Expand All @@ -165,7 +165,7 @@ <h1>Basic Ruby</h1>
<article class="lesson"><h1>User Input</h1>
<section class="page"><h1>ask-ing for it.</h1>
<p>We can ask the user of our program for some input, and then put their answer into a variable. It's easy! Check this program out:</p>
<pre id="code-2-14" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-14" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>The <code>ask</code> method brings up a box and lets our users type something in. Fun! We put their answer into the <code>name</code> variable and then showed it with <code>alert</code> Sweet!</p>
</section>
</article>
Expand All @@ -175,13 +175,13 @@ <h1>Basic Ruby</h1>
<section class="page"><h1> if... </h1>
<p>Remember back to that Beginning Programming lesson... we talked about how programs are one big list, that the computer follows in order.</p>
<p>Well, guess what? We can actually change this order by using certain bits of code. Compare these two programs:</p>
<pre id="code-2-15" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-16" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-15" class="sampleCode">Code inséré automatiquement ici...</pre>
<pre id="code-2-16" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>There are a few new things here.</p>
</section>
<section class="page"><h1>"=="</h1>
<p>Here it is again:</p>
<pre id="code-2-15-1" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-15-1" class="sampleCode">Code inséré automatiquement ici...</pre>
<p>The == command is just a bit different than the = command. == tests the <code>Object</code> on its right against the <code>Object</code> on its left. If the two are equal, then the code after the <code>if</code> will run. If they're not equal, you get the code after the <code>else</code>. The <code>("end")</code> lets us know we're done with our <code>if</code>.</p>
</section>
</article>
Expand All @@ -190,7 +190,7 @@ <h1>Basic Ruby</h1>
<article class="lesson"><h1>Example: a guessing game</h1>
<section class="page"><h1> Guess! </h1>
<p>Let's put this all together:</p>
<pre id="code-2-17" class="sampleCode">Code automatically inserted here...</pre>
<pre id="code-2-17" class="sampleCode">Code inséré automatiquement ici...</pre>
</section>
</article>

Expand All @@ -205,6 +205,6 @@ <h1>Basic Ruby</h1>
</section>
</article>

<a href="../index.html">Back to Lessons</a>
<a href="../index.html">Retour aux Leçons</a>
</body>
</html>
Loading

0 comments on commit 6f0013f

Please sign in to comment.