CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 19:48:33 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=2822aa88c61aa0317ec747797edc44a93d3f1279460795838ea7561c7ae5c1e6a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22BedVt-ph5kRGa6pFl5Z0P7KpC8FviNWU%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d0e0296b1658e1-BLR
Bubble Sort - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Smallest to Biggest
- '==============
- TextWindow.Title= "Biggest & Smallest Outta a set of Numbers
- ESC= Text.GetCharacter(27) ' ASCII code for "Esc" key
- LF= Text.GetCharacter(10) ' Jumps 1 line (Line Feed)
- 'Section 1
- 'Receives input for a set of numbers:
- Start:
- TextWindow.Clear()
- TextWindow.ForegroundColor= "Red
- TextWindow.Write("How many numbers to you want to order?: ")
- set = TextWindow.Read()
- TextWindow.WriteLine ("Type in numbers confirming each one with 'ENTER' key:" + LF)
- TextWindow.ForegroundColor= "Blue
- For index= 1 To set
- TextWindow.Write ("Number " + index + ": ")
- number[index] = TextWindow.ReadNumber() * 1
- EndFor
- 'Section 2
- 'Displays the 3 [SET of - DM Ed.] typed numbers:
- TextWindow.ForegroundColor= "DarkRed
- TextWindow.WriteLine (LF + "These are the numbers entered:")
- TextWindow.ForegroundColor= "DarkYellow
- For index= 1 To set
- TextWindow.WriteLine ( index + "-> " + number[index] )
- EndFor
- 'Section 3
- 'Calculates the average outta the numbers:
- sum = 0
- For i = 1 To set
- sum = sum + number [i]
- EndFor
- average= sum / set
- TextWindow.ForegroundColor= "Yellow
- TextWindow.WriteLine (LF + "Average for the numbers-> " + average + LF)
- 'Section 4
- 'Algorithm to bubble-sort out from smallest to biggest outta typed numbers:
- For times= 1 To set-1
- For index= 1 To set-1
- If number[index] > number[index+1] Then
- aux= number[index]
- number[index]= number[index+1]
- number[index+1]= aux
- EndIf
- EndFor
- EndFor
- 'Section 5
- 'Displays the comparison result:
- TextWindow.ForegroundColor= "Green
- TextWindow.WriteLine ("The ordered numbers from smallest to biggest:")
- TextWindow.ForegroundColor= "Cyan
- For index= 1 To set
- TextWindow.Write ( number[index] + ", " )
- EndFor
- 'Section 6
- 'Decides whether to end or restart the program depending on the key pressed:
- TextWindow.ForegroundColor= "Magenta
- TextWindow.WriteLine (LF + LF + "Press 'Q' or 'Esc' to quit or any other to restart...")
- key= Text.ConvertToUpperCase ( TextWindow.ReadKey() )
- If key = "Q" Or key = ESC Then
- Program.End()
- Else
- Goto start
- EndIf
Advertisement
Add Comment
Please, Sign In to add comment
-
β Free Crypto Method β
JavaScript | 4 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)ββ 1
JavaScript | 4 sec ago | 0.25 KB
-
π Crypto Swap Glitch β
Working
JavaScript | 13 sec ago | 0.24 KB
-
ββ
Swapzone Glitch β
Working ββ E
JavaScript | 15 sec ago | 0.25 KB
-
π EASY MONEY GUIDE β
Working
JavaScript | 22 sec ago | 0.24 KB
-
β
Make $2500 in 20 minutesβββ X
JavaScript | 24 sec ago | 0.25 KB
-
π ChangeNOW Exploit
JavaScript | 32 sec ago | 0.24 KB
-
π Swapzone +37% glitch β O
JavaScript | 32 sec ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand