Skip to content

Commit

Permalink
Update instructions for bit enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
paiv committed Oct 5, 2021
1 parent fb6a55c commit 91b329a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/concept/bomb-defuser/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ makeShuffle(

which takes as input a closure that flips two wires and a closure that rotates the three wires and returns a closure. This returned closure takes the ID number of the stink-bomb and the order of the three wires, and then computes the order the wires need to be cut. This is computed as follows:

For each bit in the ID number, starting with the leftmost bit, you will apply the `flipper` closure to the wires tuple if the bit is a 0 and you will apply the rotator closure if it is a 1 giving the new state of the wires. After the appropriate closures have been applied for all eight bits of the ID, the final state of the wires is the order they need to be cut in.
For each bit in the ID number, starting with the least significant bit, you will apply the `flipper` closure to the wires tuple if the bit is a 0 and you will apply the rotator closure if it is a 1 giving the new state of the wires. After the appropriate closures have been applied for all eight bits of the ID, the final state of the wires is the order they need to be cut in.

```swift
let shuffler = makeShuffle(flipper: flip, rotator: rotate)
Expand Down

0 comments on commit 91b329a

Please sign in to comment.