Skip to content
Newer
Older
100644 36 lines (33 sloc) 1.51 KB
830b454 @spicyj Composite numbers exercise
spicyj authored
1 <!DOCTYPE html>
cde9e9f @jeresig Re-run the exercises through the updated cleaner.
jeresig authored
2 <html data-require="math word-problems">
3 <head>
0f0c630 @cbhl Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
5 <title>Composite numbers</title>
ac1415e @spicyj Use requirejs for module loading
spicyj authored
6 <script data-main="../local-only/main.js" src="../local-only/require.js"></script>
830b454 @spicyj Composite numbers exercise
spicyj authored
7 </head>
8 <body>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
9 <div class="exercise">
10 <div class="vars">
11 <var id="COMPOSITE">rand( 5 ) === 0 ? getEvenComposite() : getOddComposite()</var>
12 <var id="PRIMES">shuffle( primes, 4 )</var>
edc800f @spicyj Sort numbers in order
spicyj authored
13 <var id="CHOICES">sortNumbers( PRIMES.concat([ COMPOSITE ]) )</var>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
14 </div>
830b454 @spicyj Composite numbers exercise
spicyj authored
15
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
16 <div class="problems">
17 <div>
18 <p class="question">Which of these numbers is composite?</p>
19 <p><code>\large{<var>CHOICES.join( ",\\ " )</var>}</code></p>
20 <p class="solution"><code><var>COMPOSITE</var></code></p>
0f0c630 @cbhl Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
21 <ul class="choices" data-category="true">
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
22 <li data-each="CHOICES as CHOICE"><code><var>CHOICE</var></code></li>
23 </ul>
24 </div>
25 </div>
830b454 @spicyj Composite numbers exercise
spicyj authored
26
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
27 <div class="hints">
28 <p>A composite number is a number that has more than two factors (including 1 and itself).</p>
29 <p><var>toSentence( _.filter( CHOICES, function( p ) { return p !== COMPOSITE; } ) )</var> each have only two factors.</p>
30 <p>The factors of <var>COMPOSITE</var> are <var>toSentence( getFactors( COMPOSITE ) )</var>.</p>
31 <p>Thus, <var>COMPOSITE</var> is the composite number.</p>
32 </div>
33 </div>
cde9e9f @jeresig Re-run the exercises through the updated cleaner.
jeresig authored
34 </body>
35 </html>
Something went wrong with that request. Please try again.