Native Shell
Native Shell:AI 生成的 UI,在你的應用中原生呈現,涵蓋每個平台。iOS、Android、macOS、Windows 與 Linux 上的應用、GPUI 應用與網頁在執行時載入已簽名、沙箱隔離的 TSX 模組並繪製 th
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Classic 8-bit BASIC interpreter in the browser: 40x24 CRT screen, WHILE/FOR/GOSUB, strings, arrays, DATA, PRINT AT. Zero dependencies.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗A classic 8-bit style BASIC interpreter that runs entirely in the browser. It has a 40×24 character CRT screen with green, amber and white phosphor themes. There are no dependencies and no build step.
Live demo: https://cstroie.github.io/basic/
Open index.html in a browser. No server or build step is needed.
10 PRINT "HI") to store it. A bare line number (10) deletes that line.PRINT 2+2, FOR I=1 TO 3:PRINT I:NEXT).RUN.Esc or Ctrl+C, or click STOP, to break a running program. CONT resumes it.↑/↓ scroll through command history. Pasting a multi-line listing enters every line..bas files. You can also drop a .bas file on the screen.| Area | Supported |
|---|---|
| Commands | RUN [line], LIST [a-b], NEW, CLS, CONT, CLEAR, SAVE name, LOAD name, KILL name, FILES, HELP |
| Statements | PRINT (; , TAB() SPC(), PRINT AT row,col;), INPUT ["prompt";] a, b$, LET (optional), IF … THEN … ELSE, FOR … TO … STEP / NEXT, WHILE / WEND (or END WHILE), EXIT [FOR|WHILE], GOTO, GOSUB / RETURN, ON x GOTO/GOSUB, DIM, READ / DATA / RESTORE, END, STOP, REM / ', ? (short for PRINT) |
| Functions | ABS SGN INT SQR SIN COS TAN ATN LOG EXP RND PI LEN VAL ASC CHR$ STR$ LEFT$ RIGHT$ MID$ INSTR UCASE$ LCASE$ STRING$ |
| Operators | + - * / ^ MOD, = == <> < > <= >=, AND OR NOT, + joins strings |
| User functions | DEF FNA(X) = …, DEF FNB$(A$, N) = … |
| Keyboard and time | INKEY$ (non-blocking), GET k$ (waits for a key), SLEEP seconds |
| Colour and graphics | COLOR fg[,bg] (0–15, C64 palette; −1 is the default), PLOT x,y, DRAW x,y, CIRCLE x,y,r, GCLS on a 320×240 canvas over the text |
| Sound | SOUND hz,ms, BEEP |
| Editing | RENUM [start[,step]], AUTO [start[,step]] (an empty line ends it), EDIT line |
| Options | OPTION CLASSIC prints numbers with MS BASIC spacing; OPTION COMPACT (default) doesn't |
:.$ hold strings. Arrays can be indexed with A(i) or A[i], and an array used without DIM gets 0..10.SAVE/LOAD store programs in the browser's localStorage. The name can be quoted or not.The menu on the page has eleven built-in programs, including Graphics & Colour and Keyboard & Sound. The same programs, plus the original primes.bas, are in examples/ as plain .bas files. Load one with OPEN or by dropping it on the screen.
| File | Shows |
|---|---|
hello.bas | PRINT, TAB, FOR loops |
primes.bas | WHILE … END WHILE, EXIT, arrays with [ ], == |
primes-while.bas | the same algorithm in WEND style with INPUT |
factorial.bas | INPUT loop, END |
guess.bas | RND, IF … THEN … : GOTO |
sine.bas | SIN, STEP, text plotting |
fizzbuzz.bas | MOD, print zones with , |
strings.bas | MID$, UCASE$, LEN, IF … ELSE |
sort.bas | DIM, READ / DATA, nested loops |
graphics.bas | COLOR, PLOT, DRAW, CIRCLE |
keys.bas | GET, SOUND, DEF FN, INSTR |
mandelbrot.bas | PRINT AT, WHILE, AND, MID$ |
The page is a Progressive Web App. Your browser offers to install it (on a phone, use Add to Home Screen). After the first visit it also works offline: a service worker (sw.js) caches the app and refreshes it in the background, so updates appear on the next visit.
basic.js holds the interpreter core: tokenizer, expression parser, statement executor, character-grid terminal and example programs. It does not touch the DOM, so it can also run under Node.index.html holds the user interface.examples/ holds sample programs.To try the core without a browser:
const { Basic, Terminal } = require('./basic.js');
const storage = { get: () => null, set: () => true, remove() {}, keys: () => [] };
const b = new Basic(new Terminal(), storage);
b.enter('FOR I=1 TO 3:PRINT I*I:NEXT');
b.runSlice();
console.log(b.term.lines().join('\n'));
node --test
The tests run the interpreter core under Node (version 18 or later) with no dependencies. GitHub Actions runs them on every push.
MIT © Costin Stroie