# 1 Introduction
[NULL]

## 1.1 Purpose
This specification establishes the requirements for the product named Qheadache. The intended audience is the analyst, programmer, and tester of Qheadache.

## 1.2 Scope
The software product to be produced is named Qheadache. It is a computerized game designed to provide an interface for solving a specific puzzle or challenge, referred to as a "headache." The application of Qheadache is to offer an engaging and interactive gaming experience that challenges users to solve the puzzle efficiently. The primary objective of the software is to entertain users while providing a platform to improve problem-solving skills. The game is intended to be accessible to a wide range of users, from beginners as young as eight years old to advanced players, including adults.

## 1.3 Product overview
[NULL]

### 1.3.1 Product perspective
The product, Qheadache, is a standalone computerized game that operates independently and does not form part of a larger system. It is designed to run on any operating system supported by the Qt graphical library, which it utilizes for its graphical user interface.

#### System interfaces
[N/A]

#### User interfaces
The user interface of Qheadache is designed to be intuitive and user-friendly, employing menus, graphics, and sounds to enhance the gaming experience. The interface includes a main window with a board for gameplay and a menu bar for navigation. The game is accessible to users starting from age 8 and requires basic computer operation skills.

#### Hardware interfaces
Qheadache requires a keyboard and a mouse for user interaction. It also necessitates a graphical display with a minimum resolution of 800x600 pixels. The game can accommodate other pointing and input devices that provide similar functionalities to a mouse and keyboard.

#### Software interfaces
The game relies on the Qt graphical library, which must be compatible with the operating system in use. This ensures that Qheadache can run on any platform that supports Qt.

#### Communications interfaces
[N/A]

#### Memory constraints
[N/A]

#### Operations
Qheadache operates in a user-initiated mode, where the user interacts with the game through the provided interface. The game records player statistics, such as the number of block movements and time spent, which are managed and displayed within the game.

#### Site adaptation requirements
[N/A]

#### Interfaces with services
[N/A]

### 1.3.2 Product functions
The Qheadache game software provides several key functions to enhance user experience and gameplay:

- **Undo and Redo Actions**: Users can undo and redo their last thousand actions, allowing for flexible gameplay adjustments.
- **Time Tracking**: The software tracks and displays the time spent by the user during gameplay.
- **Action Count**: It counts and displays the number of actions performed by the user.
- **Score Management**: The game records the user's score, which includes time and action count, and associates it with the user's name.
- **Score Display**: A window is available to display all the player's scores, providing a comprehensive view of performance.
- **Game Board Interaction**: Users can interact with a game board to move blocks, with specific rules for block selection, deselection, and movement.
- **End of Game Management**: The game provides different windows upon completion, depending on the player's performance, and freezes player statistics.
- **Statistics Management**: The software manages player and game statistics, allowing for recording, displaying, and erasing of statistics.
- **File Management**: Users can open, save, and save games as new files, ensuring game progress is maintained.
- **Menu Navigation**: The game includes a menu bar with options for game management, actions, statistics, and help, facilitating easy navigation and control.

These functions are designed to provide a comprehensive and engaging user experience, allowing players to track their progress and manage their gameplay effectively.

### 1.3.3 User characteristics
The intended users of the product are individuals who wish to play a simple computerized game. No specific qualifications are necessary, and the game is accessible to a wide range of users, from beginners starting at age 8 to advanced players, including adults. Users are expected to have basic computer operation skills, such as using a mouse and keyboard. There are no specific requirements regarding educational level, experience, or technical expertise, making the game suitable for a broad audience.

### 1.3.4 Limitations
- The product requires a graphical display with a minimum resolution of 800x600.
- The software must be portable to the Windows operating system.
- There can be only one user per machine.
- The product uses the Qt graphical library and must run on all operating systems supported by Qt.
- The product generally requires a mouse and a keyboard for input, although other pointing and input devices are allowable if they provide similar functions.

## 1.4 Definitions
[N/A]

# 2 References
[N/A]

# 3 Requirements
[NULL]

## 3.1 Functions
The Qheadache game software is designed to perform several fundamental actions to process inputs and generate outputs. The following subsections describe these functions in detail:

