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
70 changes: 70 additions & 0 deletions .besouro/20151008123919173/actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FileOpenedAction 1444297159625 Cell.java 68 1 3 0
EditAction 1444297185630 TestCell.java 399 1 0 0
EditAction 1444297185771 Cell.java 236 1 3 0
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
CompilationAction 1444297187050 TestCell.java
RefactoringAction 1444297304003 Cell.java RENAME Cell(int, int)=>Cell(int, int, int) METHOD
RefactoringAction 1444298116397 Cell.java RENAME collum=>int x FIELD
RefactoringAction 1444298120516 Cell.java RENAME row=>int y FIELD
RefactoringAction 1444298126210 Cell.java RENAME Cell(int, int, int)=>Cell() METHOD
RefactoringAction 1444298127239 Cell.java RENAME Cell()=>Cell(int, int, int) METHOD
RefactoringAction 1444298133417 Cell.java RENAME Cell(int, int, int)=>Cell(int) METHOD
RefactoringAction 1444298134961 Cell.java RENAME Cell(int)=>Cell(int, int, int) METHOD
RefactoringAction 1444298142683 Cell.java RENAME Cell(int, int, int)=>Cell(int, int) METHOD
RefactoringAction 1444298529938 Cell.java ADD import java.util.Random IMPORT
RefactoringAction 1444299031841 Grid.java ADD int FIELD
RefactoringAction 1444299193839 Grid.java REMOVE grid FIELD
RefactoringAction 1444299261793 Grid.java ADD int FIELD
RefactoringAction 1444299263852 Grid.java REMOVE grid FIELD
RefactoringAction 1444299265911 Grid.java ADD int FIELD
RefactoringAction 1444299427216 Grid.java ADD void start FIELD
RefactoringAction 1444299428245 Grid.java RENAME start=>void start() METHOD
RefactoringAction 1444299581297 Cell.java ADD String state FIELD
EditAction 1444299642106 TestGrid.java 172 1 1 0
EditAction 1444299642184 Grid.java 296 1 1 0
CompilationAction 1444299642387 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
CompilationAction 1444299642403 TestCell.java
RefactoringAction 1444299781586 Grid.java ADD import org.univoulu.tol.sqatlab.sudoku.SudokuVerifier IMPORT
RefactoringAction 1444299800634 Grid.java RENAME sudoku=>Cell su FIELD
RefactoringAction 1444299801663 Grid.java RENAME su=>Cell s FIELD
RefactoringAction 1444299803208 Grid.java REMOVE s FIELD
RefactoringAction 1444299804237 Grid.java ADD Cell cell FIELD
RefactoringAction 1444299836810 Cell.java RENAME Cell(int, int)=>void ell(int, int) METHOD
RefactoringAction 1444299837840 Cell.java RENAME ell(int, int)=>void cell(int, int) METHOD
RefactoringAction 1444299893953 Grid.java ADD import org.tol.sqatlab.sudoku.SudokuVerifier IMPORT
RefactoringAction 1444299897557 Grid.java RENAME import org.tol.sqatlab.sudoku.SudokuVerifier=>import org.univoulu.tol.sqatlab.sudoku.SudokuVerifier IMPORT
RefactoringAction 1444300155472 Grid.java RENAME cell=>Cell zelle FIELD
RefactoringAction 1444300269758 Cell.java ADD int getNeighbour() METHOD
RefactoringAction 1444300269758 Cell.java ADD void setNeighbour(int) METHOD
RefactoringAction 1444300269758 Cell.java ADD String getState() METHOD
RefactoringAction 1444300269758 Cell.java ADD void setState(String) METHOD
EditAction 1444300380159 Grid.java 403 1 1 0
EditAction 1444300380237 Cell.java 713 5 10 0
CompilationAction 1444300380424 Grid.java
CompilationAction 1444300380424 TestCell.java
CompilationAction 1444300380424 TestCell.java
CompilationAction 1444300380424 TestCell.java
CompilationAction 1444300380424 TestCell.java
CompilationAction 1444300380424 TestCell.java
CompilationAction 1444300380424 TestCell.java
RefactoringAction 1444300435102 Grid.java ADD import org.univoulu.tol.sqatlab.sudoku.SudokuVerifier IMPORT
RefactoringAction 1444300850849 Grid.java ADD void neighbours FIELD
RefactoringAction 1444300853423 Grid.java RENAME neighbours=>void neighbourssetti FIELD
RefactoringAction 1444300854967 Grid.java RENAME neighbourssetti=>void neighbourssetting FIELD
RefactoringAction 1444300859600 Grid.java RENAME neighbourssetting=>void neighboursetting FIELD
RefactoringAction 1444300869897 Grid.java RENAME neighboursetting=><initializer /1> null
RefactoringAction 1444300870926 Grid.java RENAME neighboursetting(int)=>void neighboursetting(int, int) METHOD
CompilationAction 1444301174128 Grid.java
EditAction 1444301178715 Cell.java 713 5 10 0
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
38 changes: 38 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Cell.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
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 = "*";
}
}



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

import org.univoulu.tol.sqatlab.sudoku.SudokuVerifier;

public class Grid {
Cell zelle =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++) {
zelle.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);

}

}

9 changes: 8 additions & 1 deletion src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
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() {
public void testLiveCellsWithNoNeighboursDies() {
Cell cell= new Cell("Alive");
cell.update(0);
assertEquals.("Dead", cell.getState())


fail("Not yet implemented");
}

Expand Down
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");
;
}

}