Chat with us, powered by LiveChat Building a full-functional Tetris application requires a little more Java than what we've covered yet, so you'll be provided a working application that you can download and play. It's a simplified version of the game, with a very rudimentary scoring mechanism, but it's still quite enjoyable and challenging. - STUDENT SOLUTION USA

Java programming need to develop game Play Tetris 
 Due Date: March 3
Need full solution: Problem Coverage 100% and 100% code path test coverage
 Please feel free to improve and resubmit your code as many times as you like (before the deadline) in order to improve your score. 
Overview


TetrisLinks to an external site.
 was arguably the most popular single-player computer game of all time by the early 1990’s. It’s incredibly easy to learn, and even to this day it’s widely considered to be among the best video games of all time.

There are some animations in the link above, but in case you’ve never seen it, the interface consists of a tall narrow rectangular grid as the game board. Randomly-selected geometric shapes appear at the top, one at a time, and begin to incrementally fall from top to bottom. The player must manipulate each shape as it falls, by moving it horizontally within the board and/or rotating it in 90° increments. Once the shape can fall no further, it becomes locked in place, taking up some of the available spaces within the board.
The goal is to continue playing as long as possible, so the player must attempt to place the shapes strategically. Completing horizontal rows is crucial to prolonging the game. If the player can form one or more horizontal rows completely full of blocks, those rows are removed, with all blocks above falling downward. Eventually, the board fills upward to a limit line, and if any portion of a shape is locked in place above this line, the game is over.
You’ll see all of this in action soon enough, and it’s usually quite easy to understand once you’ve played it for just a few minutes.
Requirements
Building a full-functional Tetris application requires a little more Java than what we’ve covered yet, so you’ll be provided a working application that you can download and play. It’s a simplified version of the game, with a very rudimentary scoring mechanism, but it’s still quite enjoyable and challenging.
You may wonder, if the application is provided, what this is assignment all about. The goal here is to develop a simple Artificial Intelligence (“AI”) system, capable of playing the game as if it were the human player. The game system you’ll download can ask your AI what to do, just as each shape first appears at the top of the board. The game will provide your AI the identity of the shape, along with the current contents of the board. Your AI will then compute the best of all possible placements, using a cost-based algorithm, and provide it to the game.

Implementing an Interface
In previous assignments, you were given a class file with method declarations, Javadoc comments, and placeholder implementations. In this assignment, you’ll be given an 
interface instead. An interface contains the method declarations and the Javadoc comments, but no code at all (not even placeholders). Your task is to 
implement this interface, which means you’ll develop a class that provides code for all the methods declared in the interface. In additio

help-doc.html

JavaScript is disabled on your browser.

Skip navigation links

Package

Class
Use

Deprecated

Index

Help

Prev
Next

Frames

No Frames

All Classes

How This API Document Is Organized

This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

Interfaces (italic)
Classes
Enums
Exceptions
Errors
Annotation Types

Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

Class inheritance diagram
Direct Subclasses
All Known Subinterfaces
All Known Implementing Classes
Class/interface declaration
Class/interface description

Nested Class Summary
Field Summary
Constructor Summary
Method Summary

Field Detail
Constructor Detail
Method Detail

Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

Annotation Type
Each annotation type has its own separate page with the following sections:

Annotation Type declaration
Annotation Type description
Required Element Summary
Optional Element Summary
Element Detail

Enum
Each enum has its own separate pag

META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.4
Created-By: 11.0.2+9 (Oracle Corporation)
Main-Class: edu.vt.cs5044.tetris.Tetris5044

edu/vt/cs5044/tetris/AI.class

                package edu.vt.cs5044.tetris;

                public 
                abstract 
                interface AI {
    
                public 
                abstract Placement 
                findBestPlacement(Board, Shape);
    
                public 
                abstract int 
                getColumnHeightRange(Board);
    
                public 
                abstract int 
                getAverageColumnHeight(Board);
    
                public 
                abstract int 
                getTotalGapCount(Board);
    
                public 
                abstract int 
                getColumnHeightVariance(Board);
}

            

edu/vt/cs5044/tetris/Board.class

                package edu.vt.cs5044.tetris;

public
synchronized
class Board {

public
static
final int
WIDTH = 10;

public
static
final int
HEIGHT = 24;

public
static
final int
HEIGHT_LIMIT = 20;

private
final java.util.Set
blockSet;

private boolean[][]
fixedBlocksCache;

private boolean
validCache;

public void Board();
void Board(Board);
Board
getCopy();

public
transient void Board(String[]);

private boolean
isCollision(Piece, Coordinate);

public boolean[][]
getFixedBlocks();

public Board
getResultBoard(Shape, Placement);
void
clear();
boolean
isValidMove(Placement, Piece);
java.util.Set
getBloc

 

error: Content is protected !!