Search:

Type: Posts; User: Norm

Page 1 of 2 1 2

Search: Search took 0.15 seconds.

  1. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Any luck on getting a design for your project?
  2. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    None of those last two posts makes any sense to me.

    That's it for tonight. Back tomorrow.
  3. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    How can it? It is where the shapes go on the current row.

    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...
  4. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    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.



    These make no sense to me. Can you explain what each of them...
  5. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    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...
  6. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    That is wrong. What are those single letter variables?
  7. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Why are you writing code before finishing the design?
  8. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    You'll need the x & y for addbrick()

    What are the last two steps for?
  9. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    where do you compute the x and y values for the locations of the shapes?
    Where is the color created?

    What are the last two steps for?
  10. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    I'm asking for the steps in English (pseudo code) that the program needs to do for step#4.
  11. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Can you now put together the detailed simple steps for step#4?
  12. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Again you are mixing the row and column values with the x and y locations for the shapes.
  13. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Finish the steps in the design first before working on the code.
    Take a piece of paper and draw the shapes on it as they are supposed to go in the grid.
    Label the locations of each shape using the...
  14. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    What is the purpose of that code?

    You're mixing two things together. One variable needs to keep track of the row (or column) and the other needs to be used to locate the shape's x (and y) location...
  15. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Can you say in words what the code you posted is supposed to do?

    Sometimes there is nothing to be done. The comment: "do things for this ..." was just a reminder and a place holder in case there...
  16. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    That would be how you would use the loops (see post#26). Outer loop for rows, inner loop for columns.
  17. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Do they keep track of the row and column?
  18. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Again it looks like you are trying to write code. Where are the steps for #4?
    I'd expect something like this:

    begin loop to work on a row
    do things needed for this row
    begin loop to work on...
  19. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Do you have the steps the program needs to do now? You keep posting lines of code.
    What is the logic for placing the shapes for #4?
    Does the GRect constructor take the size? That would be for #3. ...
  20. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Ok, I think I get it. The method is supposed to layout shapes on a visual grid. Most of the needed logic is for step #4. Work on the rows one by one using step #6 to get the rows position. On each...
  21. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    #4 what is a block? what is a grid? At what locations in the grid do the blocks go?
    #5 implies the grid is a 2D array. Is that right?

    I have no idea what #6 & #7 mean

    #8 What is the List...
  22. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    I have not seen the List of steps the code has to do to solve the problem. Post that and we'll work on the code for each step one by one.

    Perhaps the steps you are thinking of are at a too high a...
  23. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Writing code before you have a design for what the code is supposed to do usually is a bad idea.
    Get the design, then write the code.
  24. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    The idea of using well named variables is so when you (or anyone) reads the code they can understand what it does. When the coding is finished and is being tossed in the bin who cares what the names...
  25. Replies
    60
    Views
    4,882

    Re: Making a method to move blocks in a grid

    Often you can code from the list of simple steps.
    If you have a list of steps and are having a problem coding any of them, list the step you are having problems with.


    With a return statement:...
Results 1 to 25 of 27
Page 1 of 2 1 2