SlideShare a Scribd company logo
1 of 1
Download to read offline
(Coding in Java) (PLEASE PROVIDE A CODE THAT RUNS, PRINTS THE BOARD, HAS A
CONSOLE UI CLASS AND MEETS ALL OR AT LEAST MOST OF THE REQUIREMENTS.
THANK YOU.) (AND IF YOU CAN CREATE A UML CLASS DIAGRAM) Design and code an
Omok application that takes all user inputs from the standard input (System.in) and displays all
outputs to the standard output (System.out). Omok (a.k.a. Gomoku and Gobang), literally meaning
five pieces, is a two-player strategy game typically played with go pieces --- black and white
stones --- on a go board with 15x15 intersections (or places) [Wikipedia]. It is also possible to play
the game with paper and pencils because stones, once placed, can't be moved or removed from
the board. The two players alternate and place a stone of their color on an empty intersection. The
game objective is to put one's stones in a row of five consecutive places vertically, horizontally, or
diagonally. The winner is the first player to create an unbroken row of five stones. Your application
shall meet the following requirements. R1. The application shall take all user inputs from the
standard input (System.in) and display all output to the standard output (System.out). R2. The
application shall provide two different game modes: human game and strategy game. In the first
game mode, two human players play against each other, and in the second, a human player plays
against the computer. Your application shall provide a realistic or reasonable playing strategy for
the computer. Minimally, it should detect a winning/losing row, e.g., four consecutive stones with
an open end. R3. The game board shall consist of n*n intersections (or places) on which stones of
the players are placed, where n >= 15. R4. The application shall provide a way for the user to
select the game mode (see R2 above). R5. The application shall provide a way for the user to
place his or her stone in an empty intersection (or place) of the board. R6. The application shall
show the progress of a game by displaying the current configuration of the board -- all the stones
placed -- along with other status information, e.g., a player's turn. Consider using an ASCII
drawing to show the board configuration. R7. When the game ends, the application shall display
the outcome of the game --- a win or draw --- and highlight the winning row. R8. The application
shall provide a way to quit the game, e.g., by entering a special input value. R9. You shall
separate your user interface (UI) code from the model code that performs the game logic. The
model code should not depend on the UI code. We suggest you create a separate class for the UI,
say ConsoleUI, and make the model code independent of the UI class. That is, the UI code may
depend on the model code, but not the other way around. Note you will reuse your model code in
later assignments but not the UI code. 1. Code your design by naming your main (or entry point)
class as Main. 2. (Bonus: 10+ points) Implement a "cheat" mode and provide a way to enable and
disable it --- e.g., entering a special value when prompted for the next move. In the cheat mode,
the application suggests the next move for the user. It should minimally detect a winning or losing
sequence, e.g., a row of four consecutive stones with an open end. TESTING Your code should
compile and run correctly with Java 10 or later versions.

More Related Content

Similar to Coding in Java PLEASE PROVIDE A CODE THAT RUNS PRINTS T.pdf

Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
Sohil Gupta
 
Chapt 6 game testing and publishing
Chapt 6   game testing and publishingChapt 6   game testing and publishing
Chapt 6 game testing and publishing
Muhd Basheer
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking Game
Tanmay Krishna
 
Connect4.c2. Include the string.h header file3. Declare the foll.pdf
Connect4.c2. Include the string.h header file3. Declare the foll.pdfConnect4.c2. Include the string.h header file3. Declare the foll.pdf
Connect4.c2. Include the string.h header file3. Declare the foll.pdf
shakilaghani
 
ma project
ma projectma project
ma project
Aisu
 
This is an individual project, to be completed on your own. It i.docx
This is an individual project, to be completed on your own. It i.docxThis is an individual project, to be completed on your own. It i.docx
This is an individual project, to be completed on your own. It i.docx
abhi353063
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdf
FashionColZone
 

Similar to Coding in Java PLEASE PROVIDE A CODE THAT RUNS PRINTS T.pdf (18)

TIC-TAC-TOE IN C
TIC-TAC-TOE IN CTIC-TAC-TOE IN C
TIC-TAC-TOE IN C
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
 
Tic tac toe c++ programing
Tic tac toe c++ programingTic tac toe c++ programing
Tic tac toe c++ programing
 
Ludo game using c++ with documentation
Ludo game using c++ with documentation Ludo game using c++ with documentation
Ludo game using c++ with documentation
 
Android application - Tic Tac Toe
Android application - Tic Tac ToeAndroid application - Tic Tac Toe
Android application - Tic Tac Toe
 
