Find out what are the data structures you need to use

Assignment Help Computer Engineering
Reference no: EM132093877

Please add comments in your code so I understand what you have done, thank you!

A good first step when creating a computer program is to start the detailed design process using pen and paper. With this in mind, write out the following:

List all the steps in Tetris.

Find out the data (e.g. a bucket, etc.) that you will have in the program.

Find out what are the data structures you need to use to store those data.

Find out the actions that your program needs for the game. All the actions will be functions.

Come up with the sequence how you would call functions from the main function, inside the game loop, and from inside other functions.

Remember, you will do all of this with a pen and a paper before you write any code on the computer.

Now take your hand-written detailed design and create your C++ program. In the program, you will have:

All the data structures (e.g., bucket, shape array, etc.) declared

The function declarations and empty body implementations

The functions being called in the "main" function and from any other functions

Refer to your hand-written notes and include them as comments in your program. Describe your program with tons of comments, especially for all the function implementations for the game loop.

Put a display in your functions that would say which function it is in, e.g., "In moveShape." To slow down the program, you can slow it down with "sleep".

Remember, you are using blank or empty calling functions, as in:

/* Add comments at the top of the program describing what this program is about. You can provide example input and output of program if applicable.*/

// Gets the input from the user.
bool getUserInput() {
cout << "In getUserInput function" << endl;
sleep(500);
}

// Finds the key is pressed.
// Then, calls the appropriate function to move the shape
void moveShape (char input) {

cout << "In moveShape function" << endl;
sleep(500);

// You might have a switch case or something to find which key is pressed.

//Then, in each case call the appropriate function, like below.
moveShapeLeft();

}

/* The main function where all the actions start. */
int main(){

while(!gameOver) {
//(1) Gets the user input.
key = getUserInput();

//(2) Displays the bucket.

//(3) Moves the shape
moveShape(key);
....
....
....
}
}

Reference no: EM132093877

Questions Cloud

Define our brand and create brand equity : How should we use strategy to define our brand and create brand equity? Which strategies actually hurt brand image?
What remote forensic technique could be used to discover : What remote forensic technique could be used to discover the malware is running under the contents of a specific process?
Article on risk tolerance : The game show host is standing next to you on the stage, saying: "You have $30,000. You can keep the money or decide to play and possibly lose it all.
Prepare a memorandum for larry the landscaper : Complete a tax return for a sole proprietor based on the provided scenario. Further, you will prepare a memorandum for Larry the Landscaper providing profession
Find out what are the data structures you need to use : Come up with the sequence how you would call functions from the main function, inside the game loop, and from inside other functions.
Represent money in terms of payout : Driving between two destinations might cost you money in gas because you have no passenger, while others might make you money because passengers will pay.
Get away with deceptive advertisement : How do you think so many social media platforms/messages are able to get away with deceptive advertisement? What are some examples??
What are factors typically considered in project selection : Why is the project charter often an input to other project management processes/practices? What are some factors typically considered in project selection?
Summarize the coca-cola case using given information : Summarize the Coca-Cola case expanding upon consumers perspective on soda consumption. Three (3) dilemmas are presented within the case.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd