In the remainder of this chapter, we will use Q-games with the gym package. It offers a standard API for playing different types of games, so it's the perfect test case for what we want to show you.
Excelling at games
A small example
Anaconda doesn't ship this package, so it has to be installed though pip:
>>> pip install gym[atari]
We won't use the Atari part of the gym, but it will be required for the breakout game.
From this package, we can create an environment for different games, like this:
env = gym.make('FrozenLake-v0')
This creates a new environment for the text game FrozenLake. It consists of four four-character strings, starting with S and ending up at G, the goal. But there are...