Pseudokod Algorytmy - Politechnika Opolska
Rozszerzenie VS Code do podświetlania składni, snippetów i walidacji pseudokodu w notacji Mariusza Sobola używanej na Politechnice Opolskiej.
VS Code extension providing syntax highlighting, snippets, and validation for pseudocode based on Mariusz Sobol's notation used at Opole University of Technology.
Features
Syntax Highlighting
Rich syntax highlighting for .alg files and pseudocode code blocks in Markdown:
- Keywords:
algorithm, if, then, else, for, to, do, while, return
- Operators:
←, +, -, *, /, mod, div, <, >, ≤, ≥, =, ≠
- Data types:
int, float, string, bool, array, list
- Built-in functions:
length(), print(), read(), push(), pop()
- Comments:
// single-line
- Braces:
{ } for code blocks (not "end" keywords)
Code Snippets
27+ intelligent code snippets for common patterns:
| Prefix |
Description |
alg |
Algorithm template |
if, ife |
If/if-else statements |
for, fore |
For loops (to/downto) |
while |
While loop |
arr, mat |
Array/matrix declarations |
func |
Function definition |
swap |
Swap two variables |
max, min |
Find maximum/minimum |
Type prefix + Tab to expand snippet.
Commands
| Komenda |
Skrót |
Opis |
| Validate Syntax |
Ctrl+Shift+V |
Zaawansowana walidacja składni (zmienne, pętle, typy) |
| Insert Arrow |
Ctrl+Shift+A |
Wstaw operator przypisania ← |
| Format Document |
Ctrl+Shift+F |
Formatuj kod (wcięcia, odstępy) |
| Analyze Complexity |
Ctrl+Shift+C |
Analiza złożoności algorytmu |
| Run Algorithm |
Ctrl+Shift+R |
⚡ NOWE Wykonaj algorytm (interpreter) |
| Step Through |
Ctrl+Shift+D |
⚡ NOWE Debugowanie krok po kroku |
| Show Output |
- |
Wyświetl wyniki wykonania |
| Extract Function |
- |
Wyodrębnij zaznaczony kod do funkcji |
| New Algorithm File |
- |
Stwórz nowy plik .alg z szablonem |
Markdown Integration
Write pseudocode in Markdown code blocks with syntax highlighting:
```pseudocode
algorithm BubbleSort {
read(n)
for i ← 1 to n do {
read(A[i])
}
for i ← 1 to n-1 do {
for j ← 1 to n-i do {
if A[j] > A[j+1] then {
temp ← A[j]
A[j] ← A[j+1]
A[j+1] ← temp
}
}
}
}
```
Syntax Rules
Based on Mariusz Sobol's notation (official course standard):
Assignment: Use arrow ← (not =)
x ← 5
Braces: Use { } (not "begin/end")
if x > 0 then {
write(x)
}
Algorithm structure:
algorithm Name {
// ciało algorytmu
return result
}
Arrays: 1-indexed (first element is A[1], not A[0])
A[1] ← 10 // pierwszy element
A[i,j] // tablica 2D (przecinek!)
Logical operators: Use words and, or, not (not symbols)
if (x > 0 and y < 10) or not (z = 5) then
Arithmetic: Use div (integer division), mod (remainder)
wynik ← a div b
reszta ← a mod b
I/O operations: Use read() and write() (not print)
read(n)
write("wynik = ", suma)
Keywords: Always use then after if, do after for/while
if warunek then {
// instrukcje
}
for i ← 1 to n do {
// instrukcje
}
Installation
From VSIX (Recommended)
- Download
pseudocode-sobol-x.x.x.vsix
- Open VS Code
- Press
Ctrl+Shift+P → "Extensions: Install from VSIX..."
- Select downloaded
.vsix file
From Marketplace
Search for "Pseudocode Sobol" in VS Code Extensions (Ctrl+Shift+X)
Usage
Create Algorithm File
Ctrl+Shift+N → New algorithm file
- Or create file with
.alg extension
- Start typing snippets (
alg, for, if, etc.)
Validate Syntax
- Open
.alg file
Ctrl+Shift+V → Validate syntax
- Check Output panel for errors
In Markdown
- Create code block with
```pseudocode
- Write algorithm with syntax highlighting
- Type
pseudocode + Tab for template
Requirements
- VS Code 1.75.0 or higher
- No external dependencies
Extension Settings
This extension contributes:
- Language:
pseudocode (.alg files)
- File associations:
*.alg → pseudocode
- Commands: 3 commands (validate, insert arrow, new file)
- Keybindings: 3 keyboard shortcuts
Known Issues
- Validation currently checks basic syntax only (algorithm structure, braces)
- No IntelliSense/autocompletion for custom variables yet
Release Notes
1.2.1 (2025-11-22) 📚 DOCUMENTATION UPDATE
Poprawki i dokumentacja:
- ✅ 100% zgodność z oficjalną notacją Mariusza Sobola
- 📝 Dodano
STANDARD_SOBOLA.md - kompletna oficjalna definicja składni
- 📝 Dodano
NOTACJA_SOBOLA.md - szczegółowe wyjaśnienia z przykładami
- 📝 Dodano
test_sobol_oficial.alg - 12 przykładów w oficjalnej notacji
- ✅ Poprawiono wszystkie przykłady: indeksowanie od 1,
read()/write()
- ✅ Zaktualizowano dokumentację README, QUICK_START
- 📊 Dodano warunki zaliczenia i skalę ocen z kursu
Kluczowe zasady:
- Indeksowanie od 1 (pierwszy element: A[1])
- Tablica 2D: A[i,j] (przecinek!)
- Operatory:
and, or, not (słowa, nie symbole)
- We/wy:
read(), write() (nie print)
- Dzielenie:
div, mod
1.2.0 (2025-11-22) ⚡ MAJOR UPDATE
Nowe funkcje:
- 🚀 Interpreter pseudokodu - wykonywanie algorytmów w czasie rzeczywistym
- Pełna obsługa notacji Mariusza Sobola (←, then, do, {})
- Tryb normalny i debug (krok po kroku)
- Output channel z logiem wykonania
- Obsługa: zmienne, tablice, for, while, if/else, operacje arytmetyczne
- 🔍 Zaawansowany walidator
- Śledzenie zmiennych i inicjalizacji
- Wykrywanie niezainicjowanych zmiennych
- Sprawdzanie granic tablic
- Wykrywanie nieskończonych pętli
- Detekcja nieosiągalnego kodu
- Ostrzeżenia o dzieleniu przez zero
- 📝 Trzy nowe komendy: Run Algorithm, Step Through, Show Output
- 📊 Nowe skróty klawiszowe
Ograniczenia interpretera v1.2.0:
- Brak obsługi wywołań funkcji między algorytmami
- Brak rekurencji
- Uproszczona inicjalizacja tablic
Zobacz: INTERPRETER_GUIDE.md dla pełnej dokumentacji.
1.1.0
Advanced features:
- IntelliSense / autocompletion (40+ suggestions)
- Quick Fixes (convert = to ←, add braces)
- Hover documentation (keywords, operators)
- Document outline / symbols navigation
- Code formatting with auto-indentation
- Complexity analysis with visualization
1.0.0
Initial release:
- Syntax highlighting for .alg files
- 27+ code snippets
- Markdown code block support
- Basic syntax validation
- Arrow insertion command
- Algorithm file templates
About
Created for students at Opole University of Technology (Politechnika Opolska) using Mariusz Sobol's pseudocode notation.
Stworzone dla studentów Politechniki Opolskiej korzystających z notacji pseudokodu Mariusza Sobola.
Based on materials from: github.com/lkolo-prez/algorytmy
License
MIT License - see LICENSE file
Contributing
Issues and pull requests welcome at: github.com/lkolo-prez/algorytmy
Enjoy writing algorithms!
| |