联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> javajava

日期:2018-10-07 09:59

QUIZ 9

COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_9.py

Enter an integer: 0

Here is the grid that has been generated:

NW NW NE SW NW NW SW

NW SW SE SE SW SE NE

SW SE SW NE NE SW NW

NE SW NW SW SE NW NW

SW NE NE NE NW NE NW

SW SE SW NE SE SE SE

SE NW NE NE SW NW NE

There is no path to (0, 0)

The preferred path to (6, 0) is:

[(3, 3), (3, 4), (4, 3), (5, 4), (6, 3), (6, 2), (6, 1), (6, 0)]

There is no path to (6, 6)

The preferred path to (0, 6) is:

[(3, 3), (2, 3), (1, 3), (0, 4), (0, 5), (0, 6)]

$ python3 quiz_9.py

Enter an integer: 1

Here is the grid that has been generated:

SE NE SW NE NW NW NW

NW SE NE NW NE NW NW

NE NW SW SE NE SW NE

NE NE NE NW SE NW NE

SE NW NW SE SW SE SE

NW SW NE NW NE SE SW

NE SW NW SE SW SW NW

The preferred path to (0, 0) is:

[(3, 3), (2, 2), (1, 2), (0, 1), (0, 0)]

There is no path to (6, 0)

The preferred path to (6, 6) is:

[(3, 3), (3, 2), (4, 3), (5, 4), (6, 5), (6, 6)]

The preferred path to (0, 6) is:

[(3, 3), (3, 2), (4, 3), (4, 4), (3, 5), (2, 4), (1, 4), (0, 4), (1, 5), (0, 6)]

Date: Session 2, 2018.

2 COMP9021 PRINCIPLES OF PROGRAMMING

$ python3 quiz_9.py

Enter an integer: 2

Here is the grid that has been generated:

NE NE NE SW SE SW SW

SE NE SE NW NW SW NW

SW NE NE SW NW SW NW

NW SE SE SE SE NE SE

SW SE SE SW SE NW NW

SW SW SW NW SE NW NW

SE NW SW NW SW NW NW

There is no path to (0, 0)

The preferred path to (6, 0) is:

[(3, 3), (4, 3), (5, 3), (6, 2), (6, 1), (6, 0)]

There is no path to (6, 6)

The preferred path to (0, 6) is:

[(3, 3), (3, 4), (2, 5), (1, 6), (0, 6)]

$ python3 quiz_9.py

Enter an integer: 3

Here is the grid that has been generated:

SE SE SW NW NE NE NW

SW SE SE NW NW NW SE

SE SE NW NE NE SE NE

SW NE SW NW NW NW NW

NW SE SW NE NE SE NW

SE SW NW SW NW NW SW

NW SE SW NE SW SE SW

There is no path to (0, 0)

The preferred path to (6, 0) is:

[(3, 3), (3, 2), (4, 1), (4, 0), (5, 0), (6, 0)]

There is no path to (6, 6)

The preferred path to (0, 6) is:

[(3, 3), (2, 3), (1, 4), (1, 5), (0, 6)]

QUIZ 9 3

$ python3 quiz_9.py

Enter an integer: 4

Here is the grid that has been generated:

SE SW NE NW NW SE NE

NE NE NW SW NE SE SW

SW SE NE SW SE NE SW

SW SE SE SW SW SW NE

SW NW SE SE SE NW SW

NE SW NE SW SW SE NW

NW SW NW NW SE SE SW

There is no path to (0, 0)

There is no path to (6, 0)

The preferred path to (6, 6) is:

[(3, 3), (3, 4), (4, 4), (5, 5), (6, 6)]

The preferred path to (0, 6) is:

[(3, 3), (2, 4), (3, 5), (2, 6), (1, 5), (0, 6)]

$ python3 quiz_9.py

Enter an integer: 5

Here is the grid that has been generated:

SW SW NE NW SE NE SE

NE SW NW SE NW NE SE

NE SE NW SW SE NW SE

NE SE NW SE SE NE NE

SE SE SE SE SW SW SE

SE SE SE NW SW NE SW

NW SE SE SW NE SW SW

The preferred path to (0, 0) is:

[(3, 3), (4, 3), (5, 3), (5, 2), (4, 1), (3, 1), (3, 2), (2, 2), (1, 1), (0, 1), (0, 0)]

The preferred path to (6, 0) is:

[(3, 3), (4, 3), (5, 3), (5, 2), (5, 1), (6, 0)]

The preferred path to (6, 6) is:

[(3, 3), (4, 3), (5, 4), (5, 5), (6, 5), (6, 6)]

There is no path to (0, 6)


版权所有:留学生程序网 2020 All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。