summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: a6737536d61fdcf80caeada796df63a24b1bea97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
mod doublebuffer;
mod nn;
mod trainer;
mod game;
mod gui;

fn main() {
    /*let (cols, rows) = (36, 12);
    let mut game = JumpGame::new(cols, rows);
    println!("\x1b[1;1H\x1b[2J");

    while let Some(status) = game.update() {
        /*print!("\x1b[1;1H");
        for row in 0..rows {
            for col in 0..cols {
                print!("{}", status.fields[((rows - row - 1) + col * rows) as usize].repr());
            }
            println!("");
        }
        std::thread::sleep_ms(80);*/
    }*/

    /*let (cols, rows) = (18, 16);
    let game = game::JumpGame::new(cols, rows, 3);
    gui::Gui::new()
        .run(game);
    return;*/
    /*let mut n = nn::Nn::new_by_game_res(cols, rows);
    let points = n.execute(game);
    println!("{}", points);*/
    /*let mut n = nn::Nn::new_by_game_res(cols, rows, &nn::Nn::new_random);
    let game = n.execute_logged(game);
    gui::Gui::new()
        .run(game);*/

    trainer::train();
    //gui::Gui::run(game::JumpGame::new(18, 16, 4)).join().unwrap()
}