Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I need to write function below using c: This is function for coding the g

ID: 3567578 • Letter: H

Question

Hello, I need to write function below using c:

This is function for coding the game poppit.

/**
* Function: bb_display
* Description: pretty-prints the current board.
*
*       uses '|', '+' and '-' to "draw" the boundaries
* of the board.
*
*       For full credit rows and columns are labeled with
*        their indices. Column indices displayed "vertically"
*
*       Examples:
*
* This board is full of balloons (like at the beginning of a game).
*
* +-----------------------+
*       0 | + + + = + ^ ^ o + = = |
*       1 | ^ = = o + o + + + ^ = |
*       2 | ^ + ^ o + o + = = = = |
*       3 | = ^ o o = o + + + = = |
*       +-----------------------+
*        0 0 0 0 0 0 0 0 0 0 1
*       0 1 2 3 4 5 6 7 8 9 0
*
*
* This board has some empty slots represented by '.'
* +-----------------------+
*       0 | + + + = + ^ ^ o + = = |
*       1 | ^ = o o + o + + + ^ = |
*       2 | ^ + . o + . + = . . = |
*       3 | . . . o . . + + . . = |
*       +-----------------------+
*        0 0 0 0 0 0 0 0 0 0 1
*       0 1 2 3 4 5 6 7 8 9 0
*
*
* Here is the same board using a space ' ' to
* represent an empty slot.
*
* +-----------------------+
*       0 | + + + = + ^ ^ o + = = |
*       1 | ^ = o o + o + + + ^ = |
*       2 | ^ + o + + = = |
*       3 | o + + = |
*       +-----------------------+
*        0 0 0 0 0 0 0 0 0 0 1
*       0 1 2 3 4 5 6 7 8 9 0
*
*/

Explanation / Answer

Program code:

#include <stdio.h>

#include <conio.h>

void bb_display(void);

void bb_display1(void);

void bb_display2(void);

void main()

{

     bb_display();

     printf(" ");

     bb_display1();

     printf(" ");

     bb_display2();

}

void bb_display(void)

{

     printf(" +-----------------------+ ");

     printf("0 | + + + = + ^ ^ o + = = | ");

     printf("1 | ^ = = o + o + + + ^ = | ");

     printf("2 | ^ + ^ o + o + = = = = | ");

     printf("3 | = ^ o o = o + + + = = | ");

     printf(" +-----------------------+ ");

     printf("   0 0 0 0 0 0 0 0 0 0 1 ");

     printf("   0 1 2 3 4 5 6 7 8 9 0 ");

}

void bb_display1(void)

{

     printf(" +-----------------------+ ");

     printf("0 | + + + = + ^ ^ o + = = | ");

     printf("1 | ^ = o o + o + + + ^ = | ");

     printf("2 | ^ + . o + . + = . . = | ");

     printf("3 | . . . o . . + + . . = | ");

     printf(" +-----------------------+ ");

     printf("   0 0 0 0 0 0 0 0 0 0 1 ");

     printf("   0 1 2 3 4 5 6 7 8 9 0 ");

}

void bb_display2(void)

{

     printf(" +-----------------------+ ");

     printf("0 | + + + = + ^ ^ o + = = | ");

     printf("1 | ^ = o o + o + + + ^ = | ");

     printf("2 | ^ +   o +   + =     = | ");

     printf("3 |     o     + +       = | ");

     printf(" +-----------------------+ ");

     printf("   0 0 0 0 0 0 0 0 0 0 1 ");

     printf("   0 1 2 3 4 5 6 7 8 9 0 ");

}

----------------------------------------------------------------------------------------------------------

Sample output:

  +-----------------------+

0 | + + + = + ^ ^ o + = = |

1 | ^ = = o + o + + + ^ = |

2 | ^ + ^ o + o + = = = = |

3 | = ^ o o = o + + + = = |

+-----------------------+

   0 0 0 0 0 0 0 0 0 0 1

   0 1 2 3 4 5 6 7 8 9 0

+-----------------------+

0 | + + + = + ^ ^ o + = = |

1 | ^ = o o + o + + + ^ = |

2 | ^ + . o + . + = . . = |

3 | . . . o . . + + . . = |

+-----------------------+

   0 0 0 0 0 0 0 0 0 0 1

   0 1 2 3 4 5 6 7 8 9 0

+-----------------------+

0 | + + + = + ^ ^ o + = = |

1 | ^ = o o + o + + + ^ = |

2 | ^ +   o +   + =     = |

3 |     o     + +       = |

+-----------------------+

   0 0 0 0 0 0 0 0 0 0 1

   0 1 2 3 4 5 6 7 8 9 0

*** Process returned 25 ***

Press any key to continue...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote