diff options
| author | Chris Boesch <[email protected]> | 2023-05-07 17:44:07 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-07 17:44:07 +0200 |
| commit | 94f52b929808ebc34d045e7509a3f9c552a8028f (patch) | |
| tree | 1f986c65fab2dbf73c9604458e03dd4ed7974fd0 /exercises | |
| parent | e706c4b42cda7724a466538c503ce94e99aaa52c (diff) | |
| parent | b10e47839843c836bb0ea98e6f29ad7b23678295 (diff) | |
| download | ziglings-94f52b929808ebc34d045e7509a3f9c552a8028f.tar.xz ziglings-94f52b929808ebc34d045e7509a3f9c552a8028f.zip | |
Merge pull request #291 from kimshrier/exercise_098_typo
Improve wording in some comments
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/098_bit_manipulation2.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/exercises/098_bit_manipulation2.zig b/exercises/098_bit_manipulation2.zig index d5ee825..9323548 100644 --- a/exercises/098_bit_manipulation2.zig +++ b/exercises/098_bit_manipulation2.zig @@ -39,7 +39,7 @@ fn isPangram(str: []const u8) bool { // first we check if the string has at least 26 characters if (str.len < 26) return false; - // we uses a 32 bit variable of which we need 26 bit + // we uses a 32 bit variable of which we need 26 bits var bits: u32 = 0; // loop about all characters in the string @@ -50,8 +50,8 @@ fn isPangram(str: []const u8) bool { // // to do this, we use a little trick: // since the letters in the ASCI table start at 65 - // and are numbered by, we simply subtract the first - // letter (in this case the 'a') from the character + // and are numbered sequentially, we simply subtract the + // first letter (in this case the 'a') from the character // found, and thus get the position of the desired bit bits |= @as(u32, 1) << @truncate(u5, ascii.toLower(c) - 'a'); } |
