Search:

Type: Posts; User: Fan Zhendong

Search: Search took 0.15 seconds.

  1. Re: How can I add a user input into a 2D- array and print it?

    Anyway, I will read up on that - I don't mean to bother.
    Thanks for all your help!!

    --- Update ---

    Then I don't know yet - I will have to figure that out.

    When it something is already in...
  2. Re: How can I add a user input into a 2D- array and print it?

    Ok, I will look into that...

    So I can just create another method any time and use it for something specific (in this case, whenever I want to print the Grid/ array)?
  3. Re: How can I add a user input into a 2D- array and print it?

    Oh ok, I understand.

    But how do I incorporate that in my initial code and print the "changed" array?

    --- Update ---

    First I would add this:
  4. Re: How can I add a user input into a 2D- array and print it?

    O ok, I think I understand. Yeah rows (left, right) and columns (up, down).

    Anyway, what I mean should happen is like this for example: (Ignore the awkward spacing - just tried to make it easier...
  5. Re: How can I add a user input into a 2D- array and print it?

    Say the user input is "4"
    That means they are choosing the row in which the R will be placed. The program should then automatically place R in the bottom column of that row (like you drop a disc...
  6. Re: How can I add a user input into a 2D- array and print it?

    I mean Row (horizontal/ above)

    I don't know how to place "R" into the array at all(or to print the array). I have tried a few things, but nothing worked. I am very new to programming...
  7. Re: How can I add a user input into a 2D- array and print it?

    If I understand your question right... yeah, that was a bit vague of me. It is like the game Connect 4. The user input refers to the Row (horisontal). The user picks the row in which the "R" will...
  8. How can I add a user input into a 2D- array and print it?

    //THIS IS THE CODE I HAVE SO FAR:

    import java.util.Arrays;
    import java.util.Scanner;
    import java.io.File;
    import java.io.FileWriter;
    import java.awt.event.KeyEvent;
    import...
  9. How can I add a user input into a 2D- array and print it?

    //THIS IS THE CODE I HAVE SO FAR:

    import java.util.Arrays;
    import java.util.Scanner;
    import java.io.File;
    import java.io.FileWriter;
    import java.awt.event.KeyEvent;
    import...
Results 1 to 9 of 9