Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 123 lines (117 sloc) 5.755 kB
4526367 @marcia Add exercise -- multiplication 0.5
marcia authored
1 <!DOCTYPE html>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
2 <html data-require="math graphie graphie-helpers-arithmetic">
cde9e9f @jeresig Re-run the exercises through the updated cleaner.
jeresig authored
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">
bc61129 @spicyj Update title tags
spicyj authored
5 <title>Multiplying 1-digit 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>
4526367 @marcia Add exercise -- multiplication 0.5
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">
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
11 <div id="missing-C">
12 <div class="vars" data-ensure="A !== 0 || B !== 0">
13 <var id="A">randRange(0, 10)</var>
14 <var id="B">randRange(0, 10)</var>
15 <var id="C">A * B</var>
16 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
17 <div class="question">
18 <code>\Huge\blue{<var>A</var>}\times\green{<var>B</var>}=\pink?</code>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
19 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
20
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
21 <div class="solution" data-forms="integer"><var>C</var></div>
22
23 <div class="hints">
3542fde @alopatin Things that aren't interactive shouldn't be orange
alopatin authored
24 <div data-if="A > 1 && B > 1" data-unwrap="">
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
25 <div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
26 <p>
27 Let's picture this problem by drawing <code>\green{<var>B</var>}</code> rows of <code>\blue{<var>A</var>}</code> circles.
28 </p>
29 <div class="graphie">
30 init({
31 range: [[-1, 12], [-2.5, B - 2.5]],
32 scale: [45, 45]
33 });
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
34 for (var i = 0; i &lt; B; i++) {
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
35 drawRow(A, B - 3 - i, BLACK, A * i + 1);
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
36 }
37 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
38 <p>
39 How many circles are there?
40 </p>
41 </div>
42 </div>
43 <div data-else-if="A === 0 || B === 0">
44 <div data-if="A === 0">
45 If we have <code>\green{<var>B</var>}</code> zeros, how much do we have in total?
46 </div>
47 <div data-else="">
48 If we have <code>\blue{<var>A</var>}</code> zeros, how much do we have in total?
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
49 </div>
50 </div>
51 <div data-else="">
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
52 <div data-if="A === 1">
53 If we have one <code>\green{<var>B</var>}</code>, how much do we have in total?
54 </div>
55 <div data-else="">
56 If we have one <code>\blue{<var>A</var>}</code>, how much do we have in total?
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
57 </div>
58 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
59 <div>
60 <code>\Huge\blue{<var>A</var>}\times\green{<var>B</var>}=\pink{<var>C</var>}</code>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
61 </div>
62 </div>
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
63 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
64
65 <div id="missing-B">
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
66 <div class="vars">
67 <var id="A">randRange(1, 10)</var>
68 <var id="B">randRange(0, 10)</var>
69 <var id="C">A * B</var>
70 <var id="ORDER">rand(2)</var>
71 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
72 <div class="question">
73 <div data-if="ORDER" data-unwrap="">
74 <code>\Huge\blue{<var>A</var>}\times\green{?}=\pink{<var>C</var>}</code>
75 </div>
76 <div data-else="">
77 <code>\Huge\green{?}\times\blue{<var>A</var>}=\pink{<var>C</var>}</code>
78 </div>
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
79 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
80
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
81 <div class="solution" data-forms="integer"><var>B</var></div>
82
83 <div class="hints">
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
84 <div data-if="A > 1 &amp;&amp; B > 1" data-unwrap="">
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
85 <div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
86 <p>
87 How many rows of <code>\blue{<var>A</var>}</code> circles do we need to make <code>\pink{<var>C</var>}</code> total circles?
88 </p>
89 <div class="graphie">
90 init({
91 range: [[-1, 12], [-2.5, B - 2.5]],
92 scale: [45, 45]
93 });
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
94 for (var i = 0; i &lt; B; i++) {
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
95 drawRow(A, B - 3 - i, BLACK, A * i + 1);
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
96 }
97 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
98 <p>
99 We need <code>\green{<var>B</var>}</code> rows of <code>\blue{<var>A</var>}</code> circles to make <code>\pink{<var>C</var>}</code> total circles.
100 </p>
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
101 </div>
102 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
103 <div data-else-if="B === 0">
104 What times <code>\blue{<var>A</var>}</code> equals zero?
105 </div>
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
106 <div data-else="">
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
107 What can we multiply by <code>\blue{<var>A</var>}</code> to get <code>\pink{<var>C</var>}</code>?
b4d1211 @petercollingridge Update hints for dealing with multiplication by 0
petercollingridge authored
108 </div>
2aa3ccc @alopatin Get rid of excessive whitespace due to graphies in hints.
alopatin authored
109 <div>
110 <div data-if="ORDER" data-unwrap="">
111 <code>\Huge\blue{<var>A</var>}\times\green{<var>B</var>}=\pink{<var>C</var>}</code>
112 </div>
113 <div data-else="">
114 <code>\Huge\green{<var>B</var>}\times\blue{<var>A</var>}=\pink{<var>C</var>}</code>
115 </div>
4e4cb9b @beneater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
116 </div>
117 </div>
118 </div>
119 </div>
120 </div>
cde9e9f @jeresig Re-run the exercises through the updated cleaner.
jeresig authored
121 </body>
122 </html>
Something went wrong with that request. Please try again.