Files
ioccc/1984/laman
Landon Curt Noll 657a0be130 add tool to sort .gitignore content
We sort with lines starting with # first.
We sort with lines starting with * second.
We sort with lines that do not start with [#!*] third.
We sort with lines starting with ! fourth.

Example usage in vim with a keyboard macro <escape>f:

```vim
:map ^[f 1G!G../../bin/sgi^M
```

 or via .vimrc:

```vimrc
" sort the entire .gitignore file using ../../bin/sgi
:map  ^[f 1G!G../../bin/sgi^M
```

 NOTE: The ^[ above is ((Escape)) and ^M is ((Control-M)).

Example usage in shell:

```sh
rm -f t && ../../bin/sgi < .gitignore > t && mv -f t .gitignore
```

Suggested usage:

```sh
bin/all-run.sh bin/sort.gitignore -v 1
```

Sorted all winner .gitignore according to this method.
Sorted all year level .gitignore according to this method.
Sorted top level .gitignore according to this method.
2024-02-01 14:35:49 -08:00
..
2024-02-01 14:35:49 -08:00
2023-10-30 01:52:42 -07:00
2023-07-06 21:49:38 -07:00
2023-12-26 09:00:03 -08:00
2024-01-15 04:29:39 -08:00
2024-01-05 09:33:34 -08:00

To build:

make all

To use:

./laman <positive number>

Try:

The program accepts ONE POSITIVE number. Seeing is believing, so try things like:

./try.sh

./laman 4
./laman 9
./laman 16

This code should run you in circles.

Judges' remarks:

Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed them from:

;++f)a[		b<<5|c]		=d++,b+		=e;for(		f=0;f<O
<<5|c]^		=a[b<<5		|c]^=a[		(k-(b+1		))<<5|c]

to:

;++f)a[		b<<5|c]		=d++,b+=	e;for(		f=0;f<O
<<5|c]^=	a[b<<5		|c]^=a[		(k-(b+1		))<<5|c]

I hope you have a C beautifier!

Author's remarks:

No remarks were provided by the author.

This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:

Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

For more information, see: https://creativecommons.org/licenses/by-sa/4.0/