Skip to main content

Generate boards for the game boggle

Project description

Boggle

This project generates boards for the game boggle.

codecov Pipeline Status

Installation

This package can be installed using pip.

pip install boggle

Usage

CLI

This package exposes the boggle command in a shell.

$ boggle --help
Usage: boggle [OPTIONS]

Options:
  -s, --seed TEXT  A key to create a board from
  --help           Show this message and exit.

If a seed valaue is not provided, a random board will be returned:

$ boggle
╒═══╤═══╤═══╤═══╕
│ R  S  P  L │
├───┼───┼───┼───┤
│ N  H  I  L │
├───┼───┼───┼───┤
│ N  T  A  W │
├───┼───┼───┼───┤
│ B  U  U  T │
╘═══╧═══╧═══╧═══╛
$ boggle
╒═══╤═══╤═══╤═══╕
│ R  F  M  B │
├───┼───┼───┼───┤
│ A  N  N  R │
├───┼───┼───┼───┤
│ T  E  R  S │
├───┼───┼───┼───┤
│ S  D  T  T │
╘═══╧═══╧═══╧═══╛

If a seed value is provided, a board will be generated deterministically from the seed value:

$ boggle -s 'fish'
╒═══╤═══╤═══╤═══╕
│ T  F  R  O │
├───┼───┼───┼───┤
│ E  C  E  W │
├───┼───┼───┼───┤
│ H  E  J  Y │
├───┼───┼───┼───┤
│ T  N  V  W │
╘═══╧═══╧═══╧═══╛
$ boggle -s 'fish'
╒═══╤═══╤═══╤═══╕
│ T  F  R  O │
├───┼───┼───┼───┤
│ E  C  E  W │
├───┼───┼───┼───┤
│ H  E  J  Y │
├───┼───┼───┼───┤
│ T  N  V  W │
╘═══╧═══╧═══╧═══╛
$ boggle -s 'hamster'
╒═══╤═══╤═══╤═══╕
│ E  O  B  T │
├───┼───┼───┼───┤
│ V  T  E  H │
├───┼───┼───┼───┤
│ G  E  E  H │
├───┼───┼───┼───┤
│ W  U  P  F │
╘═══╧═══╧═══╧═══╛
$ boggle -s 'hamster'
╒═══╤═══╤═══╤═══╕
│ E  O  B  T │
├───┼───┼───┼───┤
│ V  T  E  H │
├───┼───┼───┼───┤
│ G  E  E  H │
├───┼───┼───┼───┤
│ W  U  P  F │
╘═══╧═══╧═══╧═══╛

Python Package

Import the boggle() method from the boggle package:

from boggle import boggle

This method will return a list of 16 boggle characters (including Qu). These are intended to be arranged into a square of four characters by four characters.

If a seed value is not provided, a random board will be returned:

>>> from boggle import boggle
>>> boggle()
['B', 'A', 'S', 'T', 'H', 'U', 'M', 'H', 'R', 'P', 'E', 'R', 'O', 'T', 'O', 'N']
>>> boggle()
['A', 'E', 'T', 'L', 'E', 'E', 'W', 'D', 'E', 'D', 'J', 'T', 'Y', 'I', 'O', 'F']
>>> boggle()
['E', 'S', 'Y', 'F', 'V', 'X', 'N', 'Y', 'H', 'O', 'E', 'U', 'T', 'T', 'N', 'O']

If a seed value is provided, a board will be generated deterministically from the seed value:

>>> from boggle import boggle
>>> boggle('fish')
['T', 'F', 'R', 'O', 'E', 'C', 'E', 'W', 'H', 'E', 'J', 'Y', 'T', 'N', 'V', 'W']
>>> boggle('fish')
['T', 'F', 'R', 'O', 'E', 'C', 'E', 'W', 'H', 'E', 'J', 'Y', 'T', 'N', 'V', 'W']
>>> boggle('hamster')
['E', 'O', 'B', 'T', 'V', 'T', 'E', 'H', 'G', 'E', 'E', 'H', 'W', 'U', 'P', 'F']
>>> boggle('hamster')
['E', 'O', 'B', 'T', 'V', 'T', 'E', 'H', 'G', 'E', 'E', 'H', 'W', 'U', 'P', 'F']

© Max Levine 2022

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boggle-0.1.2.tar.gz (15.4 kB view hashes)

Uploaded Source

Built Distribution

boggle-0.1.2-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page