Commit 0d76760b authored by Adrian Kosmaczewski's avatar Adrian Kosmaczewski

Small corrections for readability

parent 4bf8467a
......@@ -10,9 +10,7 @@ let paddingLeft = (value: number, paddingValue: string): string => {
// Courtesy of
// https://stackoverflow.com/a/10050831/133764
let makeRange = (size: number): number[] => {
return Array.apply(null, Array(size)).map((_, i) => {
return i
})
return Array.apply(null, Array(size)).map((_, i) => { return i })
}
export class World {
......@@ -20,7 +18,7 @@ export class World {
constructor(public size: number, aliveCells: Array<Coord>) {
this.size = size
let aliveCellStrings : string[] = aliveCells.map(item => item.toString() )
let aliveCellStrings : string[] = aliveCells.map(item => item.toString())
let range = makeRange(size)
for (let a of range) {
for (let b of range) {
......@@ -87,8 +85,8 @@ export class World {
}
str += ` ${paddingLeft(a, " ")}|`
for (let b of range) {
let coord = `${b}:${a}`
let cell = this.cells.get(coord)
let coord = new Coord(b, a)
let cell = this.cells.get(coord.toString())
let cellDescription = cellToString(cell)
str += `${cellDescription}`
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment