ZX Spectrum Basic
'''ZX Spectrum Basic''' is the BASIC built into the ROM of the ZX Spectrum Computer.
Features
- Language is interpreted (but third party compiler is available).
- Line numbers are required
- Line numbers must be no longer than four digits
- No named locations
- Some Terminal Control capabilities
- Supports colour
- Support for direct display graphics
- Support for sound via the speaker
- No support for scoped variables
- No support for structured variables
- No command line parameters
- No support for environment
- Supports output tho the line printer via the lprint command
- No direct support for error handling, but error handling can be achieved using assembly language by changing the error handler address
- Support for streams when using Interface 1, but no support for freefile
- Can read keystrokes using
INKEY$ - No support for multiple line
IFconditionals - No conditional compilation directives
- no hashbang mechanism
- Variables have to be defined before use
- The GO TO command has a space in the middle
- VAL function interprets expressions
- INPUT function can interpret expressions (unless LINE INPUT is used)
Tasks
- 24 game
- A+B
- ABC Problem
- Abundant, deficient and perfect number classifications
- Ackermann function
- Align columns
- Aliquot sequence classifications
- Almost prime
- Amicable pairs
- Animate a pendulum
- Animation
- Anonymous recursion
- Apply a callback to an array
- Arithmetic evaluation
- Arithmetic-geometric mean
- Arithmetic/Complex
- Arithmetic/Integer
- Array concatenation
- Arrays
- Audio frequency generator
- Balanced brackets
- Barnsley fern
- Benford's law
- Best shuffle
- Binary digits
- Binary search
- Binary strings
- Box the compass
- Brownian tree
- Bulls and cows
- Caesar cipher
- Calculating the value of e
- Call a function
- Carmichael 3 strong pseudoprimes
- Case-sensitivity of identifiers
- Casting out nines
- Catalan numbers
- Catalan numbers/Pascal's triangle
- Catamorphism
- Chaos game
- Character codes
- Chinese remainder theorem
- Cholesky decomposition
- Circles of given radius through two points
- Closest-pair problem
- Color of a screen pixel
- Colour bars/Display
- Combinations with repetitions
- Comma quibbling
- Compare a list of strings
- Constrained random points on a circle
- Continued fraction
- Convert seconds to compound duration
- Copy a string
- Count in factors
- Count in octal
- Count occurrences of a substring
- Count the coins
- Create a file
- Create a file on magnetic tape
- Create a two-dimensional array at runtime
- Day of the week
- Delete a file
- Digital root
- Dinesman's multiple-dwelling problem
- Documentation
- Dot product
- Dragon curve
- Draw a clock
- Draw a cuboid
- Draw a pixel
- Draw a sphere
- Dutch national flag problem
- Empty program
- Empty string
- Entropy
- Equilibrium index
- Ethiopian multiplication
- Euler method
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even or odd
- Execute Brainfuck
- Execute a system command
- Exponentiation operator
- Extend your language
- Factorial
- Factors of an integer
- Fibonacci sequence
- Fibonacci word
- Filter
- Find limit of recursion
- Find the missing permutation
- FizzBuzz
- Flatten a list
- Floyd's triangle
- Forest fire
- Formatted numeric output
- Forward difference
- Fractal tree
- Function composition
- Function definition
- General FizzBuzz
- Generate lower case ASCII alphabet
- Greatest element of a list
- Greatest subsequential sum
- Greyscale bars/Display
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
- Hamming numbers
- Happy numbers
- Harshad or Niven series
- Haversine formula
- Hello world!
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Higher-order functions
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Horizontal sundial calculations
- IBAN
- Identity matrix
- Idiomatically determine all the lowercase and uppercase letters
- Include a file
- Infinity
- Integer comparison
- Introspection
- Iterated digits squaring
- Jaro distance
- Jensen's Device
- Josephus problem
- Julia set
- Keyboard input/Flush the keyboard buffer
- Keyboard input/Keypress check
- Keyboard input/Obtain a Y or N response
- Leap year
- Loop over multiple arrays simultaneously
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Nested
- Luhn test of credit card numbers
- Memory allocation
- Modulinos
- Musical scale
- N'th
- Narcissistic decimal number
- Pascal's triangle
- Primality by trial division
- Pythagorean triples
- Random number generator (included)
- Random numbers
- Read a file line by line
- Rename a file
- Rot-13
- Scope/Function names and labels
- Sieve of Eratosthenes
- Snake
- Sorting Algorithms/Circle Sort
- Sorting algorithms/Bubble sort
- Sorting algorithms/Cocktail sort
- Speech synthesis
- Spinning rod animation/Text
- Split a character string based on change of character
- Start from a main routine
- String concatenation
- String length
- Subleq
- Substring
- Substring/Top and tail
- Taxicab numbers
- Temperature conversion
- Terminal control/Cursor movement
- Terminal control/Unicode output
- Truncate a file
- Unicode strings
- Variable size/Set
- Write float arrays to a text file
- Yin and yang