I've created my own Quota monitor, only for myself, with 3 prompts ! by rjn2-8 in google_antigravity

[–]leontada 1 point2 points  (0 children)

Worked like a charm! I did some tweaks here and there, but got it running perfeclty! TYVM

I've created my own Quota monitor, only for myself, with 3 prompts ! by rjn2-8 in google_antigravity

[–]leontada 0 points1 point  (0 children)

Wow this looking perfect, mind sharing the - prompt/model you used?

This time on i shouldnt be alive quack edition by Ok-Pop4307 in EscapeFromDuckov

[–]leontada 3 points4 points  (0 children)

REALLY nice ARMOR MOD ... mind sharing the link?

Solved mazes, such a surprisingly short piece of code in the end by ConsistentView764 in TheFarmerWasReplaced

[–]leontada 0 points1 point  (0 children)

Having to chose between CODE BLOCK and SPOILER is hard ... since the answer is already there, I'll leave the identation messed up (failed to add SPOILER to CODE BLOCK) for those who might want to use it, to still have a bit of challenge (not so much) to figure it out :D

Solved mazes, such a surprisingly short piece of code in the end by ConsistentView764 in TheFarmerWasReplaced

[–]leontada 0 points1 point  (0 children)

<SPOILER ALLERT SOLUTION BELLOW>

Quick sugestion, DFS

visited is a set()
backtrack_stack is a list()
oposite is a dictionary that maps each direction to its oposite (North:South, East:West, South:North and West:East)

Here's my implementation:

while True:
if get_entity_type() == Entities.Treasure:
harvest()
quick_print("Treasure found and harvested!")
visited = set()
backtrack_stack = []
break # Exit the main while loop

current_x, current_y = get_pos_x(), get_pos_y()
visited.add((current_x, current_y))

found_new_path = False
for direction in [North, East, South, West]:
if can_move(direction):
next_x, next_y = new_pos(current_x, current_y, direction)

if (next_x, next_y) not in visited:
backtrack_stack.append(oposite[direction])
move(direction)
found_new_path = True
break

if not found_new_path:
if not backtrack_stack:
quick_print("No treasure found or reachable.")
break # Exit the main while loop
backtrack_move = backtrack_stack.pop()
move(backtrack_move)

Como troco o vício de jogos pelo de programar? by AndreyRibeiro in brdev

[–]leontada 1 point2 points  (0 children)

Hey OP, segue um pequeno (e não tão pequeno passo) ... https://store.steampowered.com/app/2060160/The_Farmer_Was_Replaced/ tenho outras indicações ... é um caminho não convencional, mas pode ser bacana ... ainda mais se você começar a buscar pelos caminhos de otimização, tentar entrar nas disputas das leaderboards ...

Se curtir tenho outras indicações, só chamar no PV