I agree with jsoverson -- I actually didn't understand what you wanted from the description, and the simple return statement is certainly the easiest way to achieve what turns out to be what you wanted. This kata should definitely have a goal that's more than just that if you want to teach the bitwise operators.
Yeah, see the comments above... originally, I made it so you only had access to the bitwise operators through a machine... but it felt a bit contrived, so I just left it as DIY with some encouragement to use the bitwise ops.
I agree with jsoverson -- I actually didn't understand what you wanted from the description, and the simple return statement is certainly the easiest way to achieve what turns out to be what you wanted. This kata should definitely have a goal that's more than just that if you want to teach the bitwise operators.
@markrozencwajg, reduce has an optional initial value argument
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Any suggestions or can you paste your solution?
Yeah, see the comments above... originally, I made it so you only had access to the bitwise operators through a machine... but it felt a bit contrived, so I just left it as DIY with some encouragement to use the bitwise ops.