Package org.matheusdev.util.matrix

Examples of org.matheusdev.util.matrix.MatrixNbl


  public static void main(String[] args) {
    final int w = 20;
    final int h = 20;
    final FastRand rand = new FastRand();

    MatrixNbl mat = new MatrixNbl(w, h);

    System.out.println("Precent elements: " + mat.values.length);
    System.out.println("Actually needed elements: " + ((w * h) / 8));
    System.out.println("w * h: " + (w * h));

    for (int y = 0; y < h; y++) {
      for (int x = 0; x < w; x++) {
        boolean bool = rand.randBool();
        mat.set(bool, x, y);
        System.out.print(bool ? "#" : ".");
      }
      System.out.println();
    }
    System.out.println();

    for (int y = 0; y < h; y++) {
      for (int x = 0; x < w; x++) {
        System.out.print(mat.get(x, y) ? "#" : ".");
      }
      System.out.println();
    }
  }
View Full Code Here

TOP

Related Classes of org.matheusdev.util.matrix.MatrixNbl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.