add randomization for planting carrots or pumpkins in top-right quadrant
This commit is contained in:
5
f2.py
5
f2.py
@@ -54,8 +54,11 @@ while True:
|
|||||||
utils.move_to(0, worldSize / 2)
|
utils.move_to(0, worldSize / 2)
|
||||||
plant_alternating(worldSize / 2, worldSize / 2, [ Entities.Tree, Entities.Bush ])
|
plant_alternating(worldSize / 2, worldSize / 2, [ Entities.Tree, Entities.Bush ])
|
||||||
|
|
||||||
|
|
||||||
utils.move_to(worldSize / 2, worldSize / 2)
|
utils.move_to(worldSize / 2, worldSize / 2)
|
||||||
|
# the top right quadrant is 50% of the time pumpkin, 50% of the time carrots
|
||||||
|
if random() < 0.5:
|
||||||
|
plant_carrots(worldSize / 2, worldSize / 2)
|
||||||
|
else:
|
||||||
plant_pumpkin(worldSize / 2, worldSize / 2)
|
plant_pumpkin(worldSize / 2, worldSize / 2)
|
||||||
utils.move_to(worldSize / 2, worldSize / 2)
|
utils.move_to(worldSize / 2, worldSize / 2)
|
||||||
while verify_pumpkin(worldSize / 2, worldSize / 2):
|
while verify_pumpkin(worldSize / 2, worldSize / 2):
|
||||||
|
|||||||
Reference in New Issue
Block a user