JAVA-ECLIPSE -ScoreFour

Sigchi4life
Category:
Programming
Price: $50 USD

Question description

Your task is to write a program to play a game. If you have ever played Connect Four you’ll know quite a bit about what’s required, but don’t worry if you haven’t. 

Consider an 4x4x4 grid, which can be filled from one side designated bottom. The game is played by two players, each of whom has a colour (player 1 is white and player 2 is black). The players put counters on the grid, filling from the bottom in alternating turns. You can imagine dropping counters from the top; they stack on top of each other.
The goal is to be the first player to place 4 counters of their own colour in a straight line, where both orthogonals (single column, single row, or single tower) and diagonals (from any corner to any other corner, that is not already an orthogonal) are permitted. Each game begins with the grid empty. The first player to gain a line of 4 counters in their own colour wins. 

Your program will play against others in a League with a central ranked battle arena, and part of your mark will depend on your TrueSkill Ranking as you beat your friends. The TrueSkill mark will contribute a small part of your final mark (10% of your mark for this assessment, 1% of your mark for this unit). 

See the relevant wikipedia page.

Skeleton Code

Download skeleton code

Winning Board states

Below are 2D representations of the 3D board in this game and the winning coditions

Orthogonal line
-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   -   w	   -   -   -   -

-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   -   w	   -   -   -   -

-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   -   w	   b   b   b   b

-   -   -   -   	-   -   -   w   	b   -   -   -   	-   -   -   -   
 -   -   b   -  	 -   b   -   w  	 b   -   -   -  	 -   w      -  
  -   b   -   b 	  -   b   -   w 	  -   b   -   - 	  -   w   -   - 
   w   w   w   w	   b   -   -   w	   -   -   -   w	   b   w   w   w
White player wins	White player wins	White player wins	Black player wins

(w represents the colour white)
(b represents the colour black)
red is used to indicate the winner
Diagonal line
-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   -   w	   w   -   -   -

-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   w   b	   b   w   -   -

-   -   -   -   	-   -   -   -   	-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   w   w   b	   b   w   w   -

-   -   -   w   	b   -   -   -   	-   -   -   -   	-   -   -   -   
 -   b   w   -  	 -   b   w   w  	 -   -   -   -  	 -   -   -   -  
  -   w   b   - 	  -   w   b   - 	  w   -   -   - 	  -   -   -   w 
   w   -   -   b	   w   -   -   b	   w   b   b   b	   b   b   b   w
White player wins	Black player wins	White player wins	White player wins
b   -   -   -   	-   -   -   -   	w   -   -   -   	-   -   -   w   
 -   -   -   -  	 -   -   -   -  	 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   b   -   -   -	   -   -   -   -	   -   -   -   -

w   -   -   -   	-   -   -   -   	b   -   -   -   	-   -   -   b   
 b   -   -   -  	 -   -   -   -  	 -   w   -   -  	 -   -   w   -  
  -   -   -   - 	  b   -   -   - 	  -   -   -   - 	  -   -   -   - 
   -   -   -   -	   -   -   -   -	   -   -   -   -	   -   -   -   -

w   -   -   -   	-   -   -   -   	w   -   -   -   	-   -   -   w   
 w   -   -   -  	 b   -   -   -  	 -   b   -   -  	 -   -   b   -  
  b   -   -   - 	  w   -   -   - 	  -   -   w   - 	  -   w   -   - 
   -   -   -   -	   w   -   -   -	   -   -   -   -	   -   -   -   -

b   -   -   -   	b   -   -   -   	w   -   -   -		b   -   -   w   
 w   -   -   -  	 w   -   -   -  	 -   b   b   -  	 -   -   b   -  
  w   -   -   - 	  w   -   -   - 	  -   -   b   - 	  -   b   -   - 
   b   -   -   -	   b   -   -   -	   -   -   -   w	   w   -   -   -
Black player wins	Black player wins	White player wins	White player wins
-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  
  -   -   -   - 	  -   -   -   - 
   -   -   -   b	   b   -   -   -

-   -   -   -   	-   -   -   -   
 -   -   -   -  	 -   -   -   -  
  -   -   b   - 	  -   b   -   - 
   -   -   -   w	   w   -   -   -

-   -   -   -   	-   -   -   -   
 -   b   -   -  	 -   -   b   -  
  -   -   w   - 	  -   w   -   - 
   -   -   -   w	   w   -   -   -

b   -   -   -   	-   -   -   b   
 -   w   -   -  	 -   -   w   -  
  -   -   w   - 	  -   w   -   - 
   -   -   -   b	   b   -   -   -
Black player wins	Black player wins

FAQ
  • Do I need to draw this board? No: the above illustrations are only to help you understand how the game works.
  • Does it matter if I don't win the League? No. The League mark is 1% of your final grade --- but you do get tremendous fame for winning :)
  • What is TrueSkill? It's a ranking system used in a series of popular games. The algorithm is published but it isn't part of this course.
  • Does my ScoreFour class require to uphold the timing requirements? No, the timing information is only for the tournament
Learning Outcomes
  • Use packages to group common classes
  • Perform a decision based on input
  • Use appropriate data structures to store data

Competition

Competition Information

There will be a competition for the best ScoreFour player algorithm. You will have to implement the player interface and submit that along with your assignment submission. This player will then compete against all other players submitted by students and tutors in this unit. 

The number of submissions allowed has increased to allow you the chance to fine tune your player. The tournament is run every hour on the hour. Your player will be instantiated once during each tournament and the same instance will play against multiple opponents. You will be notified of your opponent and of the outcome of the game. 

Your player will have limited time to decide on which move to make. This is done to ensure that the tournament can be comfortably run within the hour. The timing information is below and may be subject to changes.

Player Instructions
  • Your player may be named anything you choose (please be reasonable with the naming, profanity will not be accepted).
  • It MUST implement the Player interface given with the skeleton code (this interface must NOT be modified by you).
  • Your player must be in a package that is the same as your unikey (the username used for logging into PASTA).
  • If you have more than one player that fits these requirements, one will be chosen at random.
Competition Timing Information
Method NameTime allotedPenalty for not competing in time
Constructor20msPlayer will not be in the tournament this hour
getNextMove20msPlayer will not place a piece this turn.
notifyNewOpponent20msNone
notifyOutcome20msNone

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UC Berkeley
PREMIUM TUTOR
Studypool has helped 1,244,100 students
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1822 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors