aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/core/lib/g.js
blob: 66acdc97defadf2389650c113e251ce7351fff87 (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 FnG (pico, x, y) {
  FnBase.call(this, pico, x, y)

  this.name = 'generator'
  this.glyph = 'g'
  this.info = 'Generates a direction fn from bang.'

  this.ports = [{ x: 0, y: 1, output: true }, { x: 0, y: 0, bang: true }]

  this.operation = function () {
    if (!this.bang()) { return }

    pico.add(this.x, this.y + 1, 's')
  }
}

module.exports = FnG