AI Features

Rendering the Board

Learn how to render the board.

By the end of this lesson, you will implement render_board(board) that takes the current board as input and returns a string ASCII board formatted as follows, so the user can get a look and feel of a command line game:

Backend board:

[[0, 0, 2, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
Backend board in the code

Rendered board:

+-----+-----+-----+-----+
| | | 2| |
+-----+-----+-----+-----+
| | | | |
+-----+-----+-----+-----+
| | | | |
+-----+-----+-----+-----+
| | | | |
+-----+-----+-----+-----+
Rendering the board on CLI

Step 0: Starting point

We start from the working code in the previous lesson. You already have the following in place:

    ...