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.
 
 
Bastian (BaM) e3dc685891 Init 7 months ago
..
src Init 7 months ago
README.md Init 7 months ago
build.zig Init 7 months ago

README.md

Birth Date Finder Example

This example demonstrates how the Pi Finder Library is used to search for a birth date (01.01.02) in the decimal places of Pi.

Execution

cd birth-date-finder
zig build run

Additional Examples

This project includes two additional examples:

1. Multiple Test Example

zig build test-multiple

This example tests multiple different sequences and measures the performance.

2. Plain Text Format Example

zig build plain-text

This example demonstrates using the formatSearchResultAsPlainText function instead of the default JSON format.

Features

  • Searches for the sequence "010102" in Pi
  • Uses '-' as delimiter every 2 digits (01-01-02 format)
  • Outputs the result as JSON
  • Shows performance metrics

Example Output

JSON Output (Default)

{
  "success": true,
  "sequence": "010102",
  "position": 12345,
  "context": "...92[01-01-02]94...",
  "performance": {
    "file_load_time_ms": 1250.45,
    "search_time_ms": 23.67,
    "file_size_mb": 95.37,
    "load_speed_mbs": 76.28
  },
  "context_config": {
    "size": 50,
    "position": 25,
    "delimiter": "-",
    "delimiter_interval": 2,
    "prefix": "[",
    "suffix": "]"
  }
}

Plain Text Output (Using formatSearchResultAsPlainText)

Search Result:
Success: true
Sequence: 010102
Position: 12345
Context: ...92[01-01-02]94...