Results 1 to 3 of 3

Thread: Code issues

  1. #1
    jerfw is offline Member
    Join Date
    Feb 2017
    Posts
    1
    Rep Power
    0

    Default Code issues

    // Not sure what this code is supposed to do, but if anyone wants to take a look at it and fix the issues, it shouldn't take more than a couple of minutes, I'm sure. Please help.

    public class testerValider {

    public testerValider(int grille[][]) {

    boolean solution = true;
    int nbelement = 0;

    for (int i = 0; i < grille.length; i++) {
    int max = grille[i][0];
    for (int e = 1; e < grille[i].length; e++) {

    if max = (grille[i][e] && max != 0) {
    solution = false;
    System.out.println("The grid is not valid ! ");
    break;
    }

    if (grille[i][e] != 0) {
    nbelement++;
    }
    int max = grille[i][e];
    }
    }
    int max;
    if (solution && max < 16) //orthographe solution {
    solution = false;
    System.out.println("The grid is not valid ! ");
    }


    public static void main(String[] args) {
    int[][] grille = {{1, 2}, {3, 4}, {5, 6}, {7, 8}, {1, 3}, {4, 6}, {7, 9}};
    testerValider(grille);
    }
    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Code issues

    If you don't know what it's supposed to do then how do you expect complete strangers to help you fix it?

    And note that..."help you fix it". We won't be doing the fixing.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Code issues

    This is great. You don't know what it is supposed to do, there are no errors, but you know it should only take someone a few minutes to fix it. Please don't post stuff like this. And please read the forum rules before you post again.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Function issues with my code?
    By javanewbie82 in forum New To Java
    Replies: 2
    Last Post: 11-02-2016, 09:23 AM
  2. Code continues on for a long time - Recursion Issues
    By Captain Forge in forum New To Java
    Replies: 1
    Last Post: 03-30-2013, 04:50 PM
  3. I am having issues to run this code ?
    By dantzig in forum New To Java
    Replies: 5
    Last Post: 06-24-2012, 01:53 AM
  4. having issues with this java code...please help out
    By oenhouse in forum New To Java
    Replies: 4
    Last Post: 12-20-2010, 01:21 PM
  5. Major issues with code - Please help
    By aldorfski_17 in forum New To Java
    Replies: 3
    Last Post: 03-29-2010, 04:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •