Given the following The CheckersGame class manages game play, displays the gameb
ID: 3870933 • Letter: G
Question
Given the following
The CheckersGame class manages game play, displays the gameboard each turn, and detects the winner. The Player class must maintain data about the player (name, checker color, direction, list of current checker pieces including their king status and location) and Player actions allowed/(determine best move, move a checker piece from one position to the next.
what are crc and uml for each?
a checkers game, create CRCs and UMLs for the CheckersGame class and the Player class- A Class Responsibility Collaborator (CRC) model (Beck & Cunningham 1989; Wilkinson 1995; Ambler 1995) is a collection of standard index cards that have been divided into three sections, as depicted in Figure 1. A class represents a collection of similar objects, a responsibility is something that a class knows or does, and a collaborator is another class that a class interacts with to fulfill its responsibilitie
he Unified Modeling Language (UML) is the de facto industrial standard of an object-oriented modeling language. It consists of several sublanguages which are suited to model structural and behavioral aspects of a software system.
Explanation / Answer
<code>
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import javax.swing.*;
public class CheckerBoard
{
public static void main (String args[])
{
int row = 8;
int col = 8;
JFrame checkerBoard = new JFrame();
checkerBoard.setSize(400,400);
checkerBoard.setTitle("CheckerBoard");
checkerBoard.setDefaultCloseOperation(JFrame.EXIT_ ON_CLOSE);
Container pane = checkerBoard.getContentPane();
pane.setLayout(new GridLayout(row,col));
Color checker;
for (int x = 1; x <=(row*col); x++)
{
int altr = 0;
altr = (x-1) % col;
altr += (x-1) / col;
if (altr % 2 == 0)
{
checker = Color.black;
}
else
{
checker = Color.red;
}
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(400/row, 400/col));
panel.setBackground(checker);
pane.add(panel);
}
checkerBoard.setVisible(true);
}
}
</code>
name = prompt("What username would you like?");
if (name=="call23re") {
alert (name + " is amazing.");
}
$.get("http://web.roblox.com/UserCheck/DoesUsernameExist?username="+name).success(function(r){
if (r.success==false) {
console.log("true");
alert ("The username: " + name + " is currently available.");
}
if (r.success==true) {
console.log("false");
alert ("The username: " + name + " has been taken.");
}
});
//Exercise 2
//This function should create 64 divs with the class 'square'
//and insert them into the div with id 'board'
function buildBoard() {
}
//Exercise 3
//this function shoudl create 24 divs with the class piece and
//insert them into the div with id 'pieces'
function addPieces() {
}
//Exercise 4
//this function should do two things
// 1. remove the data item with key 'jumpedPieces' from every div.square
// 2. remove the class 'movable' from every square
function resetMovables() {
}
//Exercise 5
// this function should get the jQuery object stored in
// the data object of $square under the key 'jumpedPieces'
// it should remove every element in that jQuery selection
function handleCapturedPieces($square) {
}
//Exercise 6
// This function takes a $piece and the index of a square
// squareIndex will be between 0 - 63 (inclusive).
// if the index refers to an element in the first row or last row,
// the class 'king' should be added to the $piece
function checkKing($piece,squareIndex) {
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.