Back
Close

Plot

Statement
You will receive a polynomial equation and must plot it in the interval 0 ≤ [[y]],[[x]] ≤ 9, the value of the equation must be truncated to integer before entering it on the chart. All results of the equation after truncating that exceed the limits of the axes must be discarded. For simplicity (0,0) is in the upper left corner.

Input description
<<Line 1 :>> An <<equation>> in the format: x = (c_0 * y**0) + (c_1 * y**1) + (c_2 * y**2) + ... + (c_n * y**n) When the coefficients are 0, the term will be omitted.

Output description
Matrix 10 x 10 with the chart

Constraints
equation length ≤ 50

Game modes
Shortest

Test cases
Test 1 Test
Input
x = (1 * y**1)
Output
o......... .o........ ..o....... ...o...... ....o..... .....o.... ......o... .......o.. ........o. .........o

Validator 1 Validator
Input
x = (2 * y**1)
Output
o......... ..o....... ....o..... ......o... ........o. .......... .......... .......... .......... ..........

Test 2 Test
Input
x = (9 * y**0) + (-1 * y**1)
Output
.........o ........o. .......o.. ......o... .....o.... ....o..... ...o...... ..o....... .o........ o.........

Validator 2 Validator
Input
x = (8 * y**0) + (-1 * y**1)
Output
........o. .......o.. ......o... .....o.... ....o..... ...o...... ..o....... .o........ o......... ..........

Test 3 Test
Input
x = (0.12 * y**2)
Output
o......... o......... o......... .o........ .o........ ...o...... ....o..... .....o.... .......o.. .........o

Validator 3 Validator
Input
x = (0.10 * y**2)
Output
o......... o......... o......... o......... .o........ ..o....... ...o...... ....o..... ......o... ........o.

Test 4 Test
Input
x = (0.5 * y**0) + (8.9 * y**1) + (-2.7 * y**2) + (0.2 * y**3)
Output
o......... ......o... .........o ........o. .....o.... ..o....... o......... o......... .o........ .......o..

Validator 4 Validator
Input
x = (0.45 * y**0) + (8.88 * y**1) + (-2.688 * y**2) + (0.2048 * y**3)
Output
o......... ......o... .........o ........o. ......o... ...o...... .o........ .o........ ....o..... ..........

edge case Test
Input
x = (-0.1 * y**0)
Output
o......... o......... o......... o......... o......... o......... o......... o......... o......... o.........

Validator 5 Validator
Input
x = (-0.5 * y**0)
Output
o......... o......... o......... o......... o......... o......... o......... o......... o......... o.........

Out of range Test
Input
x = (3 * y**1)
Output
o......... ...o...... ......o... .........o .......... .......... .......... .......... .......... ..........

Validator 6 Validator
Input
x = (4 * y**1)
Output
o......... ....o..... ........o. .......... .......... .......... .......... .......... .......... ..........

Solution language

Solution

Stub generator input