A small Java library to print ASCII art playing cards in the terminal. Works in any environment — no Unicode symbols required, just plain ASCII. Perfect for text-based card games, demos, or fun terminal applications.
- Print one or multiple cards side by side.
- Supports both arrays and varargs of
Cardobjects. - Fully ASCII-based — works in any terminal.
- Easy-to-extend card art stored in
resources/cards/cards.json. - Simple API for integrating into your projects.
Clone the repository:
git clone https://github.com/yourusername/ASCII_CardGenerator.git
cd ASCII_CardGeneratorCompile the source:
javac src/*.javaRun the demo:
java -cp src DemoCard c1 = new Card("A+");
Card c2 = new Card("AO");
Card c3 = new Card("K+");// Using varargs
CardPrinter.print(c1, c2, c3);
// Using an array
Card[] hand = { c1, c2, c3 };
CardPrinter.print(hand); _________ _________ _________
|A | |A | |K |/|\| |
|+ * | |O /~\ | |+ /o,o\ |
| ! | | / ^ \ | | \_-_/ |
| *-+-* | | ( <O> ) | | ~-_-~-_ |
| | | | \ v / | | /~-~\ |
| ~~~ +| | \_/ O| | \o`o/ +|
| V| | V| | |\|/| X|
~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~
.
├── ASCI_Art.txt
├── resources
│ └── cards
│ └── cards.json # ASCII art definitions
└── src
├── Card.java # Card model
├── CardArt.java # ASCII art loader
├── CardPrinter.java # Print utility
├── Demo.java # Demo / example usage
├── Rank.java # Card ranks
└── Suit.java # Card suits
Contributions are welcome!
- Add new card art or card sets under
resources/cards/. - Improve the printer alignment or add features.
- Report bugs or suggest features via GitHub Issues.
This project is licensed under the MIT License.