Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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 ..."<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 ..."<

}

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92183639
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Computer Engineering

You have been selected to participate in a free-throw

You have been selected to participate in a free-throw challenge for the halftime entertainment during a basketball game. You will have the opportunity to shoot 2 baskets, from the free-throw line. If you make one basket, ...

Innbspmid-2009 rite aid hadnbspccc-ratednbsp20-year bonds

In? mid-2009, Rite Aid had? CCC-rated, 20-year bonds outstanding with a yield to maturity of 17.3%. At the? time, similar maturity Treasuries had a yield of 5%. Suppose the market risk premium is 4% and you believe Rite? ...

How do you make a java program that reads two diagonal

How do you make a Java program that reads two diagonal points, say p1 and p2, of an up-right rectangle and finds both the smallest circle containing the rectangle and the largest circle that can be contained in the recta ...

With more persons working from home how does one separate

With more persons working from home, how does one separate data intended for the employer form what might be considered personal property? What policies could be put in place to ensure employees adhere to safe guidelines ...

Question 1 identify all the dfd data flow diagram elements

Question: 1. Identify all the DFD (data flow diagram) elements (Shostack, 2014, p.531.). 2. Identify all threat types to each element(Shostack, 2014, p.531.). 3. Identify threats (three or more), one each for data flow, ...

Question develop a taxonomy of dsia document a taxonomy is

Question: Develop a "taxonomy" of DS/IA document. A taxonomy is a way of organizing something on a "group within group" basis. (Remember how the biological taxonomy is structured.) Initially, define data security and inf ...

Sql using oraclethe task is to remove suffix from last name

SQL using Oracle. The task is to remove suffix from last name column (e.g. Smith Sr. or Stevens Jr.) and put into the preexisting suffix column in the DB. Final result needs to be in the last name column: Smith or Steven ...

Suppose you are writing software for a radio station that

Suppose you are writing software for a radio station that manages its playlists. The program will generate candidate playlists from a record library automatically and station personnel can then check and modifythem. Disc ...

One-year treasury bills currently earn 225 percent you

One-year Treasury bills currently earn 2.25 percent. You expected that one year from now, 1-year Treasury bill rates will increase to 2.75 percent and that two years from now, 1-year Treasury bill rates will increase to ...

Video and disruption report assignmentoverviewfor this

Video and Disruption Report Assignment Overview For this assessment task, you will create a two-minute video and written proposal about the impact of a particular technology on an industry or field. The purpose of this a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As