Chapt 6 game testing and publishing
Chapt 6   game testing and publishingChapt 6   game testing and publishing
Chapt 6 game testing and publishing
 
C PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAMEC PROGRAM CODE FOR SNAKE AND LADDER GAME
C PROGRAM CODE FOR SNAKE AND LADDER GAME
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking Game
 
Autocad 2007
Autocad 2007Autocad 2007
Autocad 2007
 
Connect4.c2. Include the string.h header file3. Declare the foll.pdf
Connect4.c2. Include the string.h header file3. Declare the foll.pdfConnect4.c2. Include the string.h header file3. Declare the foll.pdf
Connect4.c2. Include the string.h header file3. Declare the foll.pdf
 
International journal of engineering issues vol 2015 - no 2 - paper1
International journal of engineering issues   vol 2015 - no 2 - paper1International journal of engineering issues   vol 2015 - no 2 - paper1
International journal of engineering issues vol 2015 - no 2 - paper1
 
ma project
ma projectma project
ma project
 
This is an individual project, to be completed on your own. It i.docx
This is an individual project, to be completed on your own. It i.docxThis is an individual project, to be completed on your own. It i.docx
This is an individual project, to be completed on your own. It i.docx
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdf
 
presentationprintTemp.ppt auto cad presentation
presentationprintTemp.ppt auto cad presentationpresentationprintTemp.ppt auto cad presentation
presentationprintTemp.ppt auto cad presentation
 
Game Design Document - Step by Step Guide
Game Design Document - Step by Step GuideGame Design Document - Step by Step Guide
Game Design Document - Step by Step Guide
 
efy-articles
efy-articlesefy-articles
efy-articles
 
Autocad
AutocadAutocad
Autocad
 

More from accostinternational

C Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdfC Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdf
accostinternational
 
The following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdfThe following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdf
accostinternational
 
React mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdfReact mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdf
accostinternational
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
accostinternational
 
please and thank you Adapted from Kristen St John James.pdf
please and thank you  Adapted from Kristen St John James.pdfplease and thank you  Adapted from Kristen St John James.pdf
please and thank you Adapted from Kristen St John James.pdf
accostinternational
 
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdfK Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
accostinternational
 

More from accostinternational (20)

6 In humans the Rh blood group has only two alleles R and.pdf
6 In humans the Rh blood group has only two alleles R and.pdf6 In humans the Rh blood group has only two alleles R and.pdf
6 In humans the Rh blood group has only two alleles R and.pdf
 
Cual de los siguientes es verdadero El uso tico de las c.pdf
Cual de los siguientes es verdadero  El uso tico de las c.pdfCual de los siguientes es verdadero  El uso tico de las c.pdf
Cual de los siguientes es verdadero El uso tico de las c.pdf
 
Consider the transaction database represented by the matrix .pdf
Consider the transaction database represented by the matrix .pdfConsider the transaction database represented by the matrix .pdf
Consider the transaction database represented by the matrix .pdf
 
Complete the following table SourceAnnual Dose .pdf
Complete the following table    SourceAnnual Dose .pdfComplete the following table    SourceAnnual Dose .pdf
Complete the following table SourceAnnual Dose .pdf
 
Professional Development Initiative Scenario As current o.pdf
Professional Development Initiative Scenario   As current o.pdfProfessional Development Initiative Scenario   As current o.pdf
Professional Development Initiative Scenario As current o.pdf
 
Write python code to do the following Define a class call.pdf
Write python code to do the following  Define a class call.pdfWrite python code to do the following  Define a class call.pdf
Write python code to do the following Define a class call.pdf
 
When attempting to determine the identity of a person who re.pdf
When attempting to determine the identity of a person who re.pdfWhen attempting to determine the identity of a person who re.pdf
When attempting to determine the identity of a person who re.pdf
 
What are your 2 favorite ways to communicate with someone pe.pdf
What are your 2 favorite ways to communicate with someone pe.pdfWhat are your 2 favorite ways to communicate with someone pe.pdf
What are your 2 favorite ways to communicate with someone pe.pdf
 
C Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdfC Jones is a 63yearold female with a fiveyear history of.pdf
C Jones is a 63yearold female with a fiveyear history of.pdf
 
We know the following expected returns for stocks A and B g.pdf
We know the following expected returns for stocks A and B g.pdfWe know the following expected returns for stocks A and B g.pdf
We know the following expected returns for stocks A and B g.pdf
 
The following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdfThe following assumptions and exhibits will be used in prepa.pdf
The following assumptions and exhibits will be used in prepa.pdf
 
