EN605.607.81.SP22_ASDM_Project/front_end/src/main.rs
Stephen Seo 9e9bb0758c Fix rand not compilable for wasm, impl game logic
"rand" crate was not compilable for wasm-unknown-unknown target, so an
alternative "oorandom" crate was substituted in.

Basic game win/draw detection logic added.
2022-03-09 16:26:14 +09:00

29 lines
570 B
Rust

mod ai;
mod constants;
mod game_logic;
mod random_helper;
mod state;
mod yew_components;
use state::SharedState;
use yew::prelude::*;
use yew_components::Wrapper;
#[function_component(App)]
pub fn app() -> Html {
let ctx = use_state(SharedState::default);
html! {
<ContextProvider<SharedState> context={(*ctx).clone()}>
<Wrapper />
</ContextProvider<SharedState>>
}
}
fn main() {
// setup logging to browser console
wasm_logger::init(wasm_logger::Config::default());
// start webapp
yew::start_app::<App>();
}