8000 GitHub - Jejis06/Randomer: random site with random things
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jejis06/Randomer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Randomer ๐ŸŽฒ

A Flask web application that generates deterministic content from any text input. Same input, same output, every time! Visit it at: https://jejis.pythonanywhere.com/

๐ŸŒŸ Features

Randomer transforms any text into a variety of unique, deterministic content:

๐ŸŽฏ Core Features

  • Dice Rolls: Generate deterministic dice rolls for D3, D5, D6, D8, D10, D12, and D20
  • Chess Positions: Create unique chess positions with Stockfish evaluation and best moves
  • Color Patterns: Generate harmonious color palettes with RGB, HEX, HSL, HSV, and CMYK formats
  • Random Maze: Create solvable mazes using depth-first search algorithm
  • Pixel Art: Generate 16x16 pixel art with various patterns and symmetries
  • Poker Hands: Draw 5-card poker hands with automatic hand evaluation
  • Minesweeper: Play unique Minesweeper layouts with consistent mine placement
  • Word Generator: Get random words with definitions in multiple languages
  • Minecraft Seeds: Generate Minecraft world seeds with ChunkBase integration
  • Abstract Images: Create unique algorithmic art with complex patterns

๐ŸŽจ UI Features

  • Dark/Light Mode: Toggle between themes with persistent preferences
  • Responsive Design: Works seamlessly on desktop, tablet, and mobile
  • Interactive Elements: Hover effects, animations, and smooth transitions
  • Clean Homepage: Overview of all features with easy navigation

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.7+
  • Stockfish chess engine (optional, for chess features)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/randomer.git
    cd randomer
  2. Install dependencies

    pip install -r requirements.txt
  3. Install Stockfish (optional)

    Stockfish is required for chess position evaluation. Choose your installation method:

    macOS:

    # Using Homebrew (recommended)
    brew install stockfish
    
    # Using MacPorts
    sudo port install stockfish
    
    # Manual installation
    # Download from https://stockfishchess.org/download/mac/
    # Extract and add to PATH

    Ubuntu/Debian:

    # Using apt package manager
    sudo apt-get update
    sudo apt-get install stockfish
    
    # Or download latest version manually
    wget https://github.com/official-stockfish/Stockfish/releases/latest/download/stockfish_15_linux_x64_avx2.tar.gz
    tar -xzf stockfish_15_linux_x64_avx2.tar.gz
    sudo cp stockfish_15_linux_x64_avx2/stockfish_15_linux_x64_avx2 /usr/local/bin/stockfish

    CentOS/RHEL/Fedora:

    # Using dnf (Fedora)
    sudo dnf install stockfish
    
    # Using yum (CentOS/RHEL)
    sudo yum install stockfish
    
    # Or compile from source
    sudo yum groupinstall "Development Tools"
    git clone https://github.com/official-stockfish/Stockfish.git
    cd Stockfish/src
    make build ARCH=x86-64-modern
    sudo cp stockfish /usr/local/bin/

    Arch Linux:

    # Using pacman
    sudo pacman -S stockfish
    
    # Using AUR
    yay -S stockfish-git

    Windows:

    # Using Chocolatey
    choco install stockfish
    
    # Using Scoop
    scoop install stockfish
    
    # Manual installation:
    # 1. Download from https://stockfishchess.org/download/windows/
    # 2. Extract stockfish.exe to a folder
    # 3. Add folder to PATH environment variable
    # 4. Or place stockfish.exe in your project directory

    Docker (Cross-platform):

    # Pull Stockfish Docker image
    docker pull niklasf/stockfish:latest
    
    # Run Stockfish in container
    docker run --rm -i niklasf/stockfish:latest

    Verification:

    # Test if Stockfish is properly installed
    stockfish
    # Should show Stockfish version and UCI prompt
    # Type 'quit' to exit

    Troubleshooting:

    • If stockfish command not found, check if it's in your PATH
    • On Windows, you may need to use full path: C:\path\to\stockfish.exe
    • For permission issues on Linux/macOS: chmod +x stockfish
    • Alternative: Place stockfish binary in the same directory as app.py
  4. Run the application

    python app.py
  5. Open your browser Navigate to http://localhost:8080

๐Ÿ“– Usage

Basic Usage

  1. Visit the homepage at http://localhost:8080
  2. Enter any text in the input field
  3. Click "Generate Content" or press Enter
  4. Explore all the generated content for your text

Direct URL Access

