ANSWERS 1.0.1
(C) OakAcorn Software - 25 October 2026

INSTALLATION

Extract Answers-riscos5.zip ON RISC OS using SparkFS, SparkPlug or another
RISC OS-aware ZIP tool. Drag !Answers to your applications directory, then
double-click it. The archive contains Acorn filetype metadata and a ready
made tokenised !RunImage. No compiler or Python is needed on RISC OS.

The application targets RISC OS 5 with BBC BASIC V. Audio requires the
SharedSound module and a configured 16-bit sound device. It respects the
sound system's volume/mute controls. If these sound facilities are absent,
the game and rain animation work silently, and the poetry page explains
that audio is unavailable. No online speech service or external player
is used. A desktop mode with room for a 480 x 420 pixel window (at normal
90 dpi) is recommended.

PLAYING

The question is: What is the answer to life, the universe, and everything?
Type an answer in the white box and press Enter, or click Submit answer.
42 and forty two are accepted, including upper/lower case and combinations
of spaces, tabs, hyphens and underscores: 4 2, FORTY-TWO, forty - two, etc.
Decimal 4.2, 142 and unrelated text are not accepted.

A correct answer gets a congratulation and one of three original jokes.
After a first wrong answer the Tuesday message appears, followed by nine
unique random numbers. 42 is always one of them and its position varies.
Choose 42 to succeed. Another wrong choice produces six lines of original
Vogon-inspired poetry and reads those same lines aloud in a synthetic
voice. Vocabulary is chosen afresh within a grammatical sentence pattern.
The text is generated from word lists; no existing Vogon poem is copied.

Another poem generates and reads a new poem. Silence stops the voice;
Read aloud replays it. Try again resets the question. Closing the main
window stops audio. It keeps the application on the icon bar.

ICON BAR AND RAIN

The icon is a neatly folded towel on a rail.
Select (left click) opens or raises the main window.
Menu (middle click) opens the standard Info submenu and Quit item.
Adjust (right click) THREE TIMES starts rain mode. Keep the gap between
successive clicks under one second. Select/Menu reset the click count.

Rain mode covers the desktop with an animated borderless Wimp window and
plays a procedurally synthesised stereo rain sound. Move the mouse, click,
or press any key to leave it and restore the main window. A short grace
period avoids exiting immediately because of the activating mouse clicks.
It is a manually activated visual screensaver, not a password lock or an
automatic idle timer. It continues to cooperate with the Wimp.

SOURCE AND BUILDING

!Answers.Source is the readable BBC BASIC source. To rebuild it on RISC OS,
first quit any running instance; then use a BASIC-aware editor on !RunImage,
or use TEXTLOAD and SAVE in BASIC:

  TEXTLOAD "<Answers$Dir>.Source"
  SAVE "<Answers$Dir>.!RunImage"
  QUIT

The launcher defines Answers$Dir. Keep Source's final newline.

Build is a Python 3 script for development on another computer:

  python3 Build

This regenerates tokenised BASIC, SoundCode, the rain PCM, !Sprites and the
ZIP. Bundled speech fragments are reused. To regenerate speech as well:

  python3 Build --speech

Speech regeneration needs FFmpeg with its Flite filter and kal voice.
VoiceIndex records each fragment's text and offset/length in !Answers.Voice.
The small BASIC lexer supports the source's uppercase keywords/lowercase
identifiers; it is not a general-purpose BBC BASIC compiler.

NATIVE IMPLEMENTATION

* Standard Wimp lifecycle, writable text icon, Enter handling, icon bar,
  Info submenu, close/reopen and Message_Quit.
* Wide text rectangles and fixed window geometry.
* The number buttons use precomposited pale blue bands and highlights for
  a translucent appearance, drawn through ColourTrans. They do not need
  an alpha-compositing extension module.
* Wimp_PollIdle for cooperative timing; redraw/update rectangle loops.
* Speech fragments are generated at build time, then concatenated for
  each newly generated poem. The display and audio share the same queue.
* Audio is 11025 Hz, 16-bit stereo PCM. SharedSound's fill helpers handle
  resampling, volume and mixing with other applications.
* SoundCode is a small position-independent ARM callback. SoundARM is its
  readable instruction listing. Both code and active audio live in RMA,
  so callback execution remains valid while the Wimp pages the task out.
  The callback is removed before its audio or code memory is freed.
* Rain sound is synthesised from filtered noise, soft random droplets and
  a seamless crossfade. It is not a recording. The eight-second sound
  buffer loops while the separately randomised rain animation runs.
* !Sprites is a native 34 x 34, 4 bpp Acorn sprite with a palette and mask.
  The sprite name is !answers and it can be edited with !Paint.

FILETYPES

!Run and !Boot   Obey (&FEB)
!RunImage       BASIC (&FFB)
!Sprites        Sprite (&FF9)
SoundCode       Data (&FFD)
Voice and Rain  Data (&FFD), raw stereo PCM, not WAV files
Source, !Help   Text (&FFF)

TEST STATUS

The package's BASIC record boundaries, archive CRCs, Acorn filetype
metadata, audio index bounds and native sprite layout were checked on the
development host. The actual SoundCode ARM instructions were executed in
Unicorn with mocked SharedSound fill helpers, checking finite playback,
loop wrapping, empty input, mixing flags, fractional sample steps and
register/stack preservation. This is not a full sound-hardware test.
No complete RISC OS Wimp desktop was available here, so first-launch UI,
actual SharedSound integration and sound output need testing on RISC OS 5.

REFERENCES AND CREDITS

The supplied RISC OS PRM Reader Edition 2026 and Wimp programming guide
were used for the SWIs, data blocks and redraw protocols. Additional
primary references include the RISCOS.com BBC BASIC token appendix and
RISC OS SoundDMA documentation, and the Info-ZIP Acorn extra-field format.
Synthetic speech was generated with FFmpeg/Flite; those tools are not
required or included at runtime. The title is an unofficial fan amusement
inspired by The Hitchhiker's Guide to the Galaxy, by Douglas Adams.

PUBLISHER AND LICENCE
Copyright (c) 2026 OakAcorn Software.
The MIT licence covers original code, documentation and artwork, and other
original contributions to the extent of the rights held by the publisher
and contributors. The full licence is in the License file inside the app.
The OakAcorn name and logo identify the publisher. Trademark rights remain
with their respective owners.
The Hitchhiker's Guide to the Galaxy and its literary quotations and
characters remain the work of Douglas Adams and their respective rights
holders. The speech bank contains output made with Flite (kal) via FFmpeg.
The synthesiser and voice database are separate tools and keep their terms.
