Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasschreiber committed Oct 24, 2020
1 parent d6f7c76 commit 4a3dd39
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion SortVisualizer/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace SortVisualizer
{
class Data
{
public static string[] SortModes = { "Shaker [0]", "Selection [1]", "Bubble [2]", "Quick [3]", "Insertion [4]", "Bogo [5]", "Merge [6]", "Radix [7]", "Shell [8]", "Gravity [9]" };
public static string[] SortModes = { "Shaker [0]", "Selection [1]", "Bubble [2]", "Quick [3]", "Insertion [4]", "Bogo [5]" };
}
}
28 changes: 19 additions & 9 deletions SortVisualizer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,22 @@ static void Main(string[] args)
Application.EnableVisualStyles();
//Console.SetWindowSize((int)Math.Round(Console.WindowWidth*1.5f), Console.WindowHeight);

//Select Size
loop();

Console.WriteLine("Start again? [Y/N]");
if (Console.ReadLine().ToLower().Equals("y"))
{
loop();
}else{

//End
Essentials.Finalize();
}

}

static void loop(){
//Select Size
Console.WriteLine("Choose Array Size: [Integer]");

Console.ForegroundColor = ConsoleColor.Green;
Expand Down Expand Up @@ -63,8 +78,6 @@ static void Main(string[] args)
break;
case 5: Sorter.BogoSort(dataSet);
break;
case 6: Sorter.MergeSort(dataSet.ToArray());
break;
default:Essentials.Error();
break;
}
Expand All @@ -81,12 +94,9 @@ static void Main(string[] args)
}
}


//End
Essentials.Finalize();

}

}

}


}
2 changes: 1 addition & 1 deletion SortVisualizer/Visualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private void background_Paint(object sender, PaintEventArgs e)

//Render Text

string s = "Method: " + algorithmData.Name + " " + "Array Accesses: " + algorithmData.Access + " " + "Comparisons: " + algorithmData.Compare + " " + "Wait Time: " + timeout + "ms" + " " + "Real Time: " + RealTimeElapsedMillies() + "ms";
string s = "Method: " + algorithmData.Name + " " + "Array Accesses: " + algorithmData.Access + " " + "Comparisons: " + algorithmData.Compare;

g.DrawString(s, new Font(FontFamily.GenericMonospace,9), new SolidBrush(Color.White), 5,5);

Expand Down

0 comments on commit 4a3dd39

Please sign in to comment.