# Times Table explainer

The aim of this puzzle: Calculate the total number of boxes by multiplying the `rows` and `columns`.

Walkthrough of the solution: The area of a rectangle is calculated by multiplying the height and width. In the same way, you can calculate the total number of boxes arranged in a rectangle by multiplying the number of rows by the number of columns.

The multiplication symbol in JavaScript is the asterisk `*`. The `total` variable should store the `rows` times the `columns`. Delete the 100, and replace it with `rows * columns`.

Sample code solution:
(Tap below to reveal)

``````print(rows + 'x' + columns);
var total = rows * columns;
print(total + ' boxes');
``````

JavaScript Concepts: Arithmetic Operators (* multiplication), Binary Expression (+ concatenation), Assignments

Grasshopper Concepts: `print()`
Additional Code (hidden code that runs before the puzzle’s code):

``````var rows = pickRandom(4);
var columns = pickRandom(7);
for (let i = 0; i < rows; i++) {
for (let j = 0; j < columns; j++) {
drawBox(pickRandom(color));
}
newLine();
}
``````
1 Like

Can you explain the hidden code in Times Table.

2 Likes

Well I’m doing exactly as I’m told but it’s not accepting…??