## Description

COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_6.py

Enter three nonnegative integers: 0 1 3

Here is the grid that has been generated:

1 1 0

1 1 1

1 1 1

For triangles pointing N, we have: 2 triangles of size 2

For triangles pointing E, we have: 2 triangles of size 2

For triangles pointing S, we have: 1 triangle of size 2

For triangles pointing W, we have:

1 triangle of size 2

$ python3 quiz_6.py

Enter three nonnegative integers: 0 1 4

Here is the grid that has been generated:

1 1 0 1

1 1 1 1

1 0 0 1

0 0 1 0

For triangles pointing N, we have: 1 triangle of size 2

For triangles pointing E, we have: 1 triangle of size 2

For triangles pointing W, we have: 1 triangle of size 2

2 COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_6.py

Enter three nonnegative integers: 0 2 10

Here is the grid that has been generated:

1 1 0 1 1 1 1 1 1 1

1 0 1 0 1 0 0 1 1 1

1 1 0 1 0 1 0 1 1 1

1 0 1 1 1 1 1 0 1 1

1 1 1 0 1 0 0 1 1 1

1 1 0 1 1 1 0 1 1 1

0 0 1 0 0 0 1 1 0 0

1 1 1 0 1 1 1 1 0 1

1 1 0 1 1 1 1 1 0 1

1 1 1 0 1 0 0 0 0 1

For triangles pointing N, we have:

12 triangles of size 2

For triangles pointing E, we have:

11 triangles of size 2

For triangles pointing S, we have: 12 triangles of size 2

For triangles pointing W, we have:

1 triangle of size 3

11 triangles of size 2

$ python3 quiz_6.py

1 1 0 1 1 1

1 1 1 1 1 1

1 1 1 1 1 1

1 1 1 1 1 1

1 1 1 1 1 1

1 1 1 1 1For triangles pointing N, we have: 1

7 triangles of size 3

Enter three nonnegative integers: 0 10 6

Here is the grid that has been generated:

12 triangles of size 2

For triangles pointing E, we have:

7 triangles of size 3

12 triangles of size 2

For triangles pointing S, we have:

6 triangles of size 3

11 triangles of size 2

For triangles pointing W, we have:

7 triangles of size 3

12 triangles of size 2

QUIZ 6 3

$ python3 quiz_6.py

Enter three nonnegative integers: 0 8 11

Here is the grid that has been generated:

1 1 0 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1

1 1 0 1 0 1 1 0 1 1 1

1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1

0 1 1 1 1 1 1 0 1 1 1

1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 0 1 1 1 1

1 1 1 0 1 1 1 0 1 1 0

For triangles pointing N, we have:

5 triangles of size 4

20 triangles of size 3

38 triangles of size 2

For triangles pointing E, we have:

5 triangles of size 4

22 triangles of size 3

38 triangles of size 2

For triangles pointing S, we have:

3 triangles of size 5

7 triangles of size 4

20 triangles of size 3

36 triangles of size 2

For triangles pointing W, we have:

1 triangle of size 5

8 triangles of size 4

19 triangles of size 3

39 triangles of size 2

## Reviews

There are no reviews yet.