| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bugs:
Do not consider the puzzle solved if all letters in the visible area are
substituted correctly. To be properly solved, the whole puzzle must be
solved, even those parts that are currently off-screen.
Never place the cursor at the very right edge of the screen since that
does not work well with some terminals. The maximum valid x coordinate
is COLS - 1.
Add horizontal scrolling. Make all coordinate handling symmetric in
regard to the horizontal and vertical axes. Previously, lines longer
than 80 characters could not be seen on the screen.
Improvements:
Remove the arbitrary limit of 128 characters per line. Even if
fortune(6) may never generate such long lines, the code is easy enough
to adapt to other sources.
Properly clean up the allocated memory. Previously, only the string
arrays were freed but not the strings themselves.
Stylistic:
Add RCS ID.
Fix ctype functions in lint's strict bool mode.
Avoid excessive calls to strlen whenever the cursor moves. Given that
the whole screen is redrawn every time a key is pressed, this is an
unnecessary optimization, but the code smelled nevertheless.
|
|
|
|
|
|
|
| |
Eliminate some frequently occurring subexpressions during substitution.
No functional change, assuming that fortune(6) always spits out less
than 2 gigacharacters of text.
|
|
|
|
|
|
|
|
| |
Having to convert back and forth between char, unsigned char and int is
confusing. Just stay with char, until the support for wide characters
is added.
No functional change.
|
|
|
|
|
|
| |
The key codes for function keys are outside of the "range representable
by an unsigned char". This resulted in parts of the screen being
cleaned.
|
|
|
|
|
|
|
| |
The biggest change is the return type of substitute(). Before, 0 meant
success, now false means failure.
No functional change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With manual corrections afterwards:
- indent removes empty lines between statement and declaration. This
had been a syntax error in C90, since C99 this is common style and
should be accepted by indent.
- indent didn't format the first line of main for whatever reason, did
that manually.
- indent removed the empty line above the '/////' separators. It should
have left these empty lines as-is.
|
|
|
|
| |
Reported by liweitianux via GitHub.
|
| |
|
| |
|
|
|
|
|
|
|
| |
The previous shuffle algorithm asked for 100 random numbers, on average.
The new algorithm asks exactly for 26 random numbers.
Curses predefines numeric constants for keys, and there is no apparent
reason not to use these standard keys for cursor movement.
|
| |
|
|
substitution ciphers. It gets the cleartext from fortune. I wrote this
some years ago for my own amusement; a couple people have suggested
that I should import it.
Approved only by groo, so I'm going to wait a couple days to hook it
to the build in case anyone demands it be removed again...
|