aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/sources/scripts/programs/q.js
blob: 5863fdeb53a50a35cbce6d4fe0cbcecd57ae3c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict'

function program_Q (x, y) {
  Program_Default.call(this, x, y)

  this.name = 'even'
  this.glyph = 'q'
  this.ports = [{ x: 0, y: 0, bang: true }, { x: 0, y: 1, output: true }]

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

    this.replace('o')
    this.lock()
    pico.program.add(this.x, this.y + 1, 'b')
    pico.program.lock(this.x, this.y + 1)
  }
}