



I created a game with four players (all AIs). The nexus has no exits, so there are random jumps out. They are using pretty much the same strategy - find good hexes and ramp them as quickly as possible.
Have a seat in the comfy chair. Or log into the supercomputing cluster and check your 'weezy-mail'.
fn main() { let x = { 2 + 2 }; let y = { 2 + 2; }; println!("Hello, world! {:?} {:?}", x, y); } % cargo build % ./target/debug/hello_world Hello, world! 4 ()Now, what happened here? Semicolon is a statement separator, so "2+2;" means "two plus two, and null statement". The last statement in a block is the return value, so y gets the null type (called the unit type in Rust, it always has the null value - "()").
fn main() { let x = { 2 + 2 }; let y: i32 = { 2 + 2; }; println!("Hello, world! {:?} {:?}", x, y); }Now we get a compiler error, and a nice one:
% cargo build Compiling hello_world v0.1.0 (file:///usr/local/ned/dev/gitned/rust/hello_world) error[E0308]: mismatched types --> src/main.rs:3:16 | 3 | let y: i32 = { 2 + 2; }; | ^^^^^^^-^^ | | | | | help: consider removing this semicolon | expected i32, found () | = note: expected type `i32` found type `()` error: aborting due to previous error error: Could not compile `hello_world`. To learn more, run the command again with --verbose.