That is wrong. What are those single letter variables?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
That is wrong. What are those single letter variables?
If you don't understand my answer, don't ignore it, ask a question.
create x and get y to compute location ????
create i
create j
perform i * j
add (i * j) to list
None of the above makes any sense to me. If i and j are the loop variables, what does "create" mean?
If you don't understand my answer, don't ignore it, ask a question.
for every row equal to 0 to BLOCKROWS
for every column equal to 0 to NBLOCKS
create x
create y
create colour
perform addbrick (list created)
perform row * ROWSEPARATION + ROWZERO
perform column * BLOCKWIDTH
(add row and column) add to list location
return list
You would compute the value of x outside the inner loop because it would apply to all the shapes being created in the inner loop.create x
These make no sense to me. Can you explain what each of them means?perform row * ROWSEPARATION + ROWZERO
perform column * BLOCKWIDTH
(add row and column) add to list location
If you don't understand my answer, don't ignore it, ask a question.
Is Y also computed outside the loop?
It says that:
The i'th row of blocks has its upper edge aligned with i (row) * ROWSEPARATION +ROWZERO.
The j'th column of blocks has its left edge aligned with j (column) * BLOCKWIDTH
since the column depends on the row , row + column would be the answer
Last edited by geforce; May 21st, 2012 at 08:47 PM.
How can it? It is where the shapes go on the current row.Is Y also computed outside the loop?
Look at the drawing you made of the grid you are building. See how the values of the locations where each shape goes relates to the row and column and how the values of the uppercase constant variables determine where the next shape goes.
If you don't understand my answer, don't ignore it, ask a question.
When row is at 0 the row goes to 50
When column is at 0 the column goes to 0
When row is at 1 the row goes to 100
When the column is at 1 the column goes to 50
The row is always ahead of the column by 50 atleast so no errors would occur
None of those last two posts makes any sense to me.
That's it for tonight. Back tomorrow.
If you don't understand my answer, don't ignore it, ask a question.
sigh... -.-
Any luck on getting a design for your project?
If you don't understand my answer, don't ignore it, ask a question.