How your bucket should look like after you finished the step

Assignment Help Data Structure & Algorithms
Reference no: EM131373804

Continuation of Assignment

For beginners, programming is often hard and frustrating. If a programmer can visualize what they are creating, it makes programming little less difficult. That is what you will do in this module.

You have already submitted the detailed design and game loop with all the dummy functions. During this module, implement one of the very first steps of Tetris, "Display the Bucket". You need to call the function inside the game loop so that it is always displayed. But, you might need to initialize it once before the game loop. Below you will find some detailed instruction on the bucket implementation.

1. Bucket will be a 2-D array of char of 25 x 12 dimension.

2. Fill the left border (column 1), right border (column 12), and bottom border (row 25) of the bucket with any char that you like to create the border with. Remember, the array index is '1' lower than the actual # of columns. This can be your "initializeBucket()" function. Fill the other cells with empty string ' '. You know that, to go over a 2-D array you need two nested for loops. Right? You also need conditional statements.

3. Display the bucket in a game loop. How do you do that? You use two for loops and use a "cout....". You can name the function "displayBucket()".

4. For Windows, use the "Windows.h" library. Use the function below to put your cursor, where you want to display something. Remember the top and left most location of the console is (0,0). So, if you want to draw from the top-left most, you call the function this way, "setCursorTo(0, 0);". Then do your 'cout << "etc etc ..."<<endl;' (see below). If you want to display at some other location, call "setCursorTo" for that location and do a cout again. You can do this "setCursorTo" and "cout<<...." combination as many times as you want. To give bucket a bucket shape, you need to use this "setCursorTo" function appropriately.
void setCursorTo(int x, int y)

{

HANDLE handle;

COORD position;

handle = GetStdHandle(STD_OUTPUT_HANDLE);

position.X = x;

position.Y = y;

SetConsoleCursorPosition(handle, position);

}
Void main(){

setCursorTo(0, 0);

cout <<"etc etc ..."<<endl;

}

5. Here is how your bucket should look like after you finished the step. Notice, you have left border, right border, and bottom border, and everything inside is empty string.

Attachment:- tetris.rar

Reference no: EM131373804

Questions Cloud

List the factors to consider when choosing a supply register : Using Figure 71-25 , select a floor register that will provide an 8-10 ft throw for 150 CFM with a face velocity less than 700 fpm.
Evaluate lenscrafters operations strategy : Evaluate LensCrafters' operations strategy and explain how the organization seeks to gain a competitive advantage in terms of sustainability
What other technical advances do you see cares incorporating : What other technical advances do you see cares incorporating? Do you think that any of these current or potential advancements could result in unexpected negative consequences? If so, what?
Explain what manufacturers mean by a register’s throw : What is the maximum static pressure difference that most residential blowers are designed for?
How your bucket should look like after you finished the step : Here is how your bucket should look like after you finished the step. Notice, you have left border, right border, and bottom border, and everything inside is empty string.
What is the total available static pressure for the ductwork : Blower: 0.55 in wc total external static at design airfl ow Evaporator coil: 0.25 in wc static pressure drop at design airfl ow Filter: 0.1 in wc static pressure drop at design airfl ow Registers and grilles: 0.05 in wc static pressure drop at des..
Determine how a decision will be made : 2. When groups convene to make decisions, one of their first acts typically is to determine how a decision will be made. What type of decision rule is likely to encourage the greatest amount of information exchange?
What are the advantages and disadvantages of brainstorming : What are some reasons managers choose autocratic decision making over group decision making, regardless of the quality of the outcome?
How has wireless technology changed your quality of life : Write a 700-word summary of your selected article on wireless technology. Be sure to also address the following: How has wireless technology changed your quality of life or your work environment

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  What is the linear data structure

what is the linear data structure ? Give example .Describe how an array is represented.

  Creating dataflow diagram

Think about the level of detail involved with creating a dataflow diagram, why should the narrative be prepared? Explain why do we need the questionnaire?

  Design of web pages

Explain how a web designer defines a page as XHTML as opposed to HTML and recognize two different types of XHTML standards.

  Design an o(v+e) time algorithm that computes

Design an O(V+E) time algorithm that computes the smallest number of batches required to complete all tasks. A task can be assigned to a batch i if and only if all tasks that are its prerequisites have already been assigned to batches 1 to (i-1).

  Converting arithmetic expression in reverse polish notation

Convert the following numerical arithmetic expression into reverse Polish notation and show the stack operations for evaluating the numerical result.

  Description of the steps of the algorithm and justify it

Design an algorithm that solves the above problem using a mandatory heap and has time complexity O(m + k*lg(m)) and space complexity O(m).

  What is the best algorithm for sorting

What is the best algorithm for sorting each of the following: general comparable objects, long character strings, double precision floating point numbers, 32-bit integers, and bytes? Justify your answer.

  Calculate bits number output of first round-des decryption

Calculate the bits number 1, 16, 33, and 48 at output of first round of DES decryption, suppose that ciphertext block is composed of all ones

  Data structure used to implement an associative structure

In computing, a hash table (such as a Java HashMap) is a data structure used to implement an associative structure that maps keys to values.

  Describe a fair coin algorithm to returns either 0 or 1

Describe a FAIRCOIN algorithm that returns either 0 or 1 with equal probability, using ONEINTHREE as your only source of randomness.

  Recursive tree algorithmsalgorithms to write1 write a

recursive tree algorithmsalgorithms to write1. write a recursive function to determine if a binary tree is a binary

  Important java questions

Add a method addText to the Question class, and provide a different implementation of Choice Question that calls add Text rather than storing an array list of selections.

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