Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Thread: Array overwriting

    by Norm
    Replies
    7
    Views
    980

    Re: Array overwriting

    Are you asking how to write an if statement?
    See the tutorial: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)

    --- Update ---
    ...
  2. Thread: Array overwriting

    by Norm
    Replies
    7
    Views
    980

    Re: Array overwriting

    The numbers in the array have no meaning for me.

    Can you answer this question?
    What value(s) in the array means that it is OK to move a car there?

    Use a if statement to detect if the array at...
  3. Thread: Array overwriting

    by Norm
    Replies
    7
    Views
    980

    Re: Array overwriting

    How do you know there is a car in the location? What is in the array?
    The Arrays class's deepToString() method is useful for printing out the contents of a 2 dim array for debugging:

    ...
  4. Thread: Array overwriting

    by Norm
    Replies
    7
    Views
    980

    Re: Array overwriting

    Can you use an if test to detect if the location is already occupied before changing it?

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve...
Results 1 to 4 of 4