You can also access content directly via URLs:

  • http://localhost:8080/hello - Generate content for "hello"
  • http://localhost:8080/my-custom-text - Generate content for "my-custom-text"
  • http://localhost:8080/๐ŸŽฎ - Even emojis work!

Image Generation

Get generated images directly:

  • http://localhost:8080/image/hello - Get the generated image for "hello"

๐Ÿ”ง How It Works

Randomer uses cryptographic hashing (SHA-256) to create deterministic seeds from input text. These seeds are then used to initialize Python's random module, ensuring that:

  1. Same input always produces same output
  2. Different inputs produce vastly different outputs
  3. Content appears random but is completely reproducible

Algorithm Flow

Input Text โ†’ SHA-256 Hash โ†’ Seed โ†’ Random Generator โ†’ Content

Example

import hashlib
import random

text = "hello"
hash_object = hashlib.sha256(text.encode())
seed = int.from_bytes(hash_object.digest(), byteorder='big')
random_gen = random.Random(seed)
# Now random_gen will always produce the same sequence for "hello"

๐ŸŽฎ Feature Details

Dice Rolls

  • Supports D3, D5, D6, D8, D10, D12, D20
  • Beautiful 3D-styled dice with hover effects
  • Color-coded for easy identification

Chess Positions

  • Generates valid chess positions using proper algorithms
  • Integrates with Stockfish for position evaluation
  • Shows best moves with visual arrows
  • Handles engine errors gracefully

Color Patterns

  • Creates harmonious color palettes using HSV color space
  • Displays complementary colors
  • Supports multiple color formats
  • Interactive color selection

Maze Generator

  • Uses depth-first search algorithm
  • Always generates solvable mazes
  • 15x15 cell mazes with entrance and exit
  • Responsive grid layout

Pixel Art

  • Four different pattern types:
    • Symmetrical patterns
    • Quarter symmetry
    • Radial patterns
    • Random walk patterns
  • Intelligent color palette generation
  • 16x16 pixel resolution

Poker Hands

  • Full 52-card deck simulation
  • Automatic hand evaluation
  • Supports all standard poker hands
  • Visual card representation with suits

Minesweeper

  • 10x10 grid with 15 mines
  • Interactive gameplay with left/right click
  • Mine counter and game status
  • Deterministic mine placement

๐Ÿ› ๏ธ API Endpoints

Endpoint Method Description
/ GET Homepage
/<text> GET Generate all content for text
/image/<text> GET Generate image for text
/health GET Health check endpoint

๐Ÿ“ฆ Dependencies

Core Dependencies

  • Flask: Web framework
  • Pillow (PIL): Image generation and manipulation
  • chess: Chess position handling and validation
  • requests: API calls for Pokรฉmon and dictionary data

Optional Dependencies

  • Stockfish: Chess engine for position evaluation

Full Requirements

Flask==2.3.3
Pillow==10.0.1
python-chess==1.999
requests==2.31.0

๐ŸŽจ Customization

Adding New Generators

  1. Create a generator function that takes seed_str as input
  2. Use SHA-256 to create a deterministic seed
  3. Initialize random.Random(seed) for deterministic randomness
  4. Add the generator to the main template

Modifying Existing Features

  • Color palettes: Modify the HSV ranges in generate_pixel_art()
  • Maze size: Change the width and height parameters in generate_maze()
  • Dice types: Add new dice to the dice list in get_dice_rolls()

๐ŸŒ Deployment

Local Development

python app.py

Production Deployment

# Using Gunicorn
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:8080 app:app

# Using Docker
docker build -t randomer .
docker run -p 8080:8080 randomer

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add docstrings to new functions
  • Ensure deterministic behavior for all generators
  • Test on multiple screen sizes
  • Maintain dark/light mode compatibility

๐Ÿ› Known Issues

  • Stockfish engine may fail to initialize on some systems
  • Large mazes may be slow to render on older devices
  • Some dictionary API calls may timeout

๐Ÿ”ฎ Future Features

  • Sudoku puzzle generator
  • QR code generation
  • Music note sequences
  • ASCII art generation
  • Fractal patterns
  • Random story generation
  • Color scheme exports
  • Maze solving animation

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Stockfish for the chess engine
  • PokรฉAPI for Pokรฉmon data
  • Free Dictionary API for word definitions
  • Chunkbase for Minecraft seed exploration
  • Google Fonts for the Roboto Mono font

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already reported
  3. Provide detailed information about your environment and the issue

Randomer - Making randomness reproducible, one hash at a time! โœจ

About

random site with random things

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0