This commit is contained in:
Rolf Martin Glomsrud 2022-11-07 23:22:40 +01:00
parent 0e5ab853a6
commit d529a1c184
2 changed files with 0 additions and 25 deletions

View file

@ -19,21 +19,6 @@ pub enum AlgoEnum{
impl Algorithm{ impl Algorithm{
pub fn start(length:i32, algorithm:u32) -> impl Generator<Yield=GuiVec, Return=()>{
move ||{
let mut generator = Algorithm::insertSort(length);
match Pin::new(&mut generator).resume(()) {
GeneratorState::Yielded(x) => {
yield x
},
GeneratorState::Complete(x) => {
}
}
}
}
pub fn insertSort(length:i32) -> impl Generator<Yield=GuiVec, Return=()>{ pub fn insertSort(length:i32) -> impl Generator<Yield=GuiVec, Return=()>{
let mut list = GuiVec::new(screen_width(), screen_height(), length); let mut list = GuiVec::new(screen_width(), screen_height(), length);
list.randomize(); list.randomize();

View file

@ -18,18 +18,8 @@ use crate::Algorithm::AlgoEnum;
#[macroquad::main("BeepSort")] #[macroquad::main("BeepSort")]
async fn main() { async fn main() {
let mut finished = false;
let mut length = 100; let mut length = 100;
loop{ loop{
clear_background(WHITE); clear_background(WHITE);
if root_ui().button(Vec2::new(screen_width()*0.2, 50.), "Increase"){ if root_ui().button(Vec2::new(screen_width()*0.2, 50.), "Increase"){