Fix type register visibility. Add a few more examples
This commit is contained in:
10
examples/hello.rs
Normal file
10
examples/hello.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
extern crate rhai;
|
||||
use rhai::Engine;
|
||||
|
||||
fn main() {
|
||||
let mut engine = Engine::new();
|
||||
|
||||
if let Ok(result) = engine.eval("40 + 2".to_string()).unwrap().downcast::<i32>() {
|
||||
println!("Answer: {}", *result); // prints 42
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user