diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2002-07-09 02:56:10 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2002-07-09 02:56:10 +0000 |
| commit | 518b7839f2ee0ffb32d5641e61a39f45feb6d94e (patch) | |
| tree | 09a2ecaee506e51d20c662e00994c651c18baa1d /games | |
| parent | 7da9dccb668d7db7c182d36f82cd2d083574d1bc (diff) | |
Notes
Diffstat (limited to 'games')
| -rw-r--r-- | games/fortune/datfiles/fortunes | 8 | ||||
| -rw-r--r-- | games/fortune/datfiles/fortunes2 | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/games/fortune/datfiles/fortunes b/games/fortune/datfiles/fortunes index e88d4f9681a67..78174a3e9dc39 100644 --- a/games/fortune/datfiles/fortunes +++ b/games/fortune/datfiles/fortunes @@ -1417,6 +1417,14 @@ music at top volume and at least a pint of ether. -- C code which reverses the bits in a word. % + n = (n & 0x55555555) + ((n & 0xaaaaaaaa) >> 1); + n = (n & 0x33333333) + ((n & 0xcccccccc) >> 2); + n = (n & 0x0f0f0f0f) + ((n & 0xf0f0f0f0) >> 4); + n = (n & 0x00ff00ff) + ((n & 0xff00ff00) >> 8); + n = (n & 0x0000ffff) + ((n & 0xffff0000) >> 16); + + -- C code which counts the bits in a word. +% " ... I told my doctor I got all the exercise I needed being a pallbearer for all my friends who run and do exercises!" -- Winston Churchill diff --git a/games/fortune/datfiles/fortunes2 b/games/fortune/datfiles/fortunes2 index ccd3cd891dee9..7c1f4fd418587 100644 --- a/games/fortune/datfiles/fortunes2 +++ b/games/fortune/datfiles/fortunes2 @@ -2707,6 +2707,13 @@ audience, either." -- Reverse the bits in a word. % + n = (n & 0x55555555) + ((n & 0xaaaaaaaa) >> 1); + n = (n & 0x33333333) + ((n & 0xcccccccc) >> 2); + n = (n & 0x0f0f0f0f) + ((n & 0xf0f0f0f0) >> 4); + n = (n & 0x00ff00ff) + ((n & 0xff00ff00) >> 8); + n = (n & 0x0000ffff) + ((n & 0xffff0000) >> 16); +-- Count the bits in a word. +% Never ask your lover if he'd dive in front of an oncoming train for you. He doesn't know. Never ask your lover if she'd dive in front of an oncoming band of Hell's Angels for you. She doesn't know. Never ask how many |