### 3.1.1 Undo and Redo Actions
- **Input:** Menu selection.
- **Processing:** 
  - Undo: Reverts the game to the state before the last movement. This action is considered a movement itself and is unavailable if there was no previous movement.
  - Redo: Reapplies a movement that was undone. This action is considered a movement and is unavailable if the previous action wasn't an "undo" action.
- **Output:** Updates the game board display to reflect the new state.

### 3.1.2 Time Tracking
- **Function:** The game tracks and displays the time elapsed since the start of the game.

### 3.1.3 Action Count
- **Function:** The game counts and displays the number of actions performed by the user.

### 3.1.4 Score Management
- **Function:** Records the score based on time and action count, associating it with the player's name.
- **Output:** Displays a window with all the player's scores.

### 3.1.5 End of Game Management
- **Input:** The great square is moved to the bottom of the board.
- **Processing:** Freezes all player statistics.
- **Output:** 
  - If the current player's block movements are fewer than the highest recorded, the "Finish Window with Statistics" is displayed.
  - Otherwise, the "Simple Finish Window" is displayed.

### 3.1.6 Statistics Management
- **Player Statistics:**
  - **Input:** A block movement.
  - **Processing:** Increments the block movement count and records the time difference since the last movement.
- **Game Statistics:**
  - **Input:** Completion of the "Finish Window with Statistics."
  - **Processing:** Records player statistics in the file. If the file already contains 10 entries, the entry with the greatest block movements is erased.
  - **Output:** Displays an error message if the file update fails due to permissions or disk space issues.

### 3.1.7 File Management
- **Open Game:**
  - **Input:** Menu selection.
  - **Processing:** Opens a dialog for the user to select a previously saved game file.
  - **Output:** Redraws the game board and sets player statistics from the file.
- **Save Game:**
  - **Input:** Menu selection.
  - **Processing:** Saves the current game state to a file, including block positions, previous positions, movement count, and elapsed time.
- **Save Game As:**
  - **Input:** Menu selection.
  - **Processing:** Opens a dialog for the user to choose a file to save the current game state.
- **Exit:**
  - **Input:** Menu selection.
  - **Processing:** Prompts the user to save the game if unsaved before closing the main window.

### 3.1.8 Menu Bar Functions
- **Game Menu:** Includes options for opening, saving, and exiting the game.
- **Action Menu:** Provides "Undo" and "Redo" options.
- **Statistics Menu:** Allows displaying or erasing statistics.
- **Help Menu:** Displays the "About" window with version and author information.

[N/A] for validity checks on inputs, responses to abnormal situations, effect of parameters, and relationship of outputs to inputs as these details are not provided in the original SRS.

## 3.2 Performance requirements
There can be only one user per machine. 

[N/A]

## 3.3 Usability requirements
The software system should be designed to ensure ease of use for users of all ages, starting from age 8. The interface should be intuitive, allowing users to navigate through menus and perform actions such as undoing and redoing moves with minimal effort. The game should provide clear feedback on user actions, such as displaying the current score and time spent playing. The system should avoid causing any harm or confusion to users by ensuring that all actions are reversible and that the interface is consistent and predictable. Satisfaction criteria include the ability to easily track progress and view statistics, contributing to an engaging and enjoyable user experience. [N/A]

## 3.5 Logical database requirements
[N/A]

## 3.6 Design constraints
[N/A]

## 3.7 Software system attributes
e) Portability - The software must be portable to the Windows OS. 

[N/A]

## 3.8 Supporting information
[N/A]

# 4 Verification
[NULL]

## 4.1 Functions
[N/A]

## 4.2 Performance requirements
The verification of performance requirements will focus on ensuring that the software supports only one user per machine, as specified. This will be tested by attempting to run multiple instances of the game on a single machine and verifying that only one instance can be active at a time. Additionally, the software's portability to the Windows OS will be verified by testing the installation and execution of the game on various versions of Windows to ensure compatibility and performance consistency. Performance metrics will be collected to confirm that the game operates efficiently under normal usage conditions. [N/A]

## 4.3 Usability requirements
[N/A]

## 4.5 Logical database requirements
[N/A]

## 4.6 Design constraints
[N/A]

## 4.7 Software system attributes
[N/A]

# 5 Appendices
[NULL]

## 5.1 Assumptions and dependencies
[N/A]

## 5.2 Acronyms and abbreviations
[N/A]
