use vt; use math::random; use time; use fmt; use os; type entity = struct { x: uint, y: uint, letter: rune, color: u8, }; fn entity_draw(ent: *entity, term: *vt::term) void = { vt::move(term, ent.y+1, ent.x+1)!; fmt::fprintf(os::stdout_file,"\x1b[3{}m{}",ent.color,ent.letter)!; }; fn entity_tick(ent: *entity, room: *room) void = { ent.x += 1; if (ent.x >= 13) ent.x = 1; ent.y += 1; if (ent.y >= 11) ent.y = 1; }; fn entity_new(r: rune, col: u8) entity = entity { x = 1, y = 1, letter = r, color = col, };