modularized planting logic by splitting f2.py into main.py, pumpkins.py, and sunflowers.py; updated utilities and added .gitignore
This commit is contained in:
46
main.py
Normal file
46
main.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import utils
|
||||
import pumpkins
|
||||
from __builtins__ import *
|
||||
|
||||
def plant_carrots(width, height):
|
||||
utils.plant_grid(width, height, [Entities.Carrot], 0.75, True)
|
||||
|
||||
def plant_grass(width, height):
|
||||
utils.plant_grid(width, height, [Entities.Grass], 0.75, False)
|
||||
|
||||
def plant_alternating(width, height, plantWith):
|
||||
utils.plant_grid(width, height, plantWith, 0.75, False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
while True:
|
||||
worldSize = get_world_size()
|
||||
|
||||
sectionSize = worldSize // 3
|
||||
|
||||
utils.move_to(0, 0)
|
||||
pumpkins.plant_and_verify(sectionSize, sectionSize)
|
||||
|
||||
utils.move_to(sectionSize+1, 0)
|
||||
plant_carrots(sectionSize, sectionSize)
|
||||
|
||||
utils.move_to(sectionSize*2+1, 0)
|
||||
plant_grass(sectionSize, sectionSize)
|
||||
|
||||
utils.move_to(0, sectionSize+1)
|
||||
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
|
||||
|
||||
utils.move_to(sectionSize+1, sectionSize+1)
|
||||
pumpkins.plant_and_verify(sectionSize, sectionSize)
|
||||
|
||||
utils.move_to(sectionSize*2+1, sectionSize+1)
|
||||
plant_carrots(sectionSize, sectionSize)
|
||||
|
||||
utils.move_to(0, sectionSize*2+1)
|
||||
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
|
||||
|
||||
utils.move_to(sectionSize+1, sectionSize*2+1)
|
||||
plant_alternating(sectionSize, sectionSize, [ Entities.Tree, Entities.Bush ])
|
||||
|
||||
utils.move_to(sectionSize*2+1, sectionSize*2+1)
|
||||
pumpkins.plant_and_verify(sectionSize, sectionSize)
|
||||
Reference in New Issue
Block a user