aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/lib/o.js
blob: f6425cd0d58942ff5610009273ea3b123d1aceb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict'

const FnBase = require('./_base')

function FnO (pico, x, y) {
  FnBase.call(this, pico, x, y)

  this.name = 'odd'
  this.glyph = 'o'
  this.info = 'Adds 0 southward, transforms into Q on bang.'
  this.ports = [{ x: 0, y: 0, bang: true }, { x: 0, y: -1 }]

  this.operation = function () {
    if (this.bang()) {
      this.replace('q')
    }
    pico.add(this.x, this.y + 1, '0')
  }
}

module.exports = FnO