Search:

Type: Posts; User: Norm

Search: Search took 0.28 seconds.

  1. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Do you get an error message?
  2. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Which index was out of bounds?

    Add a println that prints out the values of the indexes so you can see.
  3. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    What happens when the code is executed?
    Use the Arrays class's toString() and deepToString() methods to format the arrays for printing before and after those methods execute to see what they are...
  4. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    I'd use normal indexes to go through the 2Dim array and Have a separate index for the 1 Dim array
  5. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    The 1Dim array would need its own index, separate from the indexes for the 2Dim array.
  6. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    With loops and indexing. If you can write the code in post#15, it shouldn't be hard to write code to convert an array's dim from 2 to 1 and back.
  7. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Can a 1Dim array be used to create a 2Dim array? Your earlier post showed a 2Dim array that looked like each row was a section from a 1Dim array.
    For example:
    0 0 0 0 0 1 0 1 1
    would fold to:
    ...
  8. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Please edit your post and wrap your code with


    <YOUR CODE HERE>

    to get highlighting and preserve formatting.

    Also can you post a small. complete program that compiles and executes?

    I've...
  9. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Get a working part for now and come back to it later.


    You won't know that until you find a better solution.
  10. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    There is always more than one way. Solve it now, improve it later.
  11. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Do that and discard those with the wrong number of 1s
  12. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Why a 2D array? The rows of the 2D array concatenated together make a single row to hold the number. first row + second row + third row = the number as 1D


    What problems are you having? Do you...
  13. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    Not sure how that works. What are the rows and the columns?
    How would 01101 be stored in a 2D array?
  14. Re: Support Needed - Populating a 2d matrix with different binary number representations.

    What code do you have so far?
    I'm not sure I understand k: k=number places with value "1"
    What is a "place"? One of the slots in the array?
    Do the slots in the array hold a single bit with a...
Results 1 to 14 of 14