0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>The second driver mode is complete! Now the printer can print all pages of the document and copies of the specified page. Impressive.</p>
1
<p>The second driver mode is complete! Now the printer can print all pages of the document and copies of the specified page. Impressive.</p>
2
<p>Let’s proceed to the third mode: printing pages in reverse order.</p>
2
<p>Let’s proceed to the third mode: printing pages in reverse order.</p>
3
<p>This is a very useful function. When pages are printed in reverse order, they can be stitched together into one document without having to be turned over.</p>
3
<p>This is a very useful function. When pages are printed in reverse order, they can be stitched together into one document without having to be turned over.</p>
4
<p>You already know all the details of how the for loop works and can effortlessly implement other modes.</p>
4
<p>You already know all the details of how the for loop works and can effortlessly implement other modes.</p>
5
<p>To print pages in reverse order, you first need to print the last page, then the second last and so on until the first page is reached. What it means in terms of loops:</p>
5
<p>To print pages in reverse order, you first need to print the last page, then the second last and so on until the first page is reached. What it means in terms of loops:</p>
6
<ol><li>As a preparatory step, you need to set the page number as equal to the number of pages in the document.</li>
6
<ol><li>As a preparatory step, you need to set the page number as equal to the number of pages in the document.</li>
7
<li>Before each iteration of the loop, check to make sure that the page number is greater than zero (either greater than or equal to one).</li>
7
<li>Before each iteration of the loop, check to make sure that the page number is greater than zero (either greater than or equal to one).</li>
8
<li>After each iteration, the page number needs to be <em>decreased</em>by one, and not increased as we did before.</li>
8
<li>After each iteration, the page number needs to be <em>decreased</em>by one, and not increased as we did before.</li>
9
</ol>
9
</ol>