Skip to main content

Encrypts/decrypts messages and includes games of Rock, Paper, Scissors (RPS) and Snake, Water, Gun (SWG).

Project description

flexitools Module

The flexitools module provides various utility functions, including text encryption/decryption and fun interactive games. Below are the detailed descriptions of the available functions:

enc Function

The enc function encrypts a given plaintext message using a custom algorithm. This function is ideal for obfuscating sensitive information before storing or transmitting it.

How to Use

Import the module:

import flexitools

message = "Hello, World!" encrypted_message = flexitools.enc(message) print(f"Encrypted Message: {encrypted_message}")

dec Function

The dec function decrypts a previously encrypted message back into its original plaintext form. This function is essential for reading messages that were encrypted using the enc function.

How to Use

Import the module:

import flexitools

Decrypt a message:

encrypted_message = "EncryptedMessageHere" decrypted_message = flexitools.dec(encrypted_message) print(f"Decrypted Message: {decrypted_message}")

RPS Function

The RPS function is a classic game of Rock, Paper, Scissors. This timeless game is a great way to settle simple disputes or just have some fun. Each choice beats one of the other two options:

Rock (0): Rock crushes Scissors but is covered by Paper. Paper (1): Paper covers Rock but is cut by Scissors. Scissors (2): Scissors cut Paper but are crushed by Rock.

How to Play

Call the RPS() function to start the game. The function will prompt you to choose between Rock, Paper, and Scissors.

Enter your choice as follows:

0 for Rock 1 for Paper 2 for Scissors

The function will then randomly select its own choice. The function will compare the two choices and determine the winner based on the rules above. The result of the game will be displayed, showing whether you won, lost, or if it was a tie.

Example

import flexitools

result = flexitools.RPS() print(result) # Start the game

SWG Function

The SWG function is a simple, fun, and interactive game inspired by the classic rock-paper-scissors. In this game, you have three choices: Snake, Water, and Gun. Each choice beats one of the other two options:

Snake (0): Snake drinks Water but is shot by Gun. Water (1): Water douses Gun but is drunk by Snake. Gun (2): Gun shoots Snake but is doused by Water.

How to Play

Call the SWG() function to start the game. The function will prompt you to choose between Snake, Water, and Gun.

Enter your choice as follows:

0 for Snake 1 for Water 2 for Gun

The function will then randomly select its own choice. The function will compare the two choices and determine the winner based on the rules above. The result of the game will be displayed, showing whether you won, lost, or if it was a tie.

Example

import flexitools

result = flexitools.SWG() print(result) # Start the game

Summary

The flexitools module's enc and dec functions provide a straightforward way to secure your messages through encryption and decryption. Additionally, the module includes the RPS and SWG functions for some lighthearted entertainment. These functions are easy to use and integrate into your projects, ensuring that your sensitive information remains protected and offering a fun diversion when needed.

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

flexitools-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flexitools-0.1.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file flexitools-0.1.3.tar.gz.

File metadata

  • Download URL: flexitools-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for flexitools-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5709cc9b2e9da51956aad8491c63323b7143777de229a6068fbed2aa32f29ee5
MD5 263d719978ce41ccc5b71ec79255dc43
BLAKE2b-256 594b94b8783d22973c17f5bc58e4ce48e7dd37b9e663ce8a58c7e622ba3895f9

See more details on using hashes here.

File details

Details for the file flexitools-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: flexitools-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for flexitools-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f293a5e2bde4cb6b1bb113f6db94e21629f85112ae17f11d32803e6ad54dda7
MD5 1d6380187b5b7103387f6f6273c0c0cf
BLAKE2b-256 f570d2d1757756bc882b10f3213366f66141a139644da54c05ca74894800bf83

See more details on using hashes here.

Supported by

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