<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wihan Barnard</title>
    <description>The latest articles on DEV Community by Wihan Barnard (@wihan_barnard_9057e111e75).</description>
    <link>https://dev.to/wihan_barnard_9057e111e75</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3911537%2F448ab7b7-b1aa-4d69-8b80-1db8edf2b6e7.png</url>
      <title>DEV Community: Wihan Barnard</title>
      <link>https://dev.to/wihan_barnard_9057e111e75</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wihan_barnard_9057e111e75"/>
    <language>en</language>
    <item>
      <title>My Blackjack Terminal game</title>
      <dc:creator>Wihan Barnard</dc:creator>
      <pubDate>Mon, 04 May 2026 07:41:58 +0000</pubDate>
      <link>https://dev.to/wihan_barnard_9057e111e75/my-blackjack-terminal-game-4pfj</link>
      <guid>https://dev.to/wihan_barnard_9057e111e75/my-blackjack-terminal-game-4pfj</guid>
      <description>&lt;p&gt;Introduction: Why Blackjack?&lt;br&gt;
When I started learning Python, I wanted a project that was both fun and practical. Blackjack felt like the perfect choice — it’s simple enough to code as a beginner, but still requires logic, randomness, and decision-making. Plus, who doesn’t enjoy a quick card game?&lt;/p&gt;

&lt;p&gt;How the Game Works&lt;br&gt;
The program simulates a classic round of Blackjack right in the terminal. Here’s what I built step by step:&lt;/p&gt;

&lt;p&gt;Deck creation &amp;amp; shuffling: A full 52-card deck is generated and randomized.&lt;/p&gt;

&lt;p&gt;Hand values: Face cards count as 10, Aces can be 1 or 11 depending on the situation.&lt;/p&gt;

&lt;p&gt;Gameplay loop: The player starts with chips, places bets, and plays against the dealer.&lt;/p&gt;

&lt;p&gt;Win conditions: The game checks for busts, blackjacks, and compares totals to declare a winner.&lt;/p&gt;

&lt;p&gt;This project helped me practice Python fundamentals like loops, functions, and conditionals, while also teaching me how to structure a larger program.&lt;/p&gt;

&lt;p&gt;Visuals&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumgsda112n91tnguxk7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumgsda112n91tnguxk7h.png" alt=" " width="800" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Code&lt;br&gt;
I won’t paste the entire script here, but the highlights include:&lt;/p&gt;

&lt;p&gt;A create_deck(&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ew9pyvgu2siqrmq0mar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ew9pyvgu2siqrmq0mar.png" alt=" " width="619" height="117"&gt;&lt;/a&gt;&lt;br&gt;
) function that builds and shuffles the deck.&lt;/p&gt;

&lt;p&gt;A calculate_hand_value(&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6bp3l5cil1ws3jwupmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6bp3l5cil1ws3jwupmn.png" alt=" " width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;) function that handles tricky Ace logic.&lt;/p&gt;

&lt;p&gt;If you’d like to dive into the full code, check it out on GitHub:&lt;br&gt;
👉 &lt;a href="https://github.com/Wihannn/BlackJack-Terminal-Game" rel="noopener noreferrer"&gt;https://github.com/Wihannn/BlackJack-Terminal-Game&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
This project was a great way to bring Python concepts to life. I learned how to break down a game into smaller functions, handle edge cases like multiple Aces, and keep track of state across rounds.&lt;/p&gt;

&lt;p&gt;Next steps? I’d love to add features like:&lt;/p&gt;

&lt;p&gt;A betting system with chip management.&lt;/p&gt;

&lt;p&gt;ASCII art cards for a more visual experience.&lt;/p&gt;

&lt;p&gt;Multiplayer support.&lt;/p&gt;

&lt;p&gt;If you’re learning Python, I highly recommend trying a card game project — it’s a fun challenge that teaches you a lot about programming logic.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
