Generate boards for the game boggle
Project description
Boggle
This project generates boards for the game boggle.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boggle-0.1.2.tar.gz.
File metadata
- Download URL: boggle-0.1.2.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.0-40-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28bfd0bd4ca7e11389d636e1af65e4893f1d5c07421bd3852ef56c81ccf06fb8
|
|
| MD5 |
a6b3ded04175b8355a1296f5acc8ea62
|
|
| BLAKE2b-256 |
fcaa5a3252fe91ac9816a9c2d9f6579438bb4efff350c89bdaa4739800b41dc3
|
File details
Details for the file boggle-0.1.2-py3-none-any.whl.
File metadata
- Download URL: boggle-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.0-40-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70fc58aea97b800a3098658c1b93b4a375b253c3be5ab0e22403a1a02962a57b
|
|
| MD5 |
8516d26f34e4732e7d7520aa93027eaa
|
|
| BLAKE2b-256 |
ed2087aba1ca90e031841b1bc6b8b87cf6d4906a38e856775f5673d0f5510b36
|