Task 4 The scope of variables What is the output of the fol.pdf
Task 4 The scope of variables What is the output of the fol.pdfTask 4 The scope of variables What is the output of the fol.pdf
Task 4 The scope of variables What is the output of the fol.pdf
 
A Describir cmo se transporta la informacin gentica en l.pdf
A Describir cmo se transporta la informacin gentica en l.pdfA Describir cmo se transporta la informacin gentica en l.pdf
A Describir cmo se transporta la informacin gentica en l.pdf
 
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdfEXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
EXHIBIT 515 Payroll System FlowchartFollowing is a selec.pdf
 
Regarding the ENS The descending interneurons release 1 t.pdf
Regarding the ENS The descending interneurons release 1 t.pdfRegarding the ENS The descending interneurons release 1 t.pdf
Regarding the ENS The descending interneurons release 1 t.pdf
 
React mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdfReact mui question I am passing a data into a Item Every.pdf
React mui question I am passing a data into a Item Every.pdf
 
public class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdfpublic class MyLinkedListltE extends ComparableltEgtg.pdf
public class MyLinkedListltE extends ComparableltEgtg.pdf
 
please and thank you Adapted from Kristen St John James.pdf
please and thank you  Adapted from Kristen St John James.pdfplease and thank you  Adapted from Kristen St John James.pdf
please and thank you Adapted from Kristen St John James.pdf
 
Joe and Jessie are married and have one dependent child Liz.pdf
Joe and Jessie are married and have one dependent child Liz.pdfJoe and Jessie are married and have one dependent child Liz.pdf
Joe and Jessie are married and have one dependent child Liz.pdf
 
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdfK Direktr olarak David bir eitlilik ynetimi program pla.pdf
K Direktr olarak David bir eitlilik ynetimi program pla.pdf
 

Recently uploaded

會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 

Recently uploaded (20)

How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 

Coding in Java PLEASE PROVIDE A CODE THAT RUNS PRINTS T.pdf

  • 1. (Coding in Java) (PLEASE PROVIDE A CODE THAT RUNS, PRINTS THE BOARD, HAS A CONSOLE UI CLASS AND MEETS ALL OR AT LEAST MOST OF THE REQUIREMENTS. THANK YOU.) (AND IF YOU CAN CREATE A UML CLASS DIAGRAM) Design and code an Omok application that takes all user inputs from the standard input (System.in) and displays all outputs to the standard output (System.out). Omok (a.k.a. Gomoku and Gobang), literally meaning five pieces, is a two-player strategy game typically played with go pieces --- black and white stones --- on a go board with 15x15 intersections (or places) [Wikipedia]. It is also possible to play the game with paper and pencils because stones, once placed, can't be moved or removed from the board. The two players alternate and place a stone of their color on an empty intersection. The game objective is to put one's stones in a row of five consecutive places vertically, horizontally, or diagonally. The winner is the first player to create an unbroken row of five stones. Your application shall meet the following requirements. R1. The application shall take all user inputs from the standard input (System.in) and display all output to the standard output (System.out). R2. The application shall provide two different game modes: human game and strategy game. In the first game mode, two human players play against each other, and in the second, a human player plays against the computer. Your application shall provide a realistic or reasonable playing strategy for the computer. Minimally, it should detect a winning/losing row, e.g., four consecutive stones with an open end. R3. The game board shall consist of n*n intersections (or places) on which stones of the players are placed, where n >= 15. R4. The application shall provide a way for the user to select the game mode (see R2 above). R5. The application shall provide a way for the user to place his or her stone in an empty intersection (or place) of the board. R6. The application shall show the progress of a game by displaying the current configuration of the board -- all the stones placed -- along with other status information, e.g., a player's turn. Consider using an ASCII drawing to show the board configuration. R7. When the game ends, the application shall display the outcome of the game --- a win or draw --- and highlight the winning row. R8. The application shall provide a way to quit the game, e.g., by entering a special input value. R9. You shall separate your user interface (UI) code from the model code that performs the game logic. The model code should not depend on the UI code. We suggest you create a separate class for the UI, say ConsoleUI, and make the model code independent of the UI class. That is, the UI code may depend on the model code, but not the other way around. Note you will reuse your model code in later assignments but not the UI code. 1. Code your design by naming your main (or entry point) class as Main. 2. (Bonus: 10+ points) Implement a "cheat" mode and provide a way to enable and disable it --- e.g., entering a special value when prompted for the next move. In the cheat mode, the application suggests the next move for the user. It should minimally detect a winning or losing sequence, e.g., a row of four consecutive stones with an open end. TESTING Your code should compile and run correctly with Java 10 or later versions.