Some Update and Save before making dangerous changes
This commit is contained in:
-1257
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -2,6 +2,7 @@ package game;
|
||||
|
||||
import gui.GUI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class Control {
|
||||
@@ -166,6 +167,32 @@ public class Control {
|
||||
|
||||
}
|
||||
|
||||
// public void checkN(Cell[][] arr, Cell[][] futureGen, int columns, int rows) {
|
||||
// ArrayList<Thread> threads = new ArrayList<>();
|
||||
// final int NUM_OF_THREADS = 8; //Or can be passed as an argument
|
||||
// for (int tid = 0; tid < NUM_OF_THREADS; tid++) {
|
||||
// Integer thread_local_row_start = tid * rows / NUM_OF_THREADS;
|
||||
// Integer thread_local_row_end = (tid + 1) * rows / NUM_OF_THREADS;
|
||||
// Thread t = new Thread(() -> {
|
||||
// for (int row = thread_local_row_start; row < thread_local_row_end; row++) {
|
||||
// for (int column = 0; column < columns; column++) {
|
||||
// countNeighbors(arr, row, column, rows, columns);
|
||||
// evaluateNeighbors(arr[row][column], futureGen[row][column]);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// t.start();
|
||||
// threads.add(t);
|
||||
// }
|
||||
// for (Thread t : threads) {
|
||||
// try {
|
||||
// t.join();
|
||||
// } catch (InterruptedException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public boolean[][] nextGenBackup() {
|
||||
|
||||
gen++;
|
||||
|
||||
Reference in New Issue
Block a user