Skip to content

Commit

Permalink
Added perens to start methods as they side-effect
Browse files Browse the repository at this point in the history
  • Loading branch information
apeshimam committed Jul 18, 2011
1 parent 286d1cb commit 4dfb4ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/akka/tutorials/conway/Controller.scala
Expand Up @@ -13,8 +13,8 @@ object Controller extends App {

val initialStartState = Array.ofDim[Boolean](xSize, ySize)

val display = actorOf(new ASCIIDisplay).start
val controller = actorOf(new Controller(initialStartState, 5, display)).start
val display = actorOf(new ASCIIDisplay).start()
val controller = actorOf(new Controller(initialStartState, 5, display)).start()

controller ! ControllerInitialize
controller ! ControllerStart
Expand Down Expand Up @@ -56,7 +56,7 @@ class Controller(initialStartState:Array[Array[Boolean]], maxRounds:Int, display

for (x <- 0 until xSize){
for (y <- 0 until ySize){
cells(x)(y) = actorOf(new Cell(x,y,this.self, boardActor)).start
cells(x)(y) = actorOf(new Cell(x,y,this.self, boardActor)).start()
}
}
initializeCells()
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/DisplaySpec.scala
Expand Up @@ -20,7 +20,7 @@ class DisplaySpec extends WordSpec with BeforeAndAfterAll with ShouldMatchers wi

"An ASCIIDisplay " should {
" should print out a boardState " in {
val displayActor = actorOf(new ASCIIDisplay()).start
val displayActor = actorOf(new ASCIIDisplay()).start()
within (1000 millis) {
displayActor ! BoardState(0, boardState)
}
Expand Down

0 comments on commit 4dfb4ad

Please sign in to comment.