Skip to content

Commit 3ed5c6c

Browse files
Update version history for v13.0 and v14.0
Fixed bugs in the interpreter affecting chained subtraction and type casting. Renamed example programs for clarity.
1 parent 41ea311 commit 3ed5c6c

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

JavaCodeVisualizer_VersionHistory.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Fixed cursor misalignment after font size increase.
158158

159159
---
160160

161-
### v12.0 (Final) — Copy/Selection Fix (Native Selection Restored)
161+
### v12.0 — Copy/Selection Fix (Native Selection Restored)
162162
**Lines:** ~2,901 | **Date:** May 28, 2026
163163

164164
Fixed word-level copy not working — selecting a single word was highlighting the entire line and copying the full line content.
@@ -175,6 +175,37 @@ Fixed word-level copy not working — selecting a single word was highlighting t
175175

176176
---
177177

178+
### v13.0 — Interpreter Bug Fixes (Chained Subtraction + Type Cast)
179+
**Lines:** ~2,927 | **Date:** May 28, 2026
180+
181+
Fixed two expression evaluator bugs that caused Bubble Sort to produce unsorted output and Array Sum to show wrong average.
182+
183+
- **Bug 1 — Chained subtraction:** `n - i - 1` returned `undefined` because `splitOnOperator(expr, '-')` produced 3 parts but the handler only accepted exactly 2 (`parts.length === 2`). The inner for loop condition `j < n - i - 1` was always `false`, so the swap code never executed. Fix: subtraction handler now processes any number of parts left-to-right using a loop
184+
- **Bug 2 — Type cast precedence:** `(double) sum / numbers.length` was parsed as `(double) (sum / numbers.length)` — integer division happened first (`21 / 5 = 4`), then the cast (`4.0`). Average showed `4` instead of `4.2`, and the conditional incorrectly printed "Below threshold." Fix: cast handler now detects arithmetic operators after the cast target and applies the cast to only the first operand before performing the operation (`21.0 / 5 = 4.2`)
185+
- All 8 built-in examples verified working after fixes
186+
187+
---
188+
189+
### v14.0 (Final) — Example Programs Renamed with Descriptive Class Names
190+
**Lines:** ~2,928 | **Date:** May 28, 2026
191+
192+
Replaced `public class Main` in all 8 built-in example programs with descriptive class names.
193+
194+
- **ArraySumAverage** — Array Sum & Average
195+
- **BubbleSort** — Bubble Sort
196+
- **Fibonacci** — Fibonacci (Recursive)
197+
- **Factorial** — Factorial (Recursive)
198+
- **BinarySearch** — Binary Search
199+
- **StringReversal** — String Reversal
200+
- **FizzBuzz** — FizzBuzz
201+
- **SelectionSort** — Selection Sort
202+
- File label now shows `BubbleSort.java`, `Fibonacci.java`, etc. instead of `Main.java`
203+
- Call Stack tab shows class-contextual names (e.g. `Fibonacci.main(String[] args)`)
204+
- The `derivedFileName` logic (from v8.0) automatically picks up the new class names
205+
- All 8 examples tested and verified working with renamed classes
206+
207+
---
208+
178209
## Summary Table
179210

180211
| Version | Key Change | Lines |
@@ -191,3 +222,5 @@ Fixed word-level copy not working — selecting a single word was highlighting t
191222
| v10.0 | Fira Code font, 16px size, 28px line height | ~2,921 |
192223
| v11.0 | Cursor alignment fix (ligatures disabled, font sync) | ~2,931 |
193224
| v12.0 | Copy/selection fix (native selection restored) | ~2,901 |
225+
| v13.0 | Interpreter fixes (chained subtraction + type cast) | ~2,927 |
226+
| v14.0 | Example programs renamed with descriptive class names | ~2,928 |

0 commit comments

Comments
 (0)