Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 143 lines (141 sloc) 8.651 kb
f8eb156 @marcia Add exercise -- counting 1
marcia authored
1 <!DOCTYPE html>
ced362c @jeresig Run the exercise cleaner.
jeresig authored
2 <html data-require="math spin word-problems">
3 <head>
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>Counting 1</title>
ac1415e @spicyj Use requirejs for module loading
spicyj authored
6 <script data-main="../local-only/main.js" src="../local-only/require.js"></script>
f8eb156 @marcia Add exercise -- counting 1
marcia authored
7 </head>
8 <body>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
9 <div class="exercise">
10 <div class="problems">
11 <div id="page-numbers">
12 <div class="vars">
13 <var id="START">randRange( 20, 50 )</var>
14 <var id="ANSWER">randRange( 20, 40 )</var>
15 <var id="END">START + ANSWER - 1</var>
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
16 <var id="DO_BOOL">randRange(0, 1) === 0</var>
17 <var id="PROBLEMS">DO_BOOL ? $._("problems") : randFromArray([$._("pages"), $._("papers"), $._("articles")]) </var>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
18 <var id="RAND_1">randRange(0, 3)</var>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
19 </div>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
20 <p data-if="DO_BOOL">
21 <span data-if="RAND_1 === 0">
22 <var>person(1)</var> had to do <var>PROBLEMS</var> <code><var>START</var></code>
23 through <code><var>END</var></code> for homework last week.
24 </span><span data-else-if="RAND_1 === 1">
25 <var>person(1)</var> had to do <var>PROBLEMS</var> <code><var>START</var></code>
26 through <code><var>END</var></code> for homework tonight.
27 </span><span data-else-if="!RAND_1 === 2">
28 <var>person(1)</var> was assigned <var>PROBLEMS</var> <code><var>START</var></code>
29 through <code><var>END</var></code> for homework last week.
30 </span><span data-else="">
31 <var>person(1)</var> was assigned <var>PROBLEMS</var> <code><var>START</var></code>
32 through <code><var>END</var></code> for homework tonight.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
33 </span>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
34 </p><p data-else="">
35 <span data-if="RAND_1 === 0">
36 <var>person(1)</var> had to read <var>PROBLEMS</var> <code><var>START</var></code>
37 through <code><var>END</var></code> for homework last week.
38 </span><span data-else-if="RAND_1 === 1">
39 <var>person(1)</var> had to read <var>PROBLEMS</var> <code><var>START</var></code>
40 through <code><var>END</var></code> for homework tonight.
41 </span><span data-else-if="!RAND_1 === 2">
42 <var>person(1)</var> was assigned <var>PROBLEMS</var> <code><var>START</var></code>
43 through <code><var>END</var></code> for homework last week.
44 </span><span data-else="">
45 <var>person(1)</var> was assigned <var>PROBLEMS</var> <code><var>START</var></code>
46 through <code><var>END</var></code> for homework tonight.
47 </span>
48 </p>
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
49 <p class="question" data-if="isMale(1)">
50 <span data-if="DO_BOOL">
51 If <var>person( 1 )</var> did all of the <var>PROBLEMS</var> he was assigned, how many <var>PROBLEMS</var> did he do?
52 </span><span data-else>
53 If <var>person( 1 )</var> read all of the <var>PROBLEMS</var> he was assigned, how many <var>PROBLEMS</var> did he read?
54 </span>
55 </p><p class="question" data-else="">
56 <span data-if="DO_BOOL">
57 If <var>person( 1 )</var> did all of the <var>PROBLEMS</var> she was assigned, how many <var>PROBLEMS</var> did she do?
58 </span><span data-else>
59 If <var>person( 1 )</var> read all of the <var>PROBLEMS</var> she was assigned, how many <var>PROBLEMS</var> did she read?
60 </span>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
61 </p>
62
ced362c @jeresig Run the exercise cleaner.
jeresig authored
63 <div class="solution" data-type="multiple">
64 <p><span class="sol" data-forms="integer"><var>ANSWER</var></span> <var>PROBLEMS</var></p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
65 </div>
66 <div class="hints">
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
67 <p>
68 Instead of counting <var>PROBLEMS</var> <code><var>START</var></code> through <code><var>END</var></code>,
69 we can subtract <code><var>START - 1</var></code> from each number.
70 </p>
71 <p>Now the <var>PROBLEMS</var> are <code>1</code> through <code><var>ANSWER</var></code>.</p>
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
72 <p data-if="DO_BOOL">
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
73 So <var>person(1)</var> did <code><var>ANSWER</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
74 </p><p data-else>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
75 So <var>person(1)</var> read <code><var>ANSWER</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
76 </p>
77 <p data-if="isMale(1)">
78 <span data-if="DO_BOOL">
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
79 Notice that he did <code><var>ANSWER</var></code> and not <code><var>ANSWER - 1</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
80 </span><span data-else>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
81 Notice that he read <code><var>ANSWER</var></code> and not <code><var>ANSWER - 1</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
82 </span>
83 </p><p data-else="">
84 <span data-if="DO_BOOL">
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
85 Notice that she did <code><var>ANSWER</var></code> and not <code><var>ANSWER - 1</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
86 </span><span data-else>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
87 Notice that she read <code><var>ANSWER</var></code> and not <code><var>ANSWER - 1</var></code> <var>PROBLEMS</var>.
de19411 @xymostech Manually i18nize all of the minor exercises
xymostech authored
88 </span>
89 </p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
90 </div>
91 </div>
92 <div id="slices">
93 <div class="vars">
94 <var id="NUM">randRange( 5, 15 )</var>
95 </div>
96 <p class="spin">A baker has a whole {baguette|loaf of bread}.</p>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
97 <p class="question spin">
98 How many parallel cuts must {he|she} make to have exactly <code><var>NUM</var></code> even slices?
99 </p>
ced362c @jeresig Run the exercise cleaner.
jeresig authored
100 <div class="solution" data-type="multiple">
101 <p><span class="sol" data-forms="integer"><var>NUM -1</var></span> cuts</p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
102 </div>
103 <div class="hints">
104 <p>One cut will make two slices, two cuts will make three slices, and so on.</p>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
105 <p>Therefore, we need <code><var>NUM - 1</var></code> cuts to make <code><var>NUM</var></code> slices.</p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
106 </div>
107 </div>
108 <div id="fences">
109 <div class="vars">
110 <var id="LENGTH">randRange( 10, 20 )</var>
111 </div>
112 <p><var>person( 1 )</var> is building a straight fence, with posts one meter apart.</p>
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
113 <p class="question" data-if="isMale(1)">
114 If the fence is <code><var>LENGTH</var></code> meters long, how many fence posts does he need?
115 </p><p class="question" data-else="">
116 If the fence is <code><var>LENGTH</var></code> meters long, how many fence posts does she need?
117 </p>
ced362c @jeresig Run the exercise cleaner.
jeresig authored
118 <div class="solution" data-type="multiple">
119 <p><span class="sol" data-forms="integer"><var>LENGTH + 1</var></span> fence posts</p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
120 </div>
121 <div class="hints">
a129397 @petercollingridge Specify that cuts are parallel and make numbers mathy
petercollingridge authored
122 <p data-if="isMale(1)">
123 If the fence is one meter long, he needs two posts (one for each end).
124 </p><p data-else="">
125 If the fence is one meter long, she needs two posts (one for each end).
126 </p>
127 <p data-if="isMale(1)">
128 If the fence is two meters long, then he needs three posts, and so on.
129 </p><p data-else="">
130 If the fence is two meters long, then she needs three posts, and so on.
131 </p>
132 <p data-if="isMale(1)">
133 Therefore, he needs <code><var>LENGTH + 1</var></code> posts for a <code><var>LENGTH</var></code> meter fence.
134 </p><p data-else="">
135 Therefore, she needs <code><var>LENGTH + 1</var></code> posts for a <code><var>LENGTH</var></code> meter fence.
136 </p>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
137 </div>
138 </div>
139 </div>
140 </div>
ced362c @jeresig Run the exercise cleaner.
jeresig authored
141 </body>
142 </html>
Something went wrong with that request. Please try again.