## Solving a gamebook : introduction

### This post is part of the "Gamebook solver" serie:

- Solving a gamebook : introduction
- Solving a gamebook : roadmap
- Solving a gamebook : chapters
- Solving a gamebook : game state and probability
- Solving a gamebook : implementing the combat system, and first optimizations
- Solving a gamebook : solving the cartwheel game
- Solving a gamebook : a smarter solver
- Solving a gamebook : a simple solver

I will start a series about writing a gamebook solver, more specifically the Fire on the Water episode in the Lone Wolf series. There are several advantages in choosing this book: it is freely available online, it is relatively linear (see the graph), and I liked this series when I was much younger ...

For those who did not grow up in the 80's, a gamebook is a book, divided in small chapters. The book tells an interactive story, where the player can make decisions affecting the outcome of the adventure. Each of the chapters describe the current situation, and give a choice to the player, which usually result in jumping to another chapter. As an example, take a look at the first chapter of the book.

In this context, solving the book means writing a program that will be able to decide what the optimal choice is at each chapter. However, most gamebooks include dice rolls, coin tosses or other random effects. This is the case in the Lone Wolf series, where the player is asked to close his eyes, and place a pencil at random on a numbered grid to "roll" a random number ranging from 0 to 9. The solver I will develop *should* also be able to give the exact success probably associated with each choice.

I have tried twice already to solve a Lone Wolf gamebook, so this blog posts serie will include a few tricks I have learned from the previous failures. Hopefully, the third time's a charm!