#๐Ÿ”’ Grid sorting algorithm

19 messages ยท Page 1 of 1 (latest)

slate jetty
#

Looking to make a stash sorter for a game. Stash space is grid of cells. Items have known width and heights. Would like to sort the items. Have seen some basic sorting algorithms but having a bit of trouble imagining how to deal with sized items (beyond 1x1 cells). Should I just be marking the cell range as not needing to be sorted? Or what's a good way to start with this problem?

obsidian heathBOT
#

@slate jetty

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

elfin reef
#

Arrange the cells in a row like in the order u read

#

Than sort based on x criteria

#

Maybe make it to sort based on x criteria and if there are simalar items next to one other sort these smaller groups based on some y criteria

#

Also no need to self implement sorting theres list.sort(key)

slate jetty
#

the sorting I get mostly, but these items have 1-2 width and 1-4 height

elfin reef
#

Oh

#

U sure u dont want to make the user sort? Like its not a bug its a feature

slate jetty
#

correct

elfin reef
#

Would be a fun challenge id say

slate jetty
#

it's an annoying quality of life issue I'm trying to solve actually ๐Ÿ˜†

#

it's fun the first 100 times you do it

elfin reef
#

Try to do it whith defining urself some rules

#

And if u found a good set of rules implement it

#

The way of placing one evrywhere than the next and so on + if one is incorrect backtrack by 1? Would be a slightly smarter way to bruteforce the issue

elfin reef
obsidian heathBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.