Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3a9fcd6
besouro automatic message
Oct 8, 2015
e9c1c41
besouro automatic message
Oct 8, 2015
ae9751e
besouro automatic message
Oct 8, 2015
f7f8c93
besouro automatic message
Oct 8, 2015
4ada5bd
besouro automatic message
Oct 8, 2015
dc24d3f
besouro automatic message
Oct 8, 2015
07c349b
besouro automatic message
Oct 8, 2015
1c3ef58
besouro automatic message
Oct 8, 2015
e98d7e9
besouro automatic message
Oct 8, 2015
e20262e
besouro automatic message
Oct 8, 2015
3fa4600
besouro automatic message
Oct 8, 2015
9602dc8
besouro automatic message
Oct 8, 2015
ce688e4
besouro automatic message
Oct 8, 2015
2a2a6ff
besouro automatic message
Oct 8, 2015
af20ada
besouro automatic message
Oct 8, 2015
803dc82
besouro automatic message
Oct 8, 2015
32e236a
besouro automatic message
Oct 8, 2015
c002887
besouro automatic message
Oct 8, 2015
adf3350
besouro automatic message
Oct 8, 2015
95b5644
besouro automatic message
Oct 8, 2015
2856b5d
besouro automatic message
Oct 8, 2015
ac94834
besouro automatic message
Oct 8, 2015
a785f8b
besouro automatic message
Oct 8, 2015
e32e1ad
besouro automatic message
Oct 8, 2015
c93384d
besouro automatic message
Oct 8, 2015
72a3cbc
besouro automatic message
Oct 8, 2015
8d61162
besouro automatic message
Oct 8, 2015
0903fe2
besouro automatic message
Oct 8, 2015
89ee2a7
besouro automatic message
Oct 8, 2015
dbc24ef
besouro automatic message
Oct 8, 2015
1a37ce5
besouro automatic message
Oct 8, 2015
7408fa3
besouro automatic message
Oct 8, 2015
298d4a6
besouro automatic message
Oct 8, 2015
86fee98
besouro automatic message
Oct 8, 2015
cd5795d
besouro automatic message
Oct 8, 2015
7b7bed2
besouro automatic message
Oct 8, 2015
bb14dcf
besouro automatic message
Oct 8, 2015
d87f939
besouro automatic message
Oct 8, 2015
e302961
besouro automatic message
Oct 8, 2015
33e9f43
besouro automatic message
Oct 8, 2015
e17c3f7
besouro automatic message
Oct 8, 2015
3c9828e
besouro automatic message
Oct 8, 2015
793720a
besouro automatic message
Oct 8, 2015
4f8bdae
besouro automatic message
Oct 8, 2015
c5edc8b
besouro automatic message
Oct 8, 2015
b725fb3
besouro automatic message
Oct 8, 2015
69b1721
besouro automatic message
Oct 8, 2015
d5d1794
besouro automatic message
Oct 8, 2015
7cba0f6
besouro automatic message
Oct 8, 2015
9448db4
besouro automatic message
Oct 8, 2015
d7e9231
besouro automatic message
Oct 8, 2015
37430f3
besouro automatic message
Oct 8, 2015
40ca66d
besouro automatic message
Oct 8, 2015
30c4b7a
besouro automatic message
Oct 8, 2015
960a252
besouro automatic message
Oct 8, 2015
24d47bc
besouro automatic message
Oct 8, 2015
c9aaabb
besouro automatic message
Oct 8, 2015
a72725c
besouro automatic message
Oct 8, 2015
560cb78
besouro automatic message
Oct 8, 2015
7b41090
besouro automatic message
Oct 8, 2015
880965f
besouro automatic message
Oct 8, 2015
3e87e65
besouro automatic message
Oct 8, 2015
2ae53b7
besouro automatic message
Oct 8, 2015
bec17e4
besouro automatic message
Oct 8, 2015
00f6922
besouro automatic message
Oct 8, 2015
04d8477
besouro automatic message
Oct 8, 2015
5f0595f
besouro automatic message
Oct 8, 2015
8386e93
besouro automatic message
Oct 8, 2015
aa97316
besouro automatic message
Oct 8, 2015
526ff7f
besouro automatic message
Oct 8, 2015
94dc6db
besouro automatic message
Oct 8, 2015
4df4290
besouro automatic message
Oct 8, 2015
5a11ab6
besouro automatic message
Oct 8, 2015
3766948
besouro automatic message
Oct 8, 2015
d680624
besouro automatic message
Oct 8, 2015
a2dab34
besouro automatic message
Oct 8, 2015
60df260
besouro automatic message
Oct 8, 2015
7e816af
besouro automatic message
Oct 8, 2015
9da666f
Random actions
Elvars Oct 8, 2015
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
322 changes: 322 additions & 0 deletions .besouro/20151008121703649/actions.txt

Large diffs are not rendered by default.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
32 changes: 32 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Cell.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,36 @@

public class Cell {

public String state;


public Cell()
{
this.setState("Alive");
}

public String getState()
{
return state;
}

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



public void update(int aliveSurroundingCells)
{
if(aliveSurroundingCells<2)
{
state = "Dead";
}

if(aliveSurroundingCells>=2)
{
state = "Alive";
}
}
}
10 changes: 9 additions & 1 deletion src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package org.unioulu.tol.sqatlab.gameoflife;

public class GameOfLife {


public static Grid grid;

public static void main(String [] args)
{
grid = new Grid();
grid.createGrid(5);
}

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

import java.util.ArrayList;


public class Grid {

public Cell[] cellArray;
public ArrayList<Cell[]> allCells = new ArrayList<Cell[]>();


public int createGrid(int rowColumnAmount)
{
for(int i = 0; i<rowColumnAmount; i++)
{
cellArray = new Cell[rowColumnAmount];
allCells.add(cellArray);
}

return allCells.size();
}

}
32 changes: 29 additions & 3 deletions src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,39 @@

import static org.junit.Assert.*;

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

public class TestCell {


Cell cell;

@Before
public void init()
{
cell = new Cell();
}

@Test
public void test() {
fail("Not yet implemented");
public void getStateOfCell()
{
String actual = cell.getState();

assertEquals("Alive", actual);
}

@Test
public void testLiveCellWithNoNeighborDies()
{
cell.update(0);
assertEquals("Dead", cell.getState());
}

@Test
public void testLiveCellWithTwoNeighborLives()
{
cell.update(2);
assertEquals("Alive", cell.getState());
}
}
37 changes: 35 additions & 2 deletions src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
package org.unioulu.tol.sqatlab.gameoflife.test;

import static org.junit.Assert.*;

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

public class TestGrid {

Grid grid;


@Before
public void init()
{
grid = new Grid();
}


@Test
public void testCreateGrid()
{

int actual = grid.createGrid(5);

assertEquals(5, actual);

}

@Test
public void test() {
fail("Not yet implemented");
public void testGetStatusOfCell()
{
grid.createGrid(10);

String actual;
System.out.println("Ayy");
//actual = grid.allCells.get(0)[0].getState();

//actual = grid.allCells.get(0)[0].getState();

//assertEquals("Alive", actual);
}

}