diff --git a/src/components/Canvas.vue b/src/components/Canvas.vue index dc68614..a0153de 100644 --- a/src/components/Canvas.vue +++ b/src/components/Canvas.vue @@ -28,7 +28,8 @@ export default { canvasWidth: 'getCanvasWidth', canvasHeight: 'getCanvasHeight', refreshRate: 'getRefreshRate', - initial1dState: 'getInitial1dState' + initial1dState: 'getInitial1dState', + drawingDirection: 'getDrawingDirection' }), boardWidth: function() { return Math.floor( @@ -61,7 +62,10 @@ export default { if (cell === 1) return props.liveColor return props.deadColor })() - this.ctx.fillRect(x * d, y * d, d, d) + if (this.drawingDirection === "x") + this.ctx.fillRect(y * d, x * d, d, d) + else + this.ctx.fillRect(x * d, y * d, d, d) return cell }, ) @@ -77,7 +81,7 @@ export default { const board = createBoard( initialState, this.rules, - this.boardHeight + this.boardWidth ) this.drawCanvas(board) }, diff --git a/src/components/MenuElementaryCA.vue b/src/components/MenuElementaryCA.vue index 1e186d7..37656d1 100644 --- a/src/components/MenuElementaryCA.vue +++ b/src/components/MenuElementaryCA.vue @@ -94,7 +94,8 @@ export default { "rule 86" : {"100":1,"101":0,"110":0,"111":1,"011":0,"010":1,"001":0,"000":1}, "rule 90" : {"100":1,"101":0,"110":1,"111":0,"011":0,"010":0,"001":1,"000":0}, "rule 45?" : {"100":0,"101":0,"110":1,"111":0,"011":1,"010":0,"001":1,"000":1}, - "rule 54?" : {"100":1,"101":0,"110":1,"111":1,"011":0,"010":1,"001":1,"000":0} + "rule 54?" : {"100":1,"101":0,"110":1,"111":1,"011":0,"010":1,"001":1,"000":0}, + "unknown rule" : {"100":0,"101":0,"110":0,"111":1,"011":0,"010":0,"001":1,"000":1} }, initial1dStates: [ { id : "onecell", diff --git a/src/components/MenuGeneralOptions.vue b/src/components/MenuGeneralOptions.vue index fb858e6..c51dd89 100644 --- a/src/components/MenuGeneralOptions.vue +++ b/src/components/MenuGeneralOptions.vue @@ -40,6 +40,16 @@ @input="updateRefreshRate" > +