We'll exchange important info over PGP.
I am using this browser-based tool:
http://ianpurton.com/online-pgp/
I generated new keys there. I recommend you do the same (don't use your normal keys on your machine).
package org.scalavienna.refactoringdojo.gameoflife | |
import org.scalatest.FunSuite | |
import org.scalatest.Matchers | |
import org.scalatest.exceptions.TestFailedException | |
import scala.Array.canBuildFrom | |
import scala.Array.fallbackCanBuildFrom | |
/** | |
* As a general rule, don't remove test-cases. You are free to add, though. |
We'll exchange important info over PGP.
I am using this browser-based tool:
http://ianpurton.com/online-pgp/
I generated new keys there. I recommend you do the same (don't use your normal keys on your machine).
object PositiveIntApp extends App { | |
// The class Option[T] allows us to eventually wrap around a value. | |
// Instances of Option[T] *could* have a value, or not. | |
// | |
// If they have a value, we are dealing with a Some[T], which is a | |
// subclass of Option[T]. | |
// | |
// If the don't have a value, we are dealing with a None, which is | |
// a special singleton instance of Option. |
package org.hyperscala.hello | |
import org.scalatest.WordSpec | |
import org.scalatest.Matchers | |
import org.scalatest.BeforeAndAfter | |
class HelloPageTest extends WordSpec with Matchers with BeforeAndAfter { | |
"HelloPage" when { | |
"when rendered" should { |
object CardQuestions { | |
case class Card(number: Int, color: String) | |
val cards = Seq( | |
Card(5, "red"), | |
Card(7, "red"), | |
Card(3, "black")) | |
// Do the cards all have the same color? |
case class GreetingEvent(msg: String) | |
class Greeter extends Publisher[GreetingEvent] { | |
def greet(msg:String) = { | |
println("Firing event") | |
publish(GreetingEvent(msg)) | |
} | |
} | |
class GreetingSubscriber(name: String) |
import org.scalatest.BeforeAndAfterAll | |
import org.openqa.selenium.WebDriver | |
import org.openqa.selenium.htmlunit.HtmlUnitDriver | |
import org.scalatest.FlatSpec | |
import play.api.test.TestServer | |
import org.scalatest.Matchers | |
import play.api.test.Helpers | |
import org.scalatest.selenium.WebBrowser | |
import play.api.test.FakeApplication |
import scala.collection.mutable.Buffer | |
val frames = Buffer[String]() | |
frames += """ | |
> _______ | |
> |/ | | |
> | | |
> | | |
> | |
package com.sebnozzi.katas.tictactoe | |
object TicTacToe { | |
sealed class Player | |
case object O extends Player | |
case object X extends Player | |
case class Board(state: State = State()) { |