Search Stacks

Every spine is covered and each peek costs a step! Use binary search, insertion points, bisecting, peak finding and staircase search to find books in as few peeks as possible.

Play

A puzzle game about search algorithms. In the owl librarian's stacks the books are already in number order, but every spine is covered, and peeking at one to read its number costs a step. Checking one by one from the start is linear search, which can take 31 peeks for 31 books. Peek in the middle instead: bigger than the target means the first half, smaller means the second half. Each peek rules out half, so 31 books take at most 5 peeks. That is binary search.

This library is sneaky: the hidden answer is only decided when you peek, and it always hides in the bigger half, so your step count is the true worst case. Only splitting what is left into equal halves every time earns 3 stars. Ruled-out books turn grey on their own, the task bar records how many possibilities remain after each peek (31, 15, 7, 3, 1), and the results card draws that halving as a bar chart next to the worst case for checking one by one.

There are 5 chapters and 30 levels, each chapter a classic search: The Sorted Shelf (binary search), Where Does It Go? (the insertion point), The First Misprint (like the git bisect tool programmers use), The Tallest Book (peak finding, where you compare a book with its neighbour) and The Card Catalog (a table sorted along every row and column, searched as a staircase from the top-right corner). An endless Random challenge is included. Every puzzle is generated fresh, and the 3-star mark is the algorithm's worst case.

How to play

  1. Tap "Start searching" to carry on from the first level you haven't cleared, or pick a chapter from "Levels". The first time you open a chapter, a librarian note explains its search method with a small picture, and "Librarian notes" on the title screen lets you read them again.
  2. The task bar at the top says what to find (for example "Find book number 653") and the rule for the level. Tap a book to peek at it, and the owl explains what it told you and how many possibilities are left. Books that can no longer be the answer turn grey and striped, and tapping them costs nothing. The small number on a book is its position; the big number in the middle, once you peek, is its call number.
  3. The goals: in Chapter 1, peek at the book you are looking for; in Chapter 2, find the gap with a smaller book on its left and a bigger one on its right (no matching book needed); in Chapter 3, find the first misprinted copy (the one before it is fine); in Chapter 4, find the book taller than both neighbours by peeking at pairs side by side; in Chapter 5, find the number in a catalog where every row and column runs from small to big.
  4. Peeking within the 3-star mark earns 3 stars, 1–2 more peeks 2 stars, and more than that 1 star. The light bulb makes the best book blink but caps the level at 2 stars. You can't fail and there is no timer; the bottom-left button starts a new puzzle. Clearing 3 levels of a chapter opens the next one.

Controls

For parents

Last updated:

You might also like