Part Determine a winner Fall 2016 CSC210 Checkers The final project for this cou
ID: 3575885 • Letter: P
Question
Part Determine a winner Fall 2016 CSC210 Checkers The final project for this course will be creating a program that will allow two people to play the game of checkers The game is played on an 8x8 checkered board. The two players are at opposite ends. Each player has 12 ed pieces placed on the three rows closest to their side, pieces are placed on the dark The squares only. They take turns moving their pieces diagonally forward (not backward) from one square to If another. When a player jumps over their opponent's piece, that player can take that piece from the board. You CAN take a piece, you MusT take a piece. A player can use one piece to make multiple jumps in one turn as long as each jump moves immediately into the next jump. ifa players pieces moves to the back row of the opposing player's side, it becomes a king. It can move forwards and backwards. The first player to lose all of their pieces loses, if player is put in a position where they cannot move, they lose. Part 1: Create the Game Board Due: Friday November 18, 2016 The first part of the project is to create the board on which to play. To do this, you will need to create four images: two for the two colors of empty squares and two for the colored pieces of the two players. Y will then need to build a playing board that looks like the one shown below. You should build this board using a function in JavaScript (like we have done several times). Inamed my pictures w png, b.png, r png, g png Then create a global 2-D array that stores the color of each square on the game board (in my picture that would be black or white). Also, create a global 2-D array that keeps track of what is on that particular square of the game board (empty, red, or green for my game). It's best to use single letters as the values in those arrays as opposed to entire words.Explanation / Answer
#include 00021 #include 00022 #include 00023 00024 #include "game.h" 00025 #include "aaball.h" 00026 00027 #define CHECKERS_CELL_SIZE 40 00028 #define CHECKERS_NUM_PIECES 4 00029 00030 #define CHECKERS_BOARD_WID 8 00031 #define CHECKERS_BOARD_HEIT 8 00032 00033 #define CHECKERS_WK 1 00034 #define CHECKERS_WP 2 00035 #define CHECKERS_BK 3 00036 #define CHECKERS_BP 4 00037 00038 #define CHECKERS_ISKING(x) (x == 1 || x == 3) 00039 #define CHECKERS_ISPAWN(x) (x == 2 || x == 4) 00040 00041 #define CHECKERS_ISWHITE(x) (x >= 1 && x = 3 && x board[i])) found_b = 1; 00104 if (!found_b) 00105 { 00106 strncpy (comment, who_str[0], 31); 00107 *commp = comment; 00108 return RESULT_WHITE; 00109 } 00110 if (!found_w) 00111 { 00112 strncpy (comment, who_str[1], 31); 00113 *commp = comment; 00114 return RESULT_BLACK; 00115 } 00116 return RESULT_NOTYET; 00117 } 00118 00119 byte * checkers_movegen (Pos *pos) 00120 { 00121 int i, j, diffx, diffy; 00122 byte movbuf [256]; 00123 byte *movlist, *mp = movbuf; 00124 byte *board = pos->board; 00125 Player player = pos->player; 00126 for (i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.