File: bogosort.texinfo

package info (click to toggle)
bogosort 0.4.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 716 kB
  • ctags: 226
  • sloc: sh: 3,286; ansic: 1,846; makefile: 106
file content (200 lines) | stat: -rw-r--r-- 6,575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
\input texinfo @c -*-texinfo-*-
@c $Id: bogosort.texinfo,v 1.12 2003/06/30 22:19:31 qha Exp $
@c %**start of header
@setfilename bogosort.info
@settitle sorts or doesn't sort files or its standard input
@dircategory Miscellaneous
@direntry
* Bogosort: (bogosort).  Sort (or not) files (or standard input)
@end direntry
@finalout
@setchapternewpage odd
@c %**end of header

@set VERSION 0.4.2

@copying
This file documents the @code{bogosort} command which sorts or doesn't
sort files or its standard input

Copyright (C) 2000, 2001, 2002 Ulrik Haugen

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end copying

@titlepage
@title bogosort
@subtitle sorts or doesn't sort files or standard input
@subtitle for bogosort Version @value{VERSION}
@author by Ulrik Haugen

@page
@vskip 0pt plus 1filll
Copyright @copyright{} 2000, 2001, 2002, 2003 Ulrik Haugen

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end titlepage

@c All the nodes can be updated using the EMACS command
@c texinfo-every-node-update, which is normally bound to C-c C-u C-e.
@node Top, Copying, (dir), (dir)

@ifinfo
This file documents the @code{bogosort} command that sorts or doesn't sort files or its standard input.
@end ifinfo

@c All the menus can be updated with the EMACS command
@c texinfo-all-menus-update, which is normally bound to C-c C-u C-a.
@menu
* Copying::                     How you can copy and share @code{bogosort}.
* Overview::                    Preliminary information.
* Invoking bogosort::           How to run @code{bogosort}.
* Jargon::                      Jargon File entry on @emph{bogo-sort}
* Problems::                    Reporting bugs.
* Concept Index::               Index of concepts.
@end menu

@node Copying, Overview, Top, Top
@include gpl.texinfo

@node Overview, Invoking bogosort, Copying, Top
@chapter Overview
@cindex greetings
@cindex overview

@code{bogosort} sorts files or its its standard input using the bogo-sort
algorithm. (I won't even bother to dream up some bogus advantages here.)

It can also just randomize the lines in its input, allowing you to perform
your own check in a loop.

@code{bogosort} was written by Ulrik Haugen.

@node Invoking bogosort, Jargon, Overview, Top
@chapter Invoking @code{bogosort}
@cindex invoking
@cindex version
@cindex options
@cindex usage
@cindex help
@cindex getting help

The format for running the @code{bogosort} program is:

@example
bogosort [@var{option}] @dots{} [@var{file}] @dots{}
@end example

If any @var{file} is given input is taken from @var{file} in stead of standard
input.

@code{bogosort} supports the following options:

@table @samp
@item --nosort
@itemx -n
Don't check if the output is sorted, just exit after permuting the lines once.

@item --norandom
@itemx -r
If configured with support for /dev/(u)random don't try to read /dev/(u)random
for seeding rand, ignored otherwise.

@item --seed number
@itemx -r
Use @code{number} to seed rand.

@item --output name
@itemx -o
Write output to @code{name} instead of standard output.

@item --help
@itemx -h
Print an informative help message describing the options and then exit.

@item --verbose
@itemx -v
Output a @samp{.} (dot) to standard error for each permutation of the lines,
and send some non critical error messages to standard error.

@item --version
@itemx -V
Print the version number of @code{bogosort} on the standard error output
and then exit.
@end table

@node Jargon, Problems, Invoking bogosort, Top
@chapter Jargon File entry on bogo-sort
@cindex jargon

The following section is taken from the Jargon File
<http://www.catb.org/~esr/jargon/>.

@quotation
@dots{}The archetypical perversely awful algorithm (as opposed to @emph{bubble sort},
which is merely the generic bad algorithm). @emph{Bogo-sort} is equivalent to
repeatedly throwing a deck of cards in the air, picking them up at random, and
then testing whether they are in order. It serves as a sort of canonical
example of awfulness. Looking at a program and seeing a dumb algorithm, one
might say "Oh, I see, this program uses @emph{bogo-sort}." Esp. appropriate
for algorithms with factorial or super-exponential running time in the average
case and probabilistically infinite worst-case running time. Compare
@emph{bogus}, @emph{brute force}, @emph{lasherism}@dots{}
@end quotation

@node Problems, Concept Index, Jargon, Top
@chapter Reporting Bugs
@cindex bugs
@cindex problems

This program is intentionally bogus.

If you find a bug in @code{bogosort}, please send electronic mail to
@w{@samp{qha@@lysator.liu.se}}.  Include the version number, which you can find by
running @w{@samp{bogosort --version}}.  Also include in your message the
output that the program produced and the output you expected.@refill

If you have other questions, comments or suggestions about
@code{bogosort}, contact the author via electronic mail to
@w{@samp{qha@@lysator.liu.se}}.  The author will try to help you out, although he
may not have time to fix your problems.

@node Concept Index,  , Problems, Top
@unnumbered Concept Index

@printindex cp

@shortcontents
@contents
@bye