Bubble Sort in Batch!

by Qanmie in Circuits > Computers

740 Views, 0 Favorites, 0 Comments

Bubble Sort in Batch!

bubble.bmp

Ever wondered making a simple sorting algorithm in pure batch? Don't worry, it's simple as pie! This also shows the process of it sorting. (Note: I made this in a Windows XP computer so some code may not work. I'm not sure though. Sorry...)

Making the Batch File

bubble1.bmp

Copy the code inside the table and paste them in notepad.

@ECHO off

COLOR 0a
TITLE Bubble Sort

Here, you change change the color and title you prefer.

Don't change '@ECHO off' as this prevents cluttering to your program.

Making a Random Number Generator

bubble2.bmp

I made a random number generator to prove that this applies to all permutation of numbers!

Download the file and paste them in your current file. (Don't worry, this file is safe.)

Sorting Time!

bubble3.bmp

This is where things get sorted. This is the content of your program, and almost the entire of it!

Download the file and paste them in your current file. (Don't worry, this file is safe.)

Downloads

Choice!

bubble4.bmp

Copy the code inside the tables and paste them in notepad.

Basically, if you want to try again or to exit. Anyways, this is the end of the program! Just save as Bubble_Sort.bat and boom! Working bubble sort.

Download the file and paste them in your current file. (Don't worry, this file is safe.)

Downloads