Small robots==Dev craft Spaceship flying plate=Flyer,1,2,3,4 [0]
Rule: before and after the Dev can turn right or left, forward and backward step (a) or step (a)
The ship can carry Dev, fly plate can only be the direction of arrow,
Using a for loop makes Dev to collect all chips,
Question: 1. The cycle of flying plate 4321 how to simplify?
2. Finally a=a - 1 why not execute cycle?
CodePudding user response:
I put the original input, great god with a for loop can you help me simplify my trouble, thank you!Flyer [0]. Step (4)
Flyer [1]. Step (3)
Flyer [2]. Step (2)
Flyer [3]. Step (1)
Spaceship. Step (1)
Dev. Step (2)
Dev. Step (2)
Spaceship. Step (2)
Dev. Step (3)
Dev. Step (3)
Spaceship. Step (3)
Dev. Step (4)
Dev. Step (4)
Spaceship. Step (4)
Dev. Step (5)
Dev. Step (5)
CodePudding user response:
For I in range (4) :
Flyer [I]. Step (4 - I)
Spaceship. Step (1 + I)
Dev. Step (- 2 - I)
Dev. Step (2 + I)