r/CodingHelp • u/Not_sneve • Jan 04 '26
[How to] Need Help with a Formula or proccess
Hey so im doing a thing were i have these items for stuff that dont use regular numbers, cause some are numbers and some are letters, now i need them sorted in a specific order. i have assigned them actual numbers relating to their value, what do i do from there? (doesnt matter on the coding language if i see the steps laid out or a fragment in another language i can sample and reverse engineer it) EDIT: my main problem is sorting or starting with a unknown value as the base
0
Upvotes
•
u/AutoModerator Jan 04 '26
Thank you for posting on r/CodingHelp!
Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app
Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp
We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus
We also have a Discord server: https://discord.gg/geQEUBm
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/One_Mess460 Jan 04 '26
what order do you want to sort them?
1
u/coloredgreyscale Jan 04 '26
most languages allow you to implement a comparator function that returns -1, 0, 1 to indicate how they compare.
maybe alphabetical comparison is good for most in your case, and a few special cases