diff options
-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 e88d4f9..78174a3 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 ccd3cd8..7c1f4fd 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 |