MATT - MATT Arithmetic Training Test https://pypi.org/project/matt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ron Nazarov 3c4295ceed Updated version number 4 weeks ago
matt Replaced "mat" with "matt" in __main__.py 4 weeks ago
.gitignore First commit 1 month ago
LICENSE First commit 1 month ago
README.md Converted README to markdown 1 month ago
poetry.lock Removed dependency on readline 4 weeks ago
pyproject.toml Updated version number 4 weeks ago

README.md

Matt

Matt is a free software (licensed under the GNU GPL v3 (or later)) maths test program. “Matt” (or “MATT”) is a recursive acronym for “MATT Arithmetic Training Test”.

Installation

Matt depends on:

There are 2 methods of installation: via poetry and via pip:

Installation via poetry

Poetry should handle the installation of dependencies. To install, first clone the git repository, then run:

poetry install

Installation via pip

Pip should handle the installation of dependencies. To install, run:

python3 -m pip install matt

Usage

Run python3 -m matt -h for help. Matt accepts the following arguments:

  • --difficulty or -d to set the difficulty (in the format “:”). The default namespace is reserved for the default difficulties. If unspecified the default is default:1.
  • --operations or -o to set the available operations. Operations are seperated by commas, the available operations are:
    • +: Addition
    • -: Subtraction
    • *: Multiplication
    • /: Division Example: -o +,- to enable only addition and subtraction.
  • --minimum or -m to set the minumum, default (if not specified in difficulty): 0.
  • --maximum or -M to set the maximum, default (if not specified in difficulty): 10. NOTE: The maximum must not be equivalent to the minimum.

Config

Matt has a configuration file, it is written in Python, and located at $XDG_CONFIG_HOME/matt/config.py. By default $XDG_CONFIG_HOME is set to ~/.config, so if you have not set it then it is probably ~/.config/matt/config.py.

The configuration must provide a difficulty function that accepts 2 parameters:

  • namespace (str): The namespace of the difficulty.
  • number (int): The number of the difficulty.

The difficulty function must return a dict.

A simple example is:

def difficulty(namespace: str, number: int) -> dict:
    if namespace == "manual":
       if number == 1:
           return {
               "operations": ["+", "-"],
               "maximum": 20,
               "minimum": 10
           }

Due to the config file being written in Python, it is extemely configurable, for example:

def difficulty(namespace: str, number: int) -> dict:
    if namespace == "automatic":
        return {
            "operations": ["+", "-", "*", "/"],
            "maximum": number * 10
        }