r/ComputerCraft • • Sep 19 '20

I need a ComputerCraft sorting program.

Hello , I need a sorting program . Do you have one?

1 Upvotes

11 comments sorted by

4

u/RoboticWorks Sep 19 '20

Hello , sorry for the vagueness from the post . I am looking for a program that sorts the item from a chest/ turtle's inventory by item id

6

u/dragon53535 Sep 19 '20

There we go, that's specificity. Programming requires specifics. Sorting is a VERY generic term. And by saying you're sorting items from a chest or turtle inventory, and HOW you're sorting, item id, means that getting you a solution is much, much easier.

That being said, how do you it to be at the end? Do you want to sort the items themselves in place, or do you want to display it? Screenshots/mockups can and will always help.

1

u/RoboticWorks Sep 19 '20

Well, I want the items to be sorted by ID and I want to sort with displaying them.

1

u/East-Ad6184 Feb 27 '22

"There we go, that's specificity. Programming requires specifics. Sorting is a VERY generic term. And by saying you're sorting items from a chest or turtle inventory, and HOW you're sorting, item id, means that getting you a solution is much, much easier."

Are you always so anal about little things?

1

u/dragon53535 Feb 27 '22

Weird necro, do I even know you?

2

u/[deleted] Sep 19 '20

what do you want to sort?

1

u/RoboticWorks Sep 19 '20

Item sorting

3

u/fatboychummy Sep 19 '20

What kind of item sorting?

Like "Type A goes here, type B goes there," or "Sort in alphabetical order by name."

Also, do you have any peripheral mods which allow you to read contents of chests from a computer?

3

u/MufinMcFlufin Sep 19 '20

You'll need to be more specific if you want anyone to help. Are you trying to sort items in the turtle's inventory? Items in a chest? Items in multiple chests? How are you sorting them? Do you want a custom order in which they'd be sorted? Alphabetically? Item id? Something else? Is this going to be used for all general items coming through or can the program assume that only specific items are coming through? Do you want the items all sorted in a single chest, or do you want each new item sorted into a separate chest? What's the layout of the chests?

All of these questions are things that anyone who might work on the program will need to know, and that's assuming anyone will work on it for you.

10

u/boxesandcircles Sep 19 '20

In a turtle? In a chest? Can you even say please? Jesus this post is rude.

2

u/MyNameIsTrez Sep 19 '20

I suggest looking at this Wikipedia page as it describes the simplest sorting algorithm out there, go to the "Pseudocode implementation" header to see how you could write it in Lua for your ComputerCraft program: https://en.wikipedia.org/wiki/Bubble_sort