18. CODE: Print the Board

Print the Board

Now that you have a board stored in your program, you'll need a way to print it out so you can display the results of your project. In this exercise, you will add a PrintBoard function to print the board one row at a time. When you are done, the printed output should look like:


To Complete This Exercise:

  • Write a void PrintBoard function. The function should accept the board as an argument. The function should print each row of the board with a newline "\n" .
  • When you have written your PrintBoard function, call it from within main() to print the board.


This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: generic
  • Opened files (when workspace is loaded): n/a
  • userCode:

    export CXX=g++-7
    export CXXFLAGS=-std=c++17
    g++() {
    /usr/bin/g++-7 -std=c++17 "$1"
    export -f g++