This document contains examples of inputs and outputs for a summarization system. It provides 11 examples of inputs consisting of text strings with various formatting. The corresponding outputs indicate whether each input text is considered "legal" or "illegal" by the system.
6. health care professionals into text. Although I am not directly
involved in treating patients, any
errors that occur during the transcription process could result in
inaccurate documentation of
medical data. For example, one of my colleagues documented
the dosage of Lasix as 400 mg
instead of 40 mg in a discharge summary. When the health care
professional who had dictated
the report reviewed it, he was able to spot the error in the
dosage and correct it, which helped
prevent the patient from having a dangerous reaction to the
incorrect dosage. This incident
helped me realize the importance of preparing accurate
documents for ensuring patient safety
and delivering quality care. I developed a keen interest in issues
relating to patient safety ever
since.
Identifying Academic Peer-Reviewed Journal Articles
Using Summon, Capella University Library’s search engine, I
accessed databases relating
to health care, such as ProQuest Central and PubMed Central. I
used keywords such as health
care issues, patient safety, and quality of care to search for
peer-reviewed literature relevant to
8. that they contained accepted facts and opinions on issues
relating to patient safety and quality
care. I also checked whether each information source had a
clearly defined purpose and
contained pertinent information about patient safety and quality
care.
Annotated Bibliography
Kronick, R., Arnold, S., & Brady, J. (2016, August 2).
Improving safety for hospitalized patients:
Much progress but many challenges remain. The JAMA
Network, 316(5), 489–490.
Retrieved from https://jamanetwork-
com.library.capella.edu/journals/jama/fullarticle/2528945
This article provides a viewpoint on the progress that hospitals
have made toward
reducing patient harm and understand the factors that have led
to this progress. The
authors cite reports released by the Agency for Healthcare
Research and Quality (AHRQ)
and the National Healthcare Safety Network (NHSN) to analyze
the occurrence of issues
relating to patient safety in hospitals. The authors hypothesize
that improvement in health
10. number of adverse events.
This article is relevant to patient safety because it examines
evidence of reduction in
patient harms in hospitals and offers approaches to reduce such
harms.
Morris, S., Otto, N. C., & Golemboski, K. (2013). Improving
patient safety and healthcare
quality in the 21st century—Competencies required of future
medical laboratory science
practitioners. Clinical Laboratory Science, 26(4), 200–204.
Retrieved from https://search-
proquest-
com.library.capella.edu/docview/1530677721/fulltextPDF/CF6F
9C5B900402CPQ/1?acc
ountid=27965
In this article, the authors express their concern about health
care professionals,
particularly medical laboratory science (MLS) practitioners,
being insufficiently trained
to achieve the five core competencies that the Institute of
Medicine (IOM) identified in
2002. The authors discuss ways to incorporate patient safety
practices and concepts in the
12. Parand, A., Dopson, S., Renz, A., & Vincent, C. (2014). The
role of hospital managers in quality
and patient safety: A systematic review. BMJ Open, 4(9).
http://dx.doi.org/
10.1136/bmjopen-2014-005055
This article provides a systematic review of available empirical
literature to understand
how health care managers are involved in delivering quality
health care and ensuring
patient safety. Based on the literature review, the authors
suggest that board-level
managers should spend more than 25% of their time on patient
safety and quality to
ensure positive outcomes; however, most of the reviewed
studies indicate that they spend
much less time than that. The authors also present a quality
management input process
output (IPO) model, a framework that will help managers
function effectively and
achieve health care quality and safety. The authors conclude
that there is a need to make
certain changes in hospitals to ensure the active involvement of
managers in quality
14. com.library.capella.edu/docview/1617932572/fulltextPDF/1486
CC30B3624B3CPQ/1?ac
countid=27965
This article provides a general understanding of the concepts of
patient safety and patient
safety culture. The authors explain that the health care system is
complex and patient
safety is the responsibility of every individual in a health care
organization. They discuss
some tools that can be used to measure patient safety culture,
for example, the Safety
Attitudes Questionnaire and the Patient Safety Culture
Improvement Tool. They also
examine several strategies to encourage a patient safety culture,
such as ensuring that
patient safety is given as much importance as other core
business functions. This article
was chosen because it offers strategies for preventing adverse
events relating to patient
safety and emphasizes the importance of teamwork within a
health care organization to
ensure safe patient care.
Learnings From the Research
16. this document are prohibited.
References
Kronick, R., Arnold, S., & Brady, J. (2016, August 2).
Improving safety for hospitalized patients:
Much progress but many challenges remain. The JAMA
Network, 316(5), 489–490.
Retrieved from https://jamanetwork-
com.library.capella.edu/journals/jama/fullarticle/2528945
Morris, S., Otto, N. C., & Golemboski, K. (2013). Improving
patient safety and healthcare
quality in the 21st century—Competencies required of future
medical laboratory science
practitioners. Clinical Laboratory Science, 26(4), 200–204.
Retrieved from https://search-
proquest-
com.library.capella.edu/docview/1530677721/fulltextPDF/CF6F
9C5B900402CPQ/1?acc
ountid=27965
Parand, A., Dopson, S., Renz, A., & Vincent, C. (2014). The
role of hospital managers in quality
and patient safety: A systematic review. BMJ Open, 4(9).
http://dx.doi.org/
17. 10.1136/bmjopen-2014-005055
Ulrich, B., & Kear, T. (2014). Patient safety and patient safety
culture: Foundations of excellent
health care delivery. Nephrology Nursing Journal, 41(5), 447–
456, 505. Retrieved from
https://search-proquest-
com.library.capella.edu/docview/1617932572/fulltextPDF/1486
CC30B3624B3CPQ/1?ac
countid=27965
11/2/18, 10(55 AMApplying Research Skills Scoring Guide
Page 1 of
2https://courserooma.capella.edu/bbcswebdav/institution/NHS-
FP/NHS-
FP4000/180700/Scoring_Guides/a02_scoring_guide.html
Applying Research Skills Scoring Guide
CRITERIA NON-PERFORMANCE BASIC PROFICIENT
DISTINGUISHED
Summarize a
health care
18. problem or issue
and describe a
personal interest
in it and
experience with
it.
Does not
summarize a
health care
problem or issue
and describe a
personal interest
in it and
experience with
it.
Incompletely or
inaccurately
summarizes a
health care
problem or issue,
or does not
describe a
personal interest in
it and experience
with it.
Summarizes a
health care
problem or
issue and
describes a
personal
interest in it and
experience with
19. it.
Summarizes a health
care problem or issue
and describes a
personal interest in it
and experience with
it, providing examples
to illustrate interest
and experience.
Identify
academic peer-
reviewed journal
articles relevant
to a health care
problem or issue
and describe the
criteria used for
the literature
search.
Does not identify
academic peer-
reviewed journal
articles relevant
to a health care
problem or issue
and describe the
criteria used for
the literature
search.
Identifies journal
articles related to a
health care
20. problem or issue
but they are not
relevant or peer-
reviewed, or does
not describe the
criteria used for
the literature
search.
Identifies
academic peer-
reviewed
journal articles
relevant to a
health care
problem or
issue and
describes the
criteria used for
the literature
search.
Identifies academic
peer-reviewed journal
articles relevant to a
health care problem
or issue and
describes the criteria
used for the literature
search, explaining
how the articles are
relevant.
Assess the
credibility and
relevance of
21. information
sources.
Does not assess
the credibility
and relevance of
information
sources.
Describes the
sources of
information but
does not assess
the sources'
credibility and
relevance.
Assesses the
credibility and
relevance of
information
sources.
Assesses the
credibility and
relevance of
information sources
and describes the
process for
determining their
credibility.
Analyze
academic peer-
reviewed journal
articles using the
22. annotated
bibliography
organizational
format.
Does not
analyze
academic peer-
reviewed journal
articles using the
annotated
bibliography
organizational
format.
Analyzes
academic peer-
reviewed journal
articles but fails to
use the annotated
bibliography
format effectively.
Analyzes
academic peer-
reviewed
journal articles
using the
annotated
bibliography
organizational
format.
Analyzes academic
peer-reviewed journal
articles using the
23. annotated
bibliography
organizational format,
providing rationale for
inclusion of each
selected article.
Summarize what Does not Incompletely Summarizes
Summarizes what
11/2/18, 10(55 AMApplying Research Skills Scoring Guide
Page 2 of
2https://courserooma.capella.edu/bbcswebdav/institution/NHS-
FP/NHS-
FP4000/180700/Scoring_Guides/a02_scoring_guide.html
was learned from
developing an
annotated
bibliography.
summarize what
was learned
from developing
an annotated
bibliography.
summarizes what
was learned from
developing an
annotated
bibliography.
24. what was
learned from
developing an
annotated
bibliography.
was learned from
developing an
annotated
bibliography and
provides illustrative
examples.
Write clearly and
logically, with
correct use of
spelling,
grammar,
punctuation, and
mechanics.
Does not write
clearly and
logically, with
correct use of
spelling,
grammar,
punctuation, and
mechanics.
Writes clearly and
logically, with
correct use of
spelling, grammar,
punctuation, and
mechanics with
25. some errors and
lapses.
Writes clearly
and logically,
with correct use
of spelling,
grammar,
punctuation,
and mechanics.
Writes clearly and
logically, using
evidence to support a
central idea, with
correct use of
spelling, grammar,
punctuation, and
mechanics. The
paper contains
supporting examples
for the main points.
Write following
APA style for in-
text citations,
quotes, and
references.
Does not write
following APA
style for in-text
citations, quotes,
and references.
Writes following
26. APA style for in-
text citations,
quotes, and
references with
some errors and
lapses.
Writes following
APA style for in-
text citations,
quotes, and
references.
Writes following APA
style for in-text
citations, quotes, and
references without
errors, and uses
current reference
sources.
11/2/18, 10(48 AMAssessment Topic Areas Transcript
Page 1 of 5http://media.capella.edu/CourseMedia/NHS-
FP4000/Assessmenttopicareas/transcript.html
Assessment Topic Areas
Selecting a topic for your written assessments can be
challenging, but
it’s important to make a thoughtful choice.
Choose a topic area of interest to you from the topic suggestions
in this
27. media piece. You will use this topic to complete Assessments 2
and 3.
Be sure to select a topic that will be manageable for a written
assessment.
To explore the chosen topic, you should use the Socratic
Problem-
Solving Approach, focusing on the sections specifically called
out in the
assessment guidelines.
Topic 1: Limited Access to
Healthcare
Short Description:
Consumers face barriers to healthcare access for assorted
reasons. For
example: due to geographic location, provider availability,
transportation issues and mobility.
Potential Intervention Approaches:
Healthcare information online
Telemedicine
In–home healthcare services
Keywords for Articles:
online health information seeking, health care access, health
information systems, consumer health information, chronic
disease,
health information search, health seeking behavior, rural
nursing
11/2/18, 10(48 AMAssessment Topic Areas Transcript
28. Page 2 of 5http://media.capella.edu/CourseMedia/NHS-
FP4000/Assessmenttopicareas/transcript.html
References:
Bhandari, N. (2014). Seeking health information online: does
limited healthcare
access matter? Journal of the American Medical Informatics
Association: JAMIA
(1067-5027), 21 (6), p. 1113. https://www-ncbi-nlm-nih-
gov.library.capella.edu/pmc/articles/PMC4215038/
Lee, K., Hoti, K., Hughes, J. D., & Emmerton, L. (2014). Dr
Google and the
Consumer: A Qualitative Study Exploring the Navigational
Needs and Online
Health Information-Seeking Behaviors of Consumers with
Chronic Health
Conditions. Journal of Medical Internet Research, 16(12), e262.
http://doi.org.library.capella.edu/10.2196/jmir.3706
Ware, P., Bartlett, S. J., Paré, G., Symeonidis, I., Tannenbaum,
C., Bartlett, G., …
Ahmed, S. (2017). Using eHealth Technologies: Interests,
Preferences, and
Concerns of Older Adults. Interactive Journal of Medical
Research, 6(1), e3.
http://doi.org.library.capella.edu/10.2196/ijmr.4447
Pratt, D. (2015). Telehealth and telemedicine. Albany Law
Journal of Science &
Technology. (1059-4280), 25 (3), p. 495.
http://www.lexisnexis.com.library.capella.edu/hottopics/lnacade
mic/?
shr=t&csi=148364&sr=TITLE(%22Telehealth+telemedicine+in+
2015%22)+and+d
ate+is+2015
29. Topic 2: Healthcare Disparities
Short Description:
In 2010, the Federal Department of Human and Health Service
(DHHS)
launched the Healthy People 2020 goals to include a goal to
eliminate
health inequality/disparity. Healthy People 2020 defines a
health
disparity as “a particular type of health difference that is
closely linked
with social, economic, and/or environmental disadvantage.
Health
disparities adversely affect groups of people who have
systematically
experienced greater obstacles to health based on their racial or
ethnic
group; religion; socioeconomic status; gender; age; mental
health;
cognitive, sensory, or physical disability; sexual orientation or
gender
identity; geographic location; or other characteristics
historically linked
to discrimination or exclusion” (Office of Disease Prevention
and Health
Promotion, 2017, p.1).
11/2/18, 10(48 AMAssessment Topic Areas Transcript
Page 3 of 5http://media.capella.edu/CourseMedia/NHS-
FP4000/Assessmenttopicareas/transcript.html
Potential Intervention Approaches:
30. Federal goals
Community health improvement plans
Patient advocacy efforts
“Triple Aim” for populations
Keywords for Articles:
health disparities, community health assessment, community
health
improvement plan, strategic planning, local health departments,
health
inequities
References:
Office of Disease Prevention and Health Promotion. (2017).
Disparities. Retrieved
from https://www.healthypeople.gov/2020/about/foundation-
health-
measures/disparities
Shah G.H., & Sheahan J.P. (2016). Local health departments’
activities to address
health disparities and inequities: Are we moving in the right
direction?
International Journal of Environmental Research and Public
Health. 2016;
13(1):44. http://www.mdpi.com/1660-4601/13/1/44
Institute for Healthcare Improvement. (2017). Triple Aim for
Populations.
http://www.ihi.org/Topics/TripleAim/Pages/Overview.aspx
Topic 3: Medication Errors
Short Description:
A medication error is a preventable adverse effect of a patient
taking
31. the wrong medication or dosage, whether or not it is evident or
harmful to the patient. Medication errors can be a source of
serious
patient harm, including death.
Potential Intervention Approaches:
Medical staff education
Packaging improvements
11/2/18, 10(48 AMAssessment Topic Areas Transcript
Page 4 of 5http://media.capella.edu/CourseMedia/NHS-
FP4000/Assessmenttopicareas/transcript.html
Patient medication safety training
Keywords for Articles:
medication administration, medication errors, medication safety
References:
Cohen, M. (2016). Medication errors (miscellaneous). Nursing.
46(2):72, February
2016. DOI: 10.1097/01.NURSE.0000476239.09094.06
Institute for Healthcare Improvement. (2017). Improve Core
Processes for
Administering Medications.
http://www.ihi.org/resources/Pages/Changes/ImproveCoreProce
ssesforAdministe
ringMedications.aspx
Agency for Healthcare Research and Quality. (2012). Table 6:
Categories of
Medication Error Classification.
32. http://www.ahrq.gov/professionals/quality-
patient-safety/patient-safety-
resources/resources/match/matchtab6.html
Schmidt, K., Taylor, A., & Pearson, A. (2017). Reduction of
medication errors: A
unique approach. Journal of Nursing Care Quality. 32(2),
April/June 2017, 150–
156.
Topic 4: Healthcare System Errors
Short Description:
The health care system in the United States has been the subject
of
much debate as experts try to determine the best way to deliver
high-
quality care. In Crossing the Quality Chasm, the Institute of
Medicine
(2001) called for the redesign of health care delivery systems
and their
external environments to promote care that is safe, effective,
patient-
centered, timely, efficient, and equitable.
Potential Intervention Approaches:
Systemwide transformation
Process redesign
Electronic health records
11/2/18, 10(48 AMAssessment Topic Areas Transcript
Page 5 of 5http://media.capella.edu/CourseMedia/NHS-
FP4000/Assessmenttopicareas/transcript.html
33. Keywords for Articles:
multi-stakeholder collaboration, healthcare system redesign
References:
Institute of Medicine (US) Committee on Quality of Health Care
in America.
(2001). Crossing the Quality Chasm: A New Health System for
the 21st Century.
Washington (DC): National Academies Press (US).Agency for
Healthcare Research
and Quality. (2017). Hospitals and Health Systems.
http://www.ahrq.gov/professionals/systems/index.html
Roberts, B. (2017). Relationship-based care: The institute of
medicine’s core
competencies in action. Creative Nursing, 05/2016, 22(2).
Credits
Subject Matter Expert:
Joan Vermillion
Interactive Design:
Lori Olson
Media Instructional Design:
Felicity Pearson
Instructional Design:
Celina Byers
Project Manager:
Alan Campbell
Licensed under a Creative Commons Attribution 3.0 License
(https://creativecommons.org/licenses/by-nc-nd/3.0/)
https://creativecommons.org/licenses/by-nc-nd/3.0/
Overview
34. Create a 4-6 page annotated bibliography and summary based on
your research related to best practices addressing a current
health care problem or issue of interest to you.
For this assessment, you will select and research a current
health care problem or issue faced by a health care organization.
Read each portion of the assessment carefully and use the
Suggested Resources to help you complete the assessment. This
assessment provides an opportunity to apply research skills to a
current health care problem or issue.
By successfully completing this assessment, you will
demonstrate your proficiency in the following course
competencies and assessment criteria:
Competency 1: Apply information literacy and library research
skills to obtain scholarly information in the field of health care.
· Identify academic peer-reviewed journal articles relevant to a
health care problem or issue and describe the criteria used for
the literature search.
· Summarize what was learned from developing an annotated
bibliography.
Competency 2: Apply scholarly information through critical
thinking to solve problems in the field of health care.
· Assess the credibility and relevance of information sources.
· Analyze academic peer-reviewed journal articles using the
annotated bibliography organizational format.
Competency 4: Communicate in a manner that is scholarly,
professional, and respectful of the diversity, dignity, and
integrity of others, and that is consistent with expectations for
health care professionals.
· Write clearly and logically, with correct use of spelling,
grammar, punctuation, and mechanics.
· Write following APA style for in-text citations, quotes, and
references.
Assessment Instructions
Note: The requirements outlined below correspond to the
35. grading criteria in the scoring guide. At a minimum, be sure to
address each point. In addition, you are encouraged to review
the performance level descriptions for each criterion to see how
your work will be assessed.
For this assessment, you will research best practices related to a
current health care problem. Your selected problem or issue will
be utilized again in Assessment 3. To explore your chosen
topic, you should use the first two steps of the Socratic
Problem-Solving Approach as described on Campus to aid your
critical thinking.
1. View the Assessment Topic Areas media piece linked in the
Resources and select one of the health care problems or issues
in the media piece to research. Write a brief overview of the
selected topic. In your overview:
. Describe the health care problem or issue.
. Describe your interest in the topic.
. Describe any professional experience you have with this topic.
· Conduct a search for scholarly or academic peer-reviewed
literature related to the topic and describe the criteria you used
to search for articles, including the names of the databases you
used.
. You will want to access the applicable Undergraduate Library
Research Guide related to your degree (found at the NHS
Learner Success Lab) for tips to help you in your search.
. Use keywords related to the health care problem or issue you
are researching to select relevant articles.
· Assess the credibility of the information sources you find.
. Determine if the source is from an academic peer-reviewed
journal.
. Determine if the publication is current.
. Determine if information in the academic peer-reviewed
journal article is still relevant.
· Select four current scholarly or academic peer-reviewed
journal articles published during the past three to five years that
relate to your topic.
· Explain the relevance of the information sources.
36. . Describe how the health care problem or issue is addressed in
each source.
. Discuss what kind of contribution each source provides on
your selected topic.
· Analyze the scholarly literature or academic peer-reviewed
journal articles using the annotated bibliography organizational
format.
. The purpose of an annotated bibliography is to document a list
of references along with key information about each one. The
detail about the reference is the annotation. Developing this
annotated bibliography will create a foundation of knowledge
about the selected topic.
. List the full reference for the source in APA format (author,
date, title, publisher, et cetera) and use APA format for the
annotated bibliography.
. Make sure the references are listed in alphabetical order, are
double-spaced, and use hanging indents.
. Follow the reference with the annotation.
· In your annotation:
. Identify the purpose of the article.
. Summarize the source:
. What are the main arguments?
. What topics are covered?
· Include the conclusions and findings of the article.
· Write your annotation in a paragraph form. The annotation
should be approximately 150 words (1 to 3 paragraphs) in
length.
· In a separate paragraph or two at the end of the paper,
summarize what you learned from your research.
· List the main points you learned about.
· Summarize the main contributions of the sources you chose
and how they enhanced your knowledge about the topic.
Example Assessment: You may use the assessment example,
linked in the Assessment Example section of the Resources, to
give you an idea of what a Proficient or higher rating on the
scoring guide would look like.
37. Additional Requirements
1. Length: At least 4 typed, double-spaced pages, not including
the title page and reference page.
2. Font and font size: Times New Roman, 12 point.
3. APA Template: Use the APA Style Paper Template as the
paper format and the APA Style Paper Tutorial for guidance.
See the Resources for these documents.
4. Written communication: Write clearly and logically, with
correct use of spelling, grammar, punctuation, and mechanics.
5. Content: Provide a title page and reference page following
APA style.
6. References: Use at least four scholarly or academic peer-
reviewed journal articles.
7. APA format: Follow current APA guidelines for in-text
citation of outside sources in the body of your paper and also on
the reference page.
8. Turnitin: Submit your assessment to Turnitin prior to
grading. Then, only submit your final assessment to faculty for
grading.
Note: Review the Applying Research Skills Scoring Guide for
the grading criteria applied to this assessment.
If you would like assistance in organizing your assessment, or if
you simply have a question about your assessment, please do
not hesitate to ask your courseroom instructor or the teaching
assistants in the NHS Learner Success Lab for guidance and
suggestions.
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.8.0_77 (Oracle Corporation)
Main-class: ChessBoard
38. ChessBoard.classsynchronizedclass ChessBoard {
privatestatic Node head;
privatestatic int board_size;
privatestatic int board_no;
publicstatic java.io.BufferedWriter writer;
publicstaticfinal int[] possibleRowMoves;
publicstaticfinal int[] possibleColMoves;
public void ChessBoard();
public Node capture(Node, Node);
public boolean isOutOfBoard(int, int);
public boolean placePiece(Node, Node, Node, int, int,
boolean);
public boolean checkBlock(Node, int[], int, int, int, int,
boolean);
public boolean movePawns(Node, Node, Node, int, int,
boolean);
public boolean makeValidMove(Node, int[], boolean, int,
int);
public Node getKingNode(Node, boolean);
public boolean determineCheck(Node, boolean);
publicstatic void readFromInputFile(java.io.BufferedReader);
public void writeToAnalysisFile(String);
publicstatic void main(String[]);
static void <clinit>();
}
Node.classsynchronizedclass Node {
private ChessPiece myPiece;
private Node next;
public void Node();
Node copy();
39. char getPieceType();
public void Node(char, int, int);
public ChessPiece getChessPiece();
public Node getNext();
public void setNext(Node);
public int getRow();
public int getCol();
public void setRow(int);
public void setCol(int);
public boolean getColor();
public boolean identifyColor(char);
}
ListOperations.classsynchronizedclass ListOperations {
void ListOperations();
publicstatic Node insert(Node, Node);
publicstatic Node findChessPiece(Node, int, int);
publicstatic Node findChessPiece(Node, char);
publicstatic boolean isDifferent(Node, Node);
publicstatic Node deleteNode(Node, Node);
publicstatic Node listCopy(Node);
publicstatic int countPiecesOfType(Node, char);
publicstatic int countPiecesInLocation(Node, int, int);
publicstatic boolean twoPiecesOccupySamePosition(Node);
publicstatic boolean checkValidity(Node);
}
Utilities.classsynchronizedclass Utilities {
void Utilities();
publicstatic void errExit(String);
publicstatic void printList(Node);
publicstatic void print
40. Solution
(char[][], int);
publicstatic char returnChessPieceType(Node);
publicstatic void convertFromListToMatrixAndPrint(Node,
int, int);
}
ChessPiece.classsynchronizedclass ChessPiece {
private int row;
private int col;
private boolean color;
public void ChessPiece();
public void ChessPiece(int, int, boolean);
public void ChessPiece(ChessPiece);
public int getRow();
public int getCol();
public boolean getColor();
public void setCol(int);
public void setRow(int);
public ChessPiece copy();
public int ifValidReturnLength(int, int, int, int);
41. public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
}
King.classsynchronizedclass King extends ChessPiece {
privatestaticfinal int[] movesRow;
privatestaticfinal int[] movesCol;
public void King();
public void King(int, int, boolean);
public int ifValidReturnLength(int, int, int, int, boolean);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
static void <clinit>();
}
Queen.classsynchronizedclass Queen extends ChessPiece {
public void Queen();
public void Queen(int, int, boolean);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
}
42. Rook.classsynchronizedclass Rook extends ChessPiece {
public void Rook();
public void Rook(int, int, boolean);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
}
Bishop.classsynchronizedclass Bishop extends ChessPiece {
public void Bishop();
public void Bishop(int, int, boolean);
public int ifValidReturnLength(int, int, int, int, boolean);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
}
Knight.classsynchronizedclass Knight extends ChessPiece {
privatestaticfinal int[] movesRow;
privatestaticfinal int[] movesCol;
public void Knight();
public void Knight(int, int, boolean);
public int ifValidReturnLength(int, int, int, int, boolean);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
43. static void <clinit>();
}
Pawn.classsynchronizedclass Pawn extends ChessPiece {
public void Pawn();
public void Pawn(int, int, boolean);
public int[] getAttackRow();
public int[] getAttackCol();
public boolean checkStraightMove(int, int, int, int);
public int[] getMoves(int, int, int, int, boolean);
public boolean isAttacking(ChessPiece);
}
CMPS 12B, Fall 2018: HW 3
Making some moves
• All assignments must be submitted through git. Please look at
the Piazza
guide on submitting assignments.
44. • Follow instructions, and carefully read through the
input/output formats.
• Clearly acknowledge sources, and mention if you discussed
the problems
with other students or groups. In all cases, the course policy on
collaboration
applies, and you should refrain from getting direct answers from
anybody or
any source. If in doubt, please ask the instructors or TAs.
1 Problem description
Main objective: Store a chessboard as a linked list of chess
pieces, implement
moves, and determine if king is under attack. You cannot use
built in libraries
for manipulating data. No arraylists, no hash tables, etc.Assume
an 8 × 8
chessboard. Implement a procedure that, given a chessboard,
makes a series of
moves. Let squares be indexed as (column,row) pairs. Given a
source square
(x, y) and a destination square (x′, y′), determine if the piece (if
any) at (x, y) can
45. legally move to (x′, y′). Given a sequence of moves (x1, y1) to
(x
′
1, y1), (x2, y2)
to (x′2, y
′
2), etc., implement all these moves to determine the final
chessboard.
1.1 What is a legal move?
• Color alternates: in the sequence of moves, assume that white
plays first,
then black, then white, etc.
• Non-empty source: obviously, there must a piece to move at
the source
square.
• Piece moves according to its rules: each piece moves
according to certain
rules. A move is valid only if it moves the respective piece
appropriately. In this
46. assignment, you do not need to worry about unconventional
moves like castling,
en passant, or pawns promoted by reaching the last row.
• Destination occupied by piece of same color: if the destination
square has
a piece, it must be of a different color (this is a capture).
• Path is blocked: when a move is performed, there should be no
other piece
(of any color) in its “path”. This is not true for knights, which
can “jump” over
any pieces in its path.
1
• King cannot be in check after move: a king is in check, if it
can be attacked
by a piece of the opposite color. According to the rules of
chess, a king can never
end up in check. Suppose white moves. At the end of the move,
the white king
is in check. Then, this move is invalid. (Indeed, if white has no
47. move that
prevents check, then white has lost.) This is the hardest
condition to handle,
so save this for last while coding.
Thus, given a sequence of moves, you have to determine if the
sequence of
moves is legal. Note that each move changes the board, so you
have determine
legality with respect to the current board.
1.2 Suggestions for coding:
Clearly, the solution of the previous assignment can be used.
You can simply
copy the code of your previous HW2, or use the solution for
HW2 that we
provided. Indeed, if you combine ideas from HW2 with a delete
function, you
will have the basic pieces needed to solve this problem.
Ignore knights and pawns for now. Say you want to check if the
piece at (x, y)
can moves to (x′, y′). First, find out what piece is at (x, y).
(This is already
48. solved in HW2.) Using the attack method, you can determine if
the piece can
move to (x′, y′). Now for the first technical part. If the piece
can move to
(x′, y′), you would need to output the actual path from (x, y) to
(x′, y′). You
can use arrays for this, if it makes life easier.
For each square on the path, find if there is another piece on
that square.
(This can be done using the find method or even the validity
checking from
HW2.) If so, this blocks the path, so the move is not possible. If
all intermediate
squares are empty and (x′, y′) is empty, the move is possible. If
(x′, y′) has a
piece of a different color, the move is also possible (and is a
capture).
To actually make the move, you need to update the position of
the piece.
Furthermore, if there was a piece at (x′, y′), you need to delete
it from the list.
The validity checking of HW2 is a great tool for debugging your
code.
49. Knights do not need any path checking, and pawns have
different moves
depending on whether they attack or not.
Once you have all of this, determining check is not difficult. All
you need to
do is determine if any Black piece can move to the square with
the White king
(or vice versa).
2 Detailed instructions
Format: You should provide a Makefile. On running make, it
should create
“ChessMoves.jar” that takes two command line arguments: an
input file and an
output file. Thus, on running “java -jar ChessMoves.jar
input.txt output.txt”,
it will read the input from “input.txt” and write out the output
in “output.txt”.
The input file has the following format. Each line represents a
new board.
It begins with a chessboard, given by a sequence of “char
50. column row”, where
char is one of k (king), q (queen), r (rook), b (bishop), n
(knight), p (pawn).
2
If the character is capitalized, it denotes black pieces,
otherwise, the piece is
white. (This is the same as in HW2.)
Then, there is a colon (‘:’). This is the end of the board. What
follows the
colon is a sequence of moves.
For example, a line could look like:
k 4 4 r 8 2 B 1 1 K 4 7: 8 2 2 2 1 1 3 3
The series of moves is: move piece at (8,2) to (2,2), then the
piece at (1,1)
to (3,3). The first move is possible, but the second move is not
(since the rook
will then block the bishop’s move).
51. This pattern of lines continues throughout the input file.
Do not worry about error handling on the input, so you can
assume that
inputs will always have this format. No piece will be placed
outside the chess-
board, and each square will have at most one piece. Every input
board will have
exactly one king of each color, just like regular chess.
Output: On running java -jar ChessMoves.jar input.txt
output.txt,
a file “output.txt” should be produced. Each line of the output
file corresponds
to a line of the input file. Each line will looks like either of the
following:
• “Legal”: this simply means that the sequence of moves was
legal.
• “<MOVE> illegal”: This is the output if one of the moves is
illegal, as
described in the section earlier. <MOVE> lists the illegal move,
as 4
integers with spaces between them, indicating the source
52. column, row and
the destination column, row (just like the input file). The move
is illegal
because one of the conditions of a legal move fails.
For our example above, the output should be:
1 1 3 3 illegal
Examples: The website contains a zip file called Examples.zip.
In this,
there are numerous example input and output files. The checker
will use
simple-input.txt and simple-output.txt. Being such a nice
person, I have
also put the jar file for my own solution. Among other things, it
prints the board
to the console after every single move, and gives an explanation
for any illegal
move encountered. Hopefully, this will aid you in building more
test cases.
3 Grading
You code should terminate within 1 minute per every line of
53. input. Pawns are
only for extra credit. For all other settings in the rubric below,
it does not have
to work with pawns.
1. (11 points, extra credit) A full solution that works with
pawns.
2. (10 points) A full solution
3. (8 points) Does not deal with detecting check, but works
otherwise.
3
4. (6 points) Does not deal with detecting blocks, but works
otherwise.
4