I can do that, but I am not sure how to actually drop the piece until it hits something of the larger jar array.
Type: Posts; User: Fredir
I can do that, but I am not sure how to actually drop the piece until it hits something of the larger jar array.
int finalHeight = 0;
for( int i = 0; i < 4; i++)
{
for(int j = 3; j > -1; j--)
{
if(box[j][i] != 0)
{
for(int k = firstRow + j; k < 20; k++)
{...
Basically, I have the small 4 X 4 bool box and the larger jar 10 X 20, which is also bool. I want to move drop the bo until the block in the box collides with any piece from the jar.
I tried a...
I have a 4X4 bool "box" array inside a larger "jar" array and want to write a drop loop so if the user presses a certain key, it will drop the piece (this is for a tetris game) until it hits...
Can anyone spot anything wrong with the 'w' (rotation) part???
Thank you so much.
Yes, I am doing something similar.
Ok, but regarding my last post about the rotation part, why is it not displaying anything at all on the jar array?
Also, I added an new if thing for rotation but it doesn't seem to be working. I am kind of losing my mind over this right now. If anyone can shed some light on this statement as well, I would highly...
Thank you for the help everyone--I decremented the indexes on the down and right shift. Here is the updated code:
// Practice 2.cpp : Defines the entry point for the console application.
//
...
can anyone explain why that makes a difference?
What you mean four loops, the last two are to delete the line on the top.
I really don't see how starting from the bottom would matter. Can someone suggest a correction?
I am writing this program to move a box in a jar(a larger array). First, I overlap the box into the array, then I print the array and attempt to move it. But for some reason, the moving part of the...
Ok, so I would need to ask the user for the number of rows in matrix 1, the number of columns in matrix 2, and the number of elements he will input in each row/col, right?
- Also, I need to input...
thank you so much for the elaborate post. I will see how it goes from here.
dwks, can you give me a brief example of how to declare such an array? I am assuming we need Y (the number of columns)...
I am not sure how the whole col/row thing is being played out in an array, though. I would appreciate if anyone could explain...thanks.
I have to input it across--how would I implement the index in this case? I having a hard time visualizing how to set up the indexes...
dwks, just a minor question, i would have to declare int array to be of a specific size before doing that right?
I have to use 1d arrays. I still don't get how it would behave like as the 2 d array above, though--can anyone explain?
In other words, how would I input data row by row using this index (A[2*j+3]...
would this work with a 1 d array as well?
I have to do a program to multiply two matrices using 1d arrays, but I am not sure how to begin. What would I need to get from the user--the number of rows in the first array and cols in the second...
Oh I see, I can have an array with
bool box [ X ] [ Y ] = Function ( Boo ); -- Is that what you meant?
- Sorry, I am just starting out, is there a simple way of doing this?
I see, but the function in this case is being called by another function, so sending it wouldn't work.
Is there a way to just return the array without vectors?
I have a function that creates a 2d bool array--so the contents are either 0 or 1. Is there any way to return the array or to pass it as a pointer?
The reason I wanted bool is just so I know which spots actually have info inside. SO, if there is a blank space, I would want it to display 0.
Can anyone suggest a solution for that? as of now, my...
I am trying to make a rotating function for a 4X4 array:
Here is what I have so far, but I need the array to be a bool functuion that displays some zeros, so far it is only displaying 1s, any...