Hello I need help writing a program that repeated shows all possible moves of a queen or a knight in a chess game. The board will be 8 x 8 array of characters.
k- knight
q - queen
Knight has 8 possible moves
void move_queen (char board [8][8], int row, int col)
laces the queen, Q on the board at the qiven row and column and places * characrters in all aquares where the queen can legally move.
void move_knight (char board [8][8], int row, int col)
laces the queen,K on the board at the qiven row and column and places * characrters in all aquares where the queen can legally move.
I have this so far and I am losted and puzzled
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
void init_board (char board [8][8]);
void move_queen (char board [8][8], int row, int col);
void move_knight (char board [8][8], int row, int col);
void print_board (char board [8][8]);
int main(int argc, char *argv[])
{
char board [8][8];
int row, col;
char piece, q, k, e;
cout <<"Enter q (queen), k (knight) or e (end): ";
cin >> piece;