{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#|hide\n", "from nbdev_cards.card import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# nbdev_cards\n", "\n", "> A sample of how to create a deck of cards lib using nbdev" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A deck of cards demo of [nbdev](https://nbdev.fast.ai) based on ideas from [Think Python 2nd Edition](https://greenteapress.com/wp/think-python-2e/) by Allen B. Downey." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Install" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Install using:\n", "\n", " pip install nbdev-cards\n", "\n", "or:\n", "\n", " conda install -c fastai nbdev-cards" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## How to use" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This lib provides a `Card` class you can use to create, display, and compare playing cards:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3♦️" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Card(1,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Suits are numbered according to this list:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['♣️', '♦️', '❤️', '♠️']" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "suits" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 4 }