one ant is lazy

This commit is contained in:
lemon-cat committed 2026-05-30 15:54:36 +03:00
1 parent 021d91d1ea
commit b565771db2
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ impl Render {
} }
pub fn frame(&mut self, grid: &TorusGrid<bool>, a_grid: &TorusGrid<Option<usize>>) { pub fn frame(&mut self, grid: &TorusGrid<bool>, a_grid: &TorusGrid<Option<usize>>) {
let mut out = self.out.lock(); let mut out = self.out.lock();
_ = queue!(out, MoveTo(0, 0)); _ = queue!(out, Clear(ClearType::All), MoveTo(0, 0));
for i in 0..self.rez.0 { for i in 0..self.rez.0 {
for j in 0..self.rez.1 { for j in 0..self.rez.1 {
let ca: Color; let ca: Color;
+3
View File
@@ -24,6 +24,7 @@ fn main() {
let rez: (usize, usize) = (100, 100); let rez: (usize, usize) = (100, 100);
let mut w = world::World::new(rez); let mut w = world::World::new(rez);
/*
for i in 0..rez.0 { for i in 0..rez.0 {
for j in 0..rez.1 { for j in 0..rez.1 {
if let Some(a) = w.get_mut_grid().get_mut((i as i32, j as i32)) { if let Some(a) = w.get_mut_grid().get_mut((i as i32, j as i32)) {
@@ -31,6 +32,7 @@ fn main() {
} }
} }
} }
*/
for mut i in 0..20 { for mut i in 0..20 {
let x = rnd.gen_range(0..=rez.0) as i32; let x = rnd.gen_range(0..=rez.0) as i32;
@@ -45,6 +47,7 @@ fn main() {
loop { loop {
//R.clear(); //R.clear();
R.frame(w.get_grid(), w.get_a_grid()); R.frame(w.get_grid(), w.get_a_grid());
R.print(&w.debug());
match it { match it {
InputType::comand => { InputType::comand => {
R.print("Input your comand: "); R.print("Input your comand: ");