testsAndMisc-archive/python_pkg/keyboard_coop
Krzysztof kuhy Rudnicki 8f2fbd2311 refactor: enforce 500-line limit on all Python source files
Split 18+ Python files that exceeded 500 lines into smaller modules
with helper files (prefixed with _). All functions are re-exported
from the original modules to maintain backward compatibility with
test patches and external imports.

Files split:
- moviepy_showcase.py (1212 -> 302 + 3 helpers)
- anki_generator.py (1174 -> 473 + 4 helpers)
- test_analyze_chess_game.py (1152 -> 361 + 2 parts)
- poker_modifier_app.py (1024 -> 263 + 2 helpers)
- transcribe_fw.py (1007 -> 342 + 3 helpers)
- music_generator.py (1002 -> 319 + 2 helpers)
- translator.py (951 -> 442 + 2 helpers)
- cinema_planner.py (893 -> 369 + 2 helpers)
- lichess_bot/main.py (757 -> 495 + _game_logic.py)
- test_translator.py (725 -> 289 + part2 + conftest)
- test_lichess_api.py (680 -> 475 + part2)
- learning_pipe.py (668 -> 375 + 2 helpers)
- cache.py (655 -> 360 + _cache_decks.py)
- analyze_chess_game.py (632 -> 463 + _move_analysis.py)
- visualize_q02.py (609 -> 371 + helper)
- repo_explorer.py (602 -> 347 + 2 helpers)
- keyboard_coop/main.py (515 -> 416 + _dictionary.py)
- scanning.py (501 -> 314 + _enforce_loop.py)

All tests pass: 144 lichess_bot (100% branch coverage), 243 others.
No new lint errors introduced.
2026-03-17 22:47:42 +01:00
..
tests WIP: Enforce 500-line limit - split batch 1 2026-03-16 22:46:48 +01:00
__init__.py refactor: rename folders to fix N999, INP001, S311 linting rules 2025-11-30 21:20:17 +01:00
_dictionary.py refactor: enforce 500-line limit on all Python source files 2026-03-17 22:47:42 +01:00
main.py refactor: enforce 500-line limit on all Python source files 2026-03-17 22:47:42 +01:00
README.md refactor: rename folders to fix N999, INP001, S311 linting rules 2025-11-30 21:20:17 +01:00
requirements.txt refactor: rename folders to fix N999, INP001, S311 linting rules 2025-11-30 21:20:17 +01:00
run_game.sh refactor: rename folders to fix N999, INP001, S311 linting rules 2025-11-30 21:20:17 +01:00
run.sh feat: added run sh and makefile scripts 2026-02-22 22:00:50 +01:00
words_dictionary.json refactor: rename folders to fix N999, INP001, S311 linting rules 2025-11-30 21:20:17 +01:00

Keyboard Coop Game

A fun 2-player cooperative word game where players take turns selecting adjacent letters on a QWERTY keyboard to form valid words.

How to Play

  1. Setup: Two players take turns at the same computer
  2. Turn System: Player 1 starts by clicking any letter on the keyboard
  3. Adjacent Rule: The next player must click a letter that is adjacent to the previously selected letter
  4. Word Formation: Continue taking turns until you want to submit a word
  5. Scoring: Press ENTER to submit the word. Valid words score points exponentially based on length:
    • 3 letters: 2 points
    • 4 letters: 4 points
    • 5 letters: 8 points
    • 6 letters: 16 points
    • And so on...

Game Rules

  • Minimum Length: Words must be at least 3 letters long
  • Adjacency: Letters must be adjacent on a standard QWERTY keyboard
  • Valid Words: Only dictionary words are accepted
  • Cooperative: Both players share the same score - work together!

Keyboard Adjacency

Each key is adjacent to its neighbors (including diagonals). For example:

  • 'S' is adjacent to: Q, W, E, A, D, Z, X, C
  • 'F' is adjacent to: E, R, T, D, G, C, V, B

Controls

  • Mouse Click: Select letters and buttons
  • ENTER Key: Submit current word
  • R Key: Reset the game
  • ENTER Button: Submit current word (mouse)
  • RESET Button: Reset the game (mouse)

Installation

  1. Make sure you have Python 3.6+ installed
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the game:
    python main.py
    

Features

  • Visual QWERTY keyboard layout
  • Real-time adjacency highlighting
  • Turn-based gameplay with player indicators
  • Exponential scoring system
  • Built-in dictionary validation
  • Reset and restart functionality

Strategy Tips

  • Look for common word patterns and endings
  • Try to set up your partner for success
  • Longer words give exponentially more points
  • Remember that some letters have more adjacent options than others

Enjoy playing together!