#Cursed code-formatter

1 messages · Page 2 of 1

restive crown
#

It fends of job acceptance letters, too

#

Laugh

silent widget
#

Sorting a string alphabetically can provide insights into the statistical usage of characters, perhaps

#

lets you compare how many times "z" appears in a language compared to "y"

#

for example

#

though there's better ways to do that

#

by... y'know... counting the characters

restive crown
silent widget
#

indeed. Still, makes the sorter not 100% useless

#

just like 99%

#

Possibly it could be somewhat useful for font analysys. though I fail to see a specific use case

restive crown
#

Yea

silent widget
#

but it'd make me cEhir and I gotta say, that's a pretty cool name

#

i'd turn you into aefglstu

#

OH actually I do have a pseudo-practical application @restive crown - I did at some point write one of those sorters in order to test a GUI. So I suppose it can be useful for testing purposes.

...then again, most things can be useful for testing purposes.

restive crown
#

Yep

restive crown
#

With flags and everything

#

I think the next feature I should add is a -f -o to read from a file and output it to a file

silent widget
#

another flag to sort the file's name alphabetically too

restive crown
#

Wait

#

-c to make it a copy, without -c it sorts the text in place

#

I think I can create a new file with the sorted name, then delete the old file?

silent widget
#

should be absolutely doable

restive crown
#

I can name this the most advanced string sorter kekw

silent widget
#

we'd have a great use case for it here

restive crown
#

Because __FILE__ only works for the file you write it in

silent widget
#

you could of course also just sort the name of the file's copy, assuming the c flag is given

#

this would also mean that you don't have to attach some arbitrary file extension to avoid name conflict with the source file

restive crown
#

Unless the file is in alphabetical order already, e.g. .git, it'll probably not conflict

#

but .git is a folder, so

silent widget
#

I wonder how that's manifest. Sort all the characters into one file? sort each file but leave the files themselves be?

restive crown