Swiftpack.co - jwamin/Arcan.a as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jwamin.
jwamin/Arcan.a v0.0.1
The Tarot - in C
⭐️ 0
🕓 1 week ago
.package(url: "https://github.com/jwamin/Arcan.a.git", from: "v0.0.1")

Arcan.a

C Static Library for the Tarot

Img

Welcome to Arcan.a
Your 10-card tarot reading:
Card 1: Key 60 is in the Minor Arcana: The Paige of Swords, isInverted: 0
Card 2: Key 45 is in the Minor Arcana: The 10 of Cups, isInverted: 1
Card 3: Key 43 is in the Minor Arcana: The 8 of Cups, isInverted: 0
Card 4: Key 9 is in the MAJOR ARCANA: IX: THE HERMIT, isInverted: 1
Card 5: Key 71 is in the Minor Arcana: The 8 of Pentacles, isInverted: 1
Card 6: Key 41 is in the Minor Arcana: The 6 of Cups, isInverted: 1
Card 7: Key 74 is in the Minor Arcana: The Paige of Pentacles, isInverted: 1
Card 8: Key 41 is in the Minor Arcana: The 6 of Cups, isInverted: 1
Card 9: Key 65 is in the Minor Arcana: The 2 of Pentacles, isInverted: 1
Card 10: Key 68 is in the Minor Arcana: The 5 of Pentacles, isInverted: 0
Best of luck!

Process finished with exit code 0

Features

Cards

  • Generate Deck

  • Shuffle Deck with Fisher-Yeates

  • Identify card from index 0-77

  • Randomly assign inversion for card

Dealing

  • Extract chosen court card
    • Shuffle remaining deck
  • Deal top 10 cards

API

  • Swift Package - simply hit this repo with Xcode / swiftpm
    • swift build
    • swift run ArcanaDriver

Cross-platform

  • Cmake Project for WSL/Linux imports arc4random_uniform from bsd.h
  • swiftpm system module for bsd.h

Driver Program

  • Interactive CLI
    • getchar() used to stagger reveal of cards.

TODO

  • C Source cleanup

  • Refine Swift Interface

    • Wrapper to be used in GUI
  • Analyse reading (primarily suits / major arcana etc)

GitHub

link
Stars: 0
Last commit: 5 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics