use std::cli; use std::text; use vendor::tile_pyramid::tile_pyramid; fn main() { let arguments = cli_args(); if args_len(arguments) > 0 { if args_len(arguments) % 2 != 0 { stderr_line("Expected event and value pairs"); process_exit(2); } let mut live = tile_pyramid_start(); let mut i = 0; while i < args_len(arguments) { let input = args_at(arguments, i + 1); if !text_is_number(input) { stderr_line("Expected a whole numeric event value"); process_exit(2); } live = tile_pyramid_step(live, args_at(arguments, i), text_number(input)); let command = tile_pyramid_command(live); println!(command); if command == "reject" { process_exit(1); } i += 2; } return; } let mut state = tile_pyramid_start(); state = tile_pyramid_step(state, "seed", 2.0); println!(tile_pyramid_command(state)); state = tile_pyramid_step(state, "level", 1.0); println!(tile_pyramid_command(state)); state = tile_pyramid_step(state, "level", 2.0); println!(tile_pyramid_command(state)); state = tile_pyramid_step(state, "level", 1.0); println!(tile_pyramid_command(state)); state = tile_pyramid_step(state, "level", 0.0); println!(tile_pyramid_command(state)); state = tile_pyramid_step(state, "publish", 0.0); println!(tile_pyramid_command(state)); }