game/game.rs
1/*
2 * This project is licensed under the MIT license.
3 * See the LICENSE file in the project root for more information.
4 */
5extern crate act2;
6
7use act2::load_game;
8use std::env;
9use std::fs::File;
10use std::io::prelude::*;
11
12fn main() {
13 let mut json_file = File::open(env::args().nth(1).expect("Usage: act <file>"))
14 .expect("Couldn't open game file!");
15 let mut json_string = String::new();
16 json_file.read_to_string(&mut json_string).unwrap();
17 let mut game = load_game(&json_string).unwrap();
18 game.play();
19}