The circuit checks whether the 4-digit code input on the lecterns is exactly correct.
Instructions:
Use this formula to figure out the power output of the lectern on the desired page for each section: floor(1 + ((current page − 1) ÷ (number of pages in book − 1)) × 14)
The hopper in each section needs to be filled with items to match 1 power level lower than its respective lectern. I used this as a guide (but had to adjust the amounts slightly.. maybe there's been an update?): http://imgur.com/68F63Ia. Alternatively, you could put lecterns with 15 page books (each page corresponds to the matching level).
---
I'm new to redstone, so open to any input/suggestions of how this could be improved. I couldn't figure out how to position the lecterns directly next to eachother without the redstone lines crossing, so very interested in if there's a way to manage that.