I hereby claim:
- I am emotecontrol on github.
- I am robertdecaire (https://keybase.io/robertdecaire) on keybase.
- I have a public key whose fingerprint is 0111 0BF6 81DD 2278 BF23 AC55 EE56 C23B 9BC6 6AC9
To claim this, I am signing this object:
/* Game of Life */ | |
var running = false; | |
var numrows = 30; | |
var numcols = 50; | |
var initialized = false; | |
var board = new Array(); | |
var timer; | |
var mousepress = false; | |
var paintcolour = "black"; |
/* Game of Life */ | |
var running = false; | |
var numrows = 40; | |
var numcols = 60; | |
var initialized = false; | |
var board = new Array(); | |
var timer; | |
var mousepress = false; | |
var paintcolour = "black"; |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
val list = List.apply(1) | |
// list: List[Int] = List(1) | |
val list2 = List(1) | |
// list2: List[Int] = List(1) | |
def makeListofDoubles(int: Int): List[Double] = { | |
List(int.toDouble) | |
} |
val list = List(1,2) | |
val mappedList = list.map(makeListOfDoubles) | |
// mappedList: List[List[Double]] = List(List(1.0), List(2.0)) |
// given some function 'combine' that can take three values and combine them into one: | |
def combine(a: A, b: A, c: A): A | |
// this for-comprehension | |
for { | |
a <- m1 | |
b <- m2 | |
c <- m3 | |
} yield combine(a,b,c) |
val op = Option("hello") | |
// op: Option[String] = Some(hello) | |
val some = Some("hello") | |
// some: Some[String] = Some(hello) | |
val none = None | |
// none: None.type = None |
val o1 = Some("hello") | |
val o2 = Some("world") | |
val o3 = o1.flatMap(a => o2.map(b => a + " " + b)) | |
// o3: Option[String] = Some(hello world) |
val o1 = Some("hello") | |
val o2 = None | |
val o3 = o1.flatMap(a => o2.map(b => a + " " + b)) | |
// o3: Option[String] = None |