Skip to content

Instantly share code, notes, and snippets.

@tonytins
Created November 4, 2024 16:44
Show Gist options
  • Save tonytins/2a54835b9f3a956924f0e8de768d633f to your computer and use it in GitHub Desktop.
Save tonytins/2a54835b9f3a956924f0e8de768d633f to your computer and use it in GitHub Desktop.
Tarot
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
public class Card
{
[JsonPropertyName("Name")]
public string Name { get; set; }
[JsonPropertyName("Number")]
public int Number { get; set; }
[JsonPropertyName("Reading")]
public Reading Reading { get; set; }
[JsonPropertyName("Hint")]
public string Hint { get; set; }
}
public class Reading
{
[JsonPropertyName("Upright")]
public string Upright { get; set; }
[JsonPropertyName("Reversed")]
public string Reversed { get; set; }
}
public class JsonParser
{
public static List<Card> ParseJson(string jsonString)
{
return JsonSerializer.Deserialize<List<Card>>(jsonString);
}
public static string WriteJson(List<Card> cards)
{
return JsonSerializer.Serialize(cards, new JsonSerializerOptions { WriteIndented = true });
}
}
[
{
"Name": "The Fool",
"Number": 0,
"Reading": {
"Upright": "Embrace a fresh start, approaching life with open curiosity and playful optimism.",
"Reversed": "Hesitation or doubt about stepping into the unknown, caution against reckless enthusiasm."
},
"Hint": "Leap forward, but look where you land."
},
{
"Name": "The Magician",
"Number": 1,
"Reading": {
"Upright": "Harness your skills and resources to create something meaningful, trusting your power to shape reality.",
"Reversed": "Beware of misusing talents or spreading energy too thin; clarity is needed to avoid confusion."
},
"Hint": "Your energy creates the world around you."
},
{
"Name": "The High Priestess",
"Number": 2,
"Reading": {
"Upright": "Tap into your intuition and inner wisdom, listening to your instincts and secrets that lie within.",
"Reversed": "You may be ignoring inner guidance or truths that need to be acknowledged; take time for quiet reflection."
},
"Hint": "Trust the quiet voice within."
},
{
"Name": "The Empress",
"Number": 3,
"Reading": {
"Upright": "Foster growth, nurture relationships, and connect with nature for peace and abundance.",
"Reversed": "Risk of overindulgence or dependency; find balance in caring for others without neglecting yourself."
},
"Hint": "Tend your own garden before others."
},
{
"Name": "The Emperor",
"Number": 4,
"Reading": {
"Upright": "Establish structure, stability, and lead with authority and confidence.",
"Reversed": "A tendency toward inflexibility or excessive control; allow room for adaptability."
},
"Hint": "Stand firm but know when to yield."
},
{
"Name": "The Hierophant",
"Number": 5,
"Reading": {
"Upright": "Seek wisdom in tradition and community, learning from shared experiences and mentors.",
"Reversed": "Consider challenging conventions that no longer serve you; find your own path."
},
"Hint": "Respect the past but look to the future."
},
{
"Name": "The Lovers",
"Number": 6,
"Reading": {
"Upright": "Embrace harmony in partnerships, aligning with those who resonate with your values.",
"Reversed": "Misalignment or strain in relationships; seek understanding to restore balance."
},
"Hint": "Balance the \"we\" with the \"me.\""
},
{
"Name": "The Chariot",
"Number": 7,
"Reading": {
"Upright": "Drive forward with determination and confidence, navigating life’s challenges with focus.",
"Reversed": "Lack of direction or feeling stalled; reassess goals and find inner motivation to move forward."
},
"Hint": "Focus your will, and stay on course."
},
{
"Name": "Strength",
"Number": 8,
"Reading": {
"Upright": "Draw on inner strength and patience, approaching obstacles with quiet resilience.",
"Reversed": "Self-doubt or internal conflict may arise; trust in your ability to overcome."
},
"Hint": "True power comes from within."
},
{
"Name": "The Hermit",
"Number": 9,
"Reading": {
"Upright": "Seek solitude for introspection and personal discovery, turning inward for clarity.",
"Reversed": "Isolation may lead to loneliness; consider reaching out or sharing your journey with others."
},
"Hint": "Turn inward, but don't stay lost."
},
{
"Name": "The Wheel of Fortune",
"Number": 10,
"Reading": {
"Upright": "Accept the cycles of life, recognizing that change brings new opportunities and growth.",
"Reversed": "Resistance to inevitable change may cause distress; let go and trust the flow."
},
"Hint": "Embrace the ebb and flow of life."
},
{
"Name": "Justice",
"Number": 11,
"Reading": {
"Upright": "Strive for fairness, balance, and truth, ensuring your actions align with integrity.",
"Reversed": "Imbalance or unfairness in a situation; reevaluate actions and choices."
},
"Hint": "Seek clarity, align with integrity."
},
{
"Name": "The Hanged Fennec",
"Number": 12,
"Reading": {
"Upright": "Let go of control and see things from a fresh perspective, allowing for inner peace.",
"Reversed": "Resistance to releasing control or reluctance to shift perspective; find patience."
},
"Hint": "Sometimes release is the best choice."
},
{
"Name": "Death",
"Number": 13,
"Reading": {
"Upright": "Embrace transformation and the end of old cycles, making room for new growth.",
"Reversed": "Fear of letting go or clinging to the past; recognize when it’s time to move on."
},
"Hint": "The end opens the door for new beginnings."
},
{
"Name": "Temperance",
"Number": 14,
"Reading": {
"Upright": "Achieve balance and harmony by blending opposing forces in life, finding the middle path.",
"Reversed": "Excess or extremes may create instability; seek moderation to restore peace."
},
"Hint": "Blend opposites for something new."
},
{
"Name": "The Star",
"Number": 15,
"Reading": {
"Upright": "Find hope and renewal through faith, letting go of past hurts to embrace optimism.",
"Reversed": "Disillusionment or loss of direction; reconnect with your dreams and aspirations."
},
"Hint": "Trust the light even in darkness."
},
{
"Name": "The Moon",
"Number": 16,
"Reading": {
"Upright": "Embrace dreams and intuition, but be cautious of illusions and hidden fears.",
"Reversed": "Anxiety or confusion may cloud judgment; seek clarity to dispel uncertainty."
},
"Hint": "Let go of fears, and see things clearly."
},
{
"Name": "The Sun",
"Number": 17,
"Reading": {
"Upright": "Bask in joy, warmth, and positivity; celebrate the simplicity and beauty of life.",
"Reversed": "Temporary setbacks or clouded vision; remember the light even in dark times."
},
"Hint": "Celebrate life and embrace simplicity."
},
{
"Name": "Judgment",
"Number": 18,
"Reading": {
"Upright": "Reflect and renew yourself, finding closure and growth from past experiences.",
"Reversed": "Self-doubt or resistance to change may hinder growth; accept the past to move forward."
},
"Hint": "Look back to move forward."
},
{
"Name": "The World",
"Number": 19,
"Upright": "Enjoy a sense of completion, wholeness, and fulfillment, celebrating your journey.",
"Reversed": "Unfinished business or feeling incomplete; assess what still needs closure.",
"Hint": "The journey is as important as the destination."
},
{
"Name": "The Ace of Waves",
"Number": 20,
"Reading": {
"Upright": "Open up to new emotional experiences, trusting your instincts and feelings.",
"Reversed": "Emotional blockages or unfulfilled needs; allow yourself to express openly."
},
"Hint": "Allow emotions to flow freely."
},
{
"Name": "The Two of Branches",
"Number": 21,
"Reading": {
"Upright": "Consider your choices with foresight, exploring possibilities with confidence.",
"Reversed": "Indecision or overwhelm; take time to weigh options carefully."
},
"Hint": "Consider each path carefully."
},
{
"Name": "The Three of Stones",
"Number": 22,
"Reading": {
"Upright": "Collaborate and build skills together; teamwork is essential for success.",
"Reversed": "Conflicts or lack of teamwork may create obstacles; prioritize harmony."
},
"Hint": "Build with others to achieve greatness."
},
{
"Name": "The Four of Spirits",
"Number": 23,
"Reading": {
"Upright": "Celebrate stability, unity, and shared joy with friends and family.",
"Reversed": "Domestic or interpersonal discord may arise; focus on restoring harmony."
},
"Hint": "Find joy in shared moments."
},
{
"Name": "The Five of Stars",
"Number": 24,
"Reading": {
"Upright": "Face conflicts or struggles openly, viewing them as opportunities for growth.",
"Reversed": "Resolution or compromise may be needed to ease tension; communicate openly."
},
"Hint": "Embrace challenges as growth opportunities."
},
{
"Name": "The Six of Leaves",
"Number": 25,
"Reading": {
"Upright": "Transition to a better place or mindset, moving on from past difficulties.",
"Reversed": "Resistance to change may hinder progress; embrace new possibilities."
},
"Hint": "Keep moving forward, even if it feels hard."
},
{
"Name": "The Seven of Waters",
"Number": 26,
"Reading": {
"Upright": "Explore your dreams and aspirations, considering all your options before making a choice.",
"Reversed": "Overwhelmed by too many choices or unrealistic expectations; focus on practical decisions."
},
"Hint": "Dream big, but keep one foot on the ground."
},
{
"Name": "The Ten of Paths",
"Number": 27,
"Reading": {
"Upright": "Persevere through challenges, carrying your burdens to reach your goals.",
"Reversed": "Overburdened or feeling isolated; share the load when it becomes too heavy."
},
"Hint": "Share the weight when the journey gets tough."
},
{
"Name": "The Spirit of the Woods",
"Number": 28,
"Reading": {
"Upright": "Find guidance and wisdom in nature, grounding yourself in the stability of the natural world.",
"Reversed": "Disconnected from nature or neglecting self-care; take time to reconnect with your roots."
},
"Hint": "Ground yourself to grow strong."
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment