Mail webatequ.in   Home Home

Spectrum BASIC quiz

An online C++ quiz inspired this one. How well do you know your Spectrum BASIC? Answer twenty questions and find out!

1. What's wrong with this statement? LOAD "" CODE 60000,6400

No filename has been specified.
Code length can only be specified for SAVE statements.
CODE should be CODE$.
There isn't room in memory for 6400 bytes starting at 60000.

2. If a$ = "hello", which expression will produce "hell"?

a$(1 TO 4)
a$(0 TO 3)
LEFT$(a$, 4)
a$(1, 4)

3. Which display statement will fail with an error?

INK 8
PAPER 9
OVER 8
FLASH 8

4. 128 BASIC added the SPECTRUM and PLAY keywords. Which statement about them is not true?

They cannot be used in 48K mode, even on a 128K machine.
They replace two pre-defined block graphics in the character set.
A running program stops if SPECTRUM is encountered.
PLAY can be used to send MIDI commands to electronic instruments.

5. What is the result of the expression VAL$ """a$""" ?

The string literal a$
The string literal "a$" (including the quotes)
The contents of the string variable a$
It fails with "C Nonsense in BASIC".

6. Why is it difficult to write a program that uses the built-in RAM disk if you want it to work on the +2, +2a, and +3?

The BASIC syntax for RAM disk operations varies between models.
The +3 has a bug where saving to RAM disk can crash the machine.
The +2 cannot erase files from the RAM disk, only overwrite them.
The +2a has no RAM disk!

7. If x = 4, what's ABS x ?

-4
1.3862944
4
1

8. How is CLEAR different from CLS ?

CLEAR clears the screen bitmap but leaves the colours intact.
CLEAR resets the values of variables.
CLEAR takes a parameter specifying the colours to use.
CLEAR is not a Spectrum BASIC keyword!

9. What does PAUSE 0 mean?

Wait until a key is pressed.
Wait for 65,535 seconds or until a key is pressed.
Wait forever, even ignoring keypresses (except Break).
It's a zero-length pause (wait for no time at all).

10. Which user-defined function will square the input value?

DEF FN s(x) = SQR x
DEF FN s(x) = x * x
DEF FN s() = SQR s
DEF FN s() = s * s

11. What's the result of the expression BIN 10 ?

1010
2
1
It's not acceptable syntax.

12. If a is greater than zero, how many times will this loop run? FOR n=a TO 0: NEXT n

Once.
Not at all.
a+1 times.
Forever.

13. Which statement isn't acceptable syntax?

RUN CODE "program"
IF NOT +3 THEN CLEAR ARRAY 0
DIM count(1, 2, 3)
DATA BIN, USR BIN

14. Which of these isn't a real keyword?

MOVE
LINE$
EXP
COPY

15. If I'm pressing Caps Shift + B, what is CODE INKEY$ ?

"B"
98 (the ASCII code for "b")
66 (the ASCII code for "B")
It depends on whether Caps Lock is on.

16. What's the result of INT RND * 4 ?

A random number between 0 and 4.
A random number between 1 and 4.
A random number between 0 and 3.
Always zero.

17. When would you use the keywords POINT and ATTR ?

When you want to do calculations involving trigonometry.
When you want to read or write sectors on a microdrive cartridge.
When you want to test the contents of the screen display.
Those aren't Spectrum BASIC keywords.

18. Why doesn't this read 1 into a and 2 into b? DATA 1, 2: READ a, b

DATA statements only work in a numbered program line.
Any statement following a DATA statement is ignored.
You can't READ into two variables with one statement.
The RESTORE statement is missing.

19. What colour will this text be? PRINT INK 3.5;"text"

Cyan.
Magenta.
Green.
It fails with "K Invalid colour".

20. How can you save a BASIC program so that it runs from the first line when loaded?

SAVE "program" LINE 0
MERGE "program": RUN
SAVE! "program"
It's not possible in Spectrum BASIC.

This page was last updated 1065 days ago.

Top Top of page   Home Home