Bubble Sort (Swapping Adjacent Pairs)
Repeatedly compares adjacent elements and swaps them if out of order. Larger values bubble up to the end of the array each pass.
Interactive browser Computer Science workbench (ages 10-15): step-by-step Bubble/Selection/Insertion Sort & Binary Search animator synced with C++, 8-bit LED Binary/Hex/RGB/Bitwise studio, Von Neumann Fetch-Decode-Execute CPU simulator, and Half-Adder Logic Gates.
Repeatedly compares adjacent elements and swaps them if out of order. Larger values bubble up to the end of the array each pass.
Finds the smallest remaining element in the unsorted tail and swaps it once into position i.
Works like sorting playing cards in your hand: picks each key and shifts larger sorted items rightward to insert it.
On a SORTED array, checks the middle index and halves the remaining search space every step—1,000 items take at most 10 checks!
Inspects items one by one from left to right. Works on unsorted arrays, but worst-case checks all n items.
Step through live PC, IR, MAR, ACC, and ZERO_FLAG registers against editable 16-cell unified RAM using LOAD, ADD, SUB, STORE, JMP, JZ, OUT, and HALT.
Toggle 8-bit powers of 2 (128..1) for live Base10/Hex/ASCII conversion, explore A & B / A | B / A ^ B / shifts, and test AND, OR, XOR, NAND and the Binary Half-Adder.
Fetches operand RAM[14] (15), adds RAM[15] (27), stores total in RAM[13], and prints via OUT.
Starts from 3 in RAM[14], outputs and decrements by 1 each iteration until Zero Flag triggers JZ to HALT.
Computes 12 × 3 using pure ALU additions: loads 12, adds 12 twice, and outputs 36.
Outputs 1 (HIGH) ONLY when both A and B are 1 simultaneously (same as `&&` in C++).
Outputs 1 whenever AT LEAST one input is 1 (same as `||` in C++).
Outputs 1 ONLY when A and B differ (one 0, one 1). Core building block of binary addition & encryption!
Inverted AND: outputs 0 only when both inputs are 1. Any CPU circuit can be built purely from NAND gates!
Adds two binary bits inside the CPU! When A=1 & B=1, SUM=0 and CARRY=1 (1 + 1 = 10 binary = 2!).
Alarm rings if (Motion A AND Armed B) OR Emergency Panic C is pressed.
See firsthand how the CPU fetches instructions from RAM using PC, IR, and ALU registers.
Open Curriculum Lesson →Every screen pixel stores three 8-bit color channels (Red, Green, Blue) ranging from 0 to 255.
Open Curriculum Lesson →Conditional statements in Scratch & C++ compile straight into silicon AND/OR/NOT logic gates.
Open Curriculum Lesson →Visually compare O(n²) sorting vs O(log n) Binary Search and step through C++ code in Visual Trace.
Open Curriculum Lesson →