Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
# -------------------- making tab wide to please the eyes --------------------
prepp = get_world_size()
coord = prepp - 1
#Resets Drone to 0,0
def origin():
while get_pos_x() != 0:
move(East)
while get_pos_y() != 0:
move (North)
origin()
#Preps First Row (X=0) for carrots
a = 0
while a <= prepp: # a = 4 after carrots are done
if get_ground_type() == Grounds.Grassland:
till()
plant(Entities.Carrot)
move(North)
a = a + 1
move(South)
move(East)
#Preps Second Row (X=1) for pumkins
while a <= prepp * 2: # a = 8 after pumkins are done
if get_ground_type() == Grounds.Grassland:
till()
plant(Entities.Pumpkin)
move(North)
a+=1
origin()
#Carrots
while True:
if get_pos_x() == 0:
if get_pos_y() < 3:
if can_harvest():
harvest()
plant(Entities.Carrot)
move(North)
if get_pos_y() == 3:
if can_harvest():
harvest()
plant(Entities.Carrot)
move(North)
move(East)
#Pumkins
if get_pos_x() == 1:
if get_pos_y() < 3:
if get_entity_type() == None:
plant(Entities.Pumpkin)
if can_harvest():
harvest()
plant(Entities.Pumpkin)
move(North)
if get_pos_y() == 3:
if get_entity_type() == None:
plant(Entities.Pumpkin)
if can_harvest():
harvest()
plant(Entities.Pumpkin)
move(North)
move(East)
#Logs
if get_pos_x() == 2:
if get_pos_y() < 3:
if can_harvest():
harvest()
plant(Entities.Bush)
move(North)
if get_pos_y() == 3:
if can_harvest():
harvest()
plant(Entities.Bush)
move(North)
move(East)
#Hay
if get_pos_x() == 3:
if get_pos_y() < 3:
if can_harvest():
harvest()
plant(Entities.Grass)
move(North)
if get_pos_y() == 3:
if can_harvest():
harvest()
plant(Entities.Grass)
move(North)
move(East)
very if'y (hehe), i tried using "for i in range(x)" however i couldnt do much to figure it out to make it work. you can prolly see my idea better here. i want to be able to have the main terminal see what x pos its in and run the appropriate terminal that is associated with whatever crop ive assigned to that column
Also, anyone in these forums will either A: not understand your code, or B: not care about your code; don't bother [spoiler]ing it, it just makes it harder for people to read through it because if your cursor wanders off the text while you're scrolling (or your finger, on mobile), it goes black again.
... and all of that aside, I just have to ask:
Why do you dislike the idea of additional functions?
Separate your concerns, and you can do something like this:
... and with all of that said, perhaps you just didn't know this:
We can already do this, and what you are asking for is more complicated than the existing system.
Just define carrots() in any window, and any window (same or other) can call it. Every window's functions are accessible from every other window... although only the window you press the "play" button on will instantiate its vars that live outside functions.