Search in sources :

Example 1 with Opjects

use of nars.op.java.Opjects in project narchy by automenta.

the class Tetris method actionsReflect.

private void actionsReflect() {
    Opjects oo = new Opjects(nar);
    oo.exeThresh.set(0.6f);
    oo.methodExclusions.add("toVector");
    // state = new TetrisState(tetris_width, tetris_height, 2);
    state = // oo.the("tetris", this.state);
    oo.a("tetris", TetrisState.class, tetris_width, tetris_height, 2);
}
Also used : Opjects(nars.op.java.Opjects) TetrisState(nars.experiment.Tetris.TetrisState)

Example 2 with Opjects

use of nars.op.java.Opjects in project narchy by automenta.

the class ConnectFour method main.

public static void main(String[] args) {
    NAR n = NARS.tmp();
    n.log();
    Opjects o = new Opjects(n);
    ConnectFourState game = o.a("c", ConnectFourState.class);
    JFrame frame = constructApplicationFrame(game);
    frame.setSize(450, 450);
    frame.setVisible(true);
    while (true) {
        switch(game.moving()) {
            case 1:
                game.drop(n.random().nextInt(game.cols));
                break;
            case 2:
                game.drop(n.random().nextInt(game.cols));
                break;
        }
        frame.repaint();
        n.run(1);
        Util.sleep(25);
        if (game.isTerminal())
            game.clear();
    }
}
Also used : Opjects(nars.op.java.Opjects) NAR(nars.NAR)

Aggregations

Opjects (nars.op.java.Opjects)2 NAR (nars.NAR)1 TetrisState (nars.experiment.Tetris.TetrisState)1