Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .besouro/2015100812403882/actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FileOpenedAction 1444297238585 Cell.java 68 1 3 0
EditAction 1444297262434 Cell.java 224 1 3 0
EditAction 1444297262571 TestCell.java 359 1 3 1
EditAction 1444297262646 TestGrid.java 170 1 0 0
CompilationAction 1444297263285 TestCell.java
CompilationAction 1444297263285 TestCell.java
CompilationAction 1444297263285 TestCell.java
CompilationAction 1444297263285 TestCell.java
RefactoringAction 1444297514842 Cell.java ADD void update() METHOD
RefactoringAction 1444297544363 Cell.java RENAME Cell(int, int)=>void cell(int, int) METHOD
RefactoringAction 1444297549873 Cell.java RENAME cell(int, int)=>Cell(int, int) METHOD
RefactoringAction 1444297641892 Cell.java ADD int getNeighbors() METHOD
RefactoringAction 1444297650908 Cell.java RENAME getNeighbors()=>int getNeighbours() METHOD
RefactoringAction 1444297661423 Cell.java RENAME neighbor=>int neighbour FIELD
RefactoringAction 1444297749945 Cell.java REMOVE update() METHOD
RefactoringAction 1444297752844 Grid.java ADD void update() METHOD
RefactoringAction 1444298186590 Cell.java RENAME collum=>int x FIELD
RefactoringAction 1444298187598 Cell.java RENAME row=>int y FIELD
RefactoringAction 1444298234672 Cell.java ADD String state FIELD
RefactoringAction 1444298450978 Cell.java ADD import java.util.Random IMPORT
RefactoringAction 1444298992326 Grid.java ADD Cell FIELD
RefactoringAction 1444299004848 Grid.java RENAME cell=>Array FIELD
RefactoringAction 1444299005853 Grid.java RENAME cel=>Array FIELD
RefactoringAction 1444299067428 Grid.java REMOVE cell FIELD
RefactoringAction 1444299068934 Grid.java ADD int FIELD
RefactoringAction 1444299097455 Grid.java ADD void start FIELD
RefactoringAction 1444299104462 Grid.java RENAME start=>void start() METHOD
RefactoringAction 1444299270017 Grid.java REMOVE grid FIELD
RefactoringAction 1444299317246 Grid.java ADD int FIELD
EditAction 1444299667104 Cell.java 454 2 7 0
EditAction 1444299667181 Grid.java 271 2 1 0
CompilationAction 1444299667767 Grid.java
CompilationAction 1444299667768 TestCell.java
CompilationAction 1444299667768 TestCell.java
CompilationAction 1444299667768 TestCell.java
CompilationAction 1444299667768 TestCell.java
RefactoringAction 1444299835261 Grid.java ADD Cell Cell FIELD
RefactoringAction 1444299860907 Cell.java RENAME Cell(int, int)=>void cell(int, int) METHOD
RefactoringAction 1444299864407 Grid.java RENAME Cell=>Cell cell FIELD
RefactoringAction 1444300133760 Grid.java ADD void cell(int, int) METHOD
RefactoringAction 1444300140146 Grid.java REMOVE cell(int, int) METHOD
RefactoringAction 1444300213684 Grid.java RENAME cell=>Cell zelle FIELD
RefactoringAction 1444300341260 Cell.java ADD int getNeighbour() METHOD
RefactoringAction 1444300341260 Cell.java ADD void setNeighbour(int) METHOD
RefactoringAction 1444300341260 Cell.java ADD String getState() METHOD
RefactoringAction 1444300341260 Cell.java ADD void setState(String) METHOD
RefactoringAction 1444300548184 Cell.java REMOVE getNeighbours() METHOD
RefactoringAction 1444300619598 Grid.java ADD void neighboursett FIELD
RefactoringAction 1444300620605 Grid.java RENAME neighboursett=>void neighboursetting FIELD
RefactoringAction 1444300624112 Grid.java RENAME neighboursetting=>void neighboursetting() METHOD
RefactoringAction 1444300654146 Grid.java RENAME neighboursetting()=>void neighboursetting(int) METHOD
RefactoringAction 1444300655654 Grid.java RENAME neighboursetting(int)=>void neighboursetting(int, int) METHOD
EditAction 1444301270142 Cell.java 656 5 10 0
CompilationAction 1444301270403 TestCell.java
CompilationAction 1444301270403 TestCell.java
RefactoringAction 1444301655026 Grid.java RENAME zelle=>Cell cel FIELD
RefactoringAction 1444301656034 Grid.java RENAME cel=>Cell cell FIELD
EditAction 1444301666836 Grid.java 857 3 11 0
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
37 changes: 37 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Cell.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
package org.unioulu.tol.sqatlab.gameoflife;

import java.util.Random;

public class Cell {
public int x;
public int y;
public int neighbour;
public String state;

public int getNeighbour() {
return neighbour;
}

public void setNeighbour(int neighbour) {
this.neighbour = neighbour;
}

public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public void cell(int x, int y) {
this.x = x;
this.y = y;
neighbour = 0;
Random rand = new Random();
int randstate = rand.nextInt(1);
if (randstate == 0) {
state = "-";
}
else if (randstate == 1) {
state = "*";
}

}

}
44 changes: 44 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Grid.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
package org.unioulu.tol.sqatlab.gameoflife;

public class Grid {
Cell cell = new Cell();
public Cell[][] grid = new Cell[9][9];

public void start() {
for(int i = 0; i < grid.length; i++) {
for(int j = 0; j < grid.length; j++) {
cell.cell(i,j);
}
}
}

public void neighboursetting(int x, int y){
int temp = 0;
if (grid[x-1][y-1].getState() == "*") {
temp++;
}
if (grid[x][y-1].getState() == "*") {
temp++;
}
if (grid[x+1][y-1].getState() == "*") {
temp++;
}
if (grid[x-1][y].getState() == "*") {
temp++;
}
if (grid[x+1][y].getState() == "*") {
temp++;
}
if (grid[x-1][y+1].getState() == "*") {
temp++;
}
if (grid[x][y+1].getState() == "*") {
temp++;
}
if (grid[x+1][y+1].getState() == "*") {
temp++;
}
grid[x][y].setNeighbour(temp);


}

public void update() {

}
}
6 changes: 4 additions & 2 deletions src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import static org.junit.Assert.*;

import org.junit.Test;
import org.unioulu.tol.sqatlab.gameoflife.Cell;

public class TestCell {
Cell cell = new Cell();

@Test
public void test() {
fail("Not yet implemented");
public void testLiveCellWithNoNeighborDies() {

}

}
2 changes: 1 addition & 1 deletion src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class TestGrid {

@Test
public void test() {
fail("Not yet implemented");

}

}