Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib:simulations:quick_sort:Quick sort implemented #172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/simulations/QuickSortDark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/simulations/QuickSortLight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 38 additions & 26 deletions lib/src/data/simulations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:simulate/src/simulations/lissajous_curve.dart';
import 'package:simulate/src/simulations/epicycloid_curve.dart';
import 'package:simulate/src/simulations/maurer_rose.dart';
import 'package:simulate/src/simulations/quick_sort.dart';

class Simulations with ChangeNotifier {
static var _favorites = [-1, -1, -1, -1, -1, -1, -1, -1, -1];
final _algorithm = [0, 1, 2];
final _mathematics = [3, 4, 5, 6, 7, 8];
static var _favorites = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
final _algorithm = [0, 1, 2, 3];
final _mathematics = [3, 4, 5, 6, 7, 8, 9];
final _physics = [];
final _chemistry = [];
var prefs;
final _searchTags = {
0: "toothpick pattern algorithm sequence ",
1: "bubble sort algorithm sorting bars ",
2: "insertion sort algorithm sorting bars ",
3: "rose pattern mathematics sequence ",
4: "fourier series mathematics ",
5: "lissajous curve pattern mathematics animation ",
6: "epicycloid curve pattern mathematics animation pencil lines ",
7: "epicycloid curve pattern mathematics animation ",
8: "maurer rose pattern mathematics animation",
1: "quick sort algorithm sorting bars ",
2: "bubble sort algorithm sorting bars ",
3: "insertion sort algorithm sorting bars ",
4: "rose pattern mathematics sequence ",
5: "fourier series mathematics ",
6: "lissajous curve pattern mathematics animation ",
7: "epicycloid curve pattern mathematics animation pencil lines ",
8: "epicycloid curve pattern mathematics animation ",
9: "maurer rose pattern mathematics animation",
};

Simulations() {
Expand Down Expand Up @@ -63,83 +65,93 @@ class Simulations with ChangeNotifier {
),
SimulationCard(
id: 1,
simulationName: 'Quick Sort (Bars)',
image: theme.darkTheme
? 'assets/simulations/QuickSortDark.png'
: 'assets/simulations/QuickSortLight.png',
direct: QuicksortBars(),
infoLink: 'https://en.wikipedia.org/wiki/Quicksort',
fav: _favorites[1],
),
SimulationCard(
id: 2,
simulationName: 'Bubble Sort (Bars)',
image: theme.darkTheme
? 'assets/simulations/BubbleSortDark.png'
: 'assets/simulations/BubbleSortLight.png',
direct: BubbleSortBars(),
infoLink: 'https://en.wikipedia.org/wiki/Bubble_sort',
fav: _favorites[1],
fav: _favorites[2],
),
SimulationCard(
id: 2,
id: 3,
simulationName: 'Insertion Sort',
image: theme.darkTheme
? 'assets/simulations/InsertionSortDark.png'
: 'assets/simulations/InsertionSortLight.png',
direct: InsertionHome(),
infoLink: 'https://en.wikipedia.org/wiki/Insertion_sort',
fav: _favorites[2],
fav: _favorites[3],
),
SimulationCard(
id: 3,
id: 4,
simulationName: 'Rose Pattern',
image: theme.darkTheme
? 'assets/simulations/RosePatternDark.png'
: 'assets/simulations/RosePatternLight.png',
direct: RosePattern(),
infoLink: 'https://en.wikipedia.org/wiki/Rose_(mathematics)',
fav: _favorites[3],
fav: _favorites[4],
),
SimulationCard(
id: 4,
id: 5,
simulationName: 'Fourier Series',
image: theme.darkTheme
? 'assets/simulations/FourierSeriesDark.png'
: 'assets/simulations/FourierSeriesLight.png',
direct: FourierSeries(),
infoLink: 'https://en.wikipedia.org/wiki/Fourier_series',
fav: _favorites[4],
fav: _favorites[5],
),
SimulationCard(
id: 5,
id: 6,
simulationName: 'Lissajous Pattern',
image: theme.darkTheme
? 'assets/simulations/LissajousCurveDark.png'
: 'assets/simulations/LissajousCurveLight.png',
direct: LissajousCurve(),
infoLink: 'https://en.wikipedia.org/wiki/Lissajous_curve',
fav: _favorites[5],
fav: _favorites[6],
),
SimulationCard(
id: 6,
id: 7,
simulationName: 'Epicycloid Pattern (Pencil of Lines)',
image: theme.darkTheme
? 'assets/simulations/Epicycloid1Dark.png'
: 'assets/simulations/Epicycloid1Light.png',
direct: EpicycloidCurve(),
infoLink: 'https://en.wikipedia.org/wiki/Epicycloid',
fav: _favorites[6],
fav: _favorites[7],
),
SimulationCard(
id: 7,
id: 8,
simulationName: 'Epicycloid Curve',
image: theme.darkTheme
? 'assets/simulations/EpicycloidDark.png'
: 'assets/simulations/Epicycloid.png',
direct: NormalEpicycloidCurve(),
infoLink: 'https://en.wikipedia.org/wiki/Epicycloid',
fav: _favorites[7],
fav: _favorites[8],
),
SimulationCard(
id: 8,
id: 9,
simulationName: 'Maurer Rose Pattern',
image: theme.darkTheme
? 'assets/simulations/MaurerRoseDark.png'
: 'assets/simulations/MaurerRoseLight.png',
direct: MaurerRoseCurve(),
infoLink: 'https://en.wikipedia.org/wiki/Maurer_rose',
fav: _favorites[8],
fav: _favorites[9],
),
];
}
Expand Down
Loading