That is wrong. What are those single letter variables?
Printable View
That is wrong. What are those single letter variables?
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?
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.Quote:
create x
These make no sense to me. Can you explain what each of them means?Quote:
perform row * ROWSEPARATION + ROWZERO
perform column * BLOCKWIDTH
(add row and column) add to list location
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
How can it? It is where the shapes go on the current row.Quote:
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.
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.
sigh... -.-
Any luck on getting a design for your project?