mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2025-01-01 12:31:01 +00:00
Ensure COLOR= gives Illegal Quantity Error for > 255. Fixes #30
This commit is contained in:
parent
b11acbe1fb
commit
af0a7eb886
2
basic.js
2
basic.js
@ -856,7 +856,7 @@ this.basic = (function() {
|
||||
if (!env.lores) { runtime_error('Lores graphics not supported'); }
|
||||
|
||||
n = n >> 0;
|
||||
if (n < 0) { runtime_error(ERRORS.ILLEGAL_QUANTITY); }
|
||||
if (n < 0 || n > 255) { runtime_error(ERRORS.ILLEGAL_QUANTITY); }
|
||||
|
||||
env.lores.setColor(n);
|
||||
},
|
||||
|
@ -411,6 +411,10 @@
|
||||
7020 T$ = "COLOR="
|
||||
: T = 0 : U = 0 : FOR I = 0 TO 15 : COLOR= I : PLOT 0,0 : T = T + I : U = U + SCRN(0,0) : NEXT
|
||||
: S = (T=U) : GOSUB 1
|
||||
: T = 1 : ONERR GOTO 7022
|
||||
7021 COLOR=256
|
||||
: T = 2
|
||||
7022 S = (T=1) AND (PEEK(222)=53) : GOSUB 1
|
||||
|
||||
7030 T$ = "PLOT"
|
||||
: COLOR= 5 : PLOT 0,0 : PLOT 39,0 : PLOT 0,47 : PLOT 39,47
|
||||
|
Loading…
Reference in New Issue
Block a user