meltdown-terminal 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
meltdown/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ """MELTDOWN - A stressful, fast-typing terminal survival game."""
2
+
3
+ __version__ = "2.0.0"
4
+ __all__ = ["__version__"]
meltdown/__main__.py ADDED
@@ -0,0 +1,8 @@
1
+ """Allow running the game with `python -m meltdown`."""
2
+
3
+ import sys
4
+
5
+ from meltdown.cli import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())
meltdown/cli.py ADDED
@@ -0,0 +1,66 @@
1
+ """Command-line interface for MELTDOWN."""
2
+
3
+ import argparse
4
+ import sys
5
+ from typing import List, Optional
6
+
7
+ from meltdown import __version__
8
+
9
+ EPILOG = """\
10
+ controls:
11
+ Letters / numbers Type your answer
12
+ Enter Submit answer
13
+ Backspace Delete character
14
+ Esc Pause menu
15
+ Tab Switch active player (Co-op mode)
16
+ Ctrl+C Quit
17
+
18
+ save data:
19
+ Stored in ~/.meltdown/data.json (override with MELTDOWN_DATA_DIR).
20
+
21
+ troubleshooting:
22
+ - Terminal too small: resize your terminal to at least 80x24.
23
+ - Windows: if curses fails to import, install `windows-curses`.
24
+ - Colors look wrong: ensure TERM supports 256 colors or toggle
25
+ Colorblind Mode in Settings.
26
+ """
27
+
28
+
29
+ def build_parser() -> argparse.ArgumentParser:
30
+ """Create and return the CLI argument parser."""
31
+ parser = argparse.ArgumentParser(
32
+ prog="meltdown",
33
+ description=(
34
+ "MELTDOWN — A fast-typing terminal survival game. "
35
+ "Clear incoming alarms, manage stress and hull integrity, "
36
+ "and survive bosses and endless dread."
37
+ ),
38
+ epilog=EPILOG,
39
+ formatter_class=argparse.RawDescriptionHelpFormatter,
40
+ )
41
+ parser.add_argument(
42
+ "-V",
43
+ "--version",
44
+ action="version",
45
+ version=f"%(prog)s {__version__}",
46
+ )
47
+ return parser
48
+
49
+
50
+ def main(argv: Optional[List[str]] = None) -> int:
51
+ """CLI entry point for the `meltdown` command."""
52
+ parser = build_parser()
53
+ parser.parse_args(argv)
54
+
55
+ try:
56
+ from meltdown.game import run
57
+ except ImportError as exc:
58
+ print(
59
+ f"Error: Failed to load terminal UI ({exc}).\n"
60
+ "If you are on Windows, ensure `windows-curses` is installed:\n"
61
+ " pip install windows-curses",
62
+ file=sys.stderr,
63
+ )
64
+ return 1
65
+
66
+ return run()