A simple actor-based simulation of tag, implemented in rust.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
385 B

3 years ago
3 years ago
  1. use gntag::agent::{Agent, Position, SimpleAgent};
  2. use gntag::world::ActualWorld;
  3. fn main() {
  4. let mut agents: Vec<(_, Box<dyn Agent>)> = vec![];
  5. for x in 0..5 {
  6. for y in 0..5 {
  7. agents.push(((x, y).into(), Box::new(SimpleAgent)));
  8. }
  9. }
  10. let mut world = ActualWorld::new((80, 40).into(), agents);
  11. loop {
  12. world.do_step();
  13. println!("{}", world.tagged);
  14. }
  15. }