Pocket Pool 1.11 for TI-Nspire CX / CX II
Author: PocketPoolDev

Local two-player 8-ball and 9-ball, plus solo practice. Native Lua;
no Ndless, external libraries, internet connection, or extra assets needed.

INSTALL
Transfer Pocket Pool.tns to your TI-Nspire CX or CX II using TI-Nspire
Student Software (File > Save to Handheld), then open it in My Documents.
It also runs in TI-Nspire CX Student Software. This is an Nspire document,
not a TI-83/84 program.

CONTROLS
Left / Right: coarse aiming, 3 degrees.
Up / Down or ( / ): fine aiming, 0.1 degree.
1-9: power 10-90%. 0: maximum power.
+ / -: power in 5% steps, or 1% when Fine is enabled.
Enter or Space: shoot / confirm cue-ball placement.
Tab, Shift+Tab, F, or click STEP: toggle fine power / placement.
Click / drag the felt: aim, or move the cue ball when placing it.
Click / drag the power meter: set power. Click SHOOT / PLACE to confirm.
Menu: game actions, Easy / Hard guides, fine controls, and help.
G: toggle guide. H: help. Esc: pause. N: restart confirmation.
M while paused: return to mode menu.

Keypad and touchpad controls work together. Shift alone has no event in
TI's stock Lua API; use Shift+Tab or the clickable toggle.

MODES AND HOUSE RULES
8-ball: groups assigned on the first legal solid / stripe pot after the
break; clear your group before shooting the eight. An early eight or a
foul while potting it loses. Eight on the break is respotted.
9-ball: hit the lowest remaining ball first. Any legal pot keeps the turn;
a legal nine wins, including combinations and the break. Nine on a foul
is respotted; other potted object balls stay down. The target ring flashes
for one second at turn start.
Scratch, no contact, wrong first contact, or no rail after contact when
no object ball is potted gives the opponent ball in hand.
Practice: clear all balls in any order; tracks shots and scratches.
These are casual rules: no spin, jump shots, called pockets, computer
opponent, push-outs, three-foul loss, or tournament break requirements.

Player pot rows record who shot each potted ball, including balls of the
other group and balls potted during fouls. Easy shows the cue path and
first object-ball direction; Hard shows the cue guide and contact marker.
The guides do not predict every bounce or final resting position.
Save the document to preserve your current game.

SOURCE AND VALIDATION
pool.lua contains the complete editable Lua source. The .tns was packaged
with Luna 2.1. Open the document's Script Editor to edit the source.
35 automated Lua tests passed. Layout was visually checked in TI-Nspire
CX Student Software, including handheld preview. Physical calculator
performance and USB transfer have not been tested.
