for x in range(get_world_size()): if x % 2 == 0: y_range = range(get_world_size()) else: y_range = range(get_world_size() - 1, -1, -1) for y in y_range: if can harvest(): harvest() plant(Entities.) moveTo(x,y)
@@EmM-ko7mu random movement Will work as long as there is a way therebut will be slow. You can weight the direction which gets you close since you can sense terasure position. Other way Is wall folowing. That will work as long as there Is no loop but is significantly faster.
@@EmM-ko7muall moves Are relative to your current foward 1. remember a direction (does not master which one) as foward 2. Try moving to direction perpendicular to that you are moving in (e.g. right) 3. On suceed this Is your new move direction 4. On faliure go foward 5. Repeat from step 2. untill above terasure
@@mkDaniel and if 3 and 4 both fail as you are at a dead end you then cant move with those rules as forward left and right are all blocked. if you then pick back as the new direction youll hit a wall and try to go right which puts you right back into the dead again again. do you just randomly pick a perpendicular direction and not preference one as if you do you end up in a clockwise loop. i dont see it i legitimately gave this multiple hours of thought before giving up
1:27 the eternal struggle of a programmer...
Right!? It'll probably change 100 times and end up back at "test" before we're done 🤣
Great video, you got you a subscriber
Thanks so much @romanobreuer9230! Got more vids in the pipeline, plan on revisiting this one eventually! 😁
for x in range(get_world_size()):
if x % 2 == 0:
y_range = range(get_world_size())
else: y_range = range(get_world_size() - 1, -1, -1)
for y in y_range:
if can harvest(): harvest()
plant(Entities.)
moveTo(x,y)
This is beautiful and made me tear up a little, I am definitely making another video and putting this in!
i give up on the maze theres no way i can do that without random movements. the hints in game dont help
I've seen some snapshots on the maze, haven't got there yet so keep your fingers crossed for me!
@@EmM-ko7mu random movement Will work as long as there is a way therebut will be slow. You can weight the direction which gets you close since you can sense terasure position. Other way Is wall folowing. That will work as long as there Is no loop but is significantly faster.
@@mkDaniel not smart enough to know how to follow the walls. thats the issue i dont see the pattern to follow even forgetting about code.
@@EmM-ko7muall moves Are relative to your current foward
1. remember a direction (does not master which one) as foward
2. Try moving to direction perpendicular to that you are moving in (e.g. right)
3. On suceed this Is your new move direction
4. On faliure go foward
5. Repeat from step 2. untill above terasure
@@mkDaniel and if 3 and 4 both fail as you are at a dead end you then cant move with those rules as forward left and right are all blocked. if you then pick back as the new direction youll hit a wall and try to go right which puts you right back into the dead again again. do you just randomly pick a perpendicular direction and not preference one as if you do you end up in a clockwise loop. i dont see it i legitimately gave this multiple hours of thought before giving up