Read Mode

[Batch Game] BatchPoker by JohnBatch | Batch is a Fun Language ♥

[Batch Game] BatchPoker by JohnBatch | Batch is a Fun Language ♥
[Batch Game] - And, I blew all my money @ Once!
BatchPoker by JohnBatch: BatchPoker is an amazing 17 Kbs of Batch Game, Created by JohnBatch. Which is quite simple and great to Play Card Game. It uses almost No External Batch Plugin, But Prints the Different Cards layout on the CMD via reading from different Database Files. But, Doing this much amazing things on the Boring CMD console is quite an achievement. If you've ever played a Card Game in any other platform before. Then you can easily play this one.

Because of Using the Pure Batch Programming for this Game - It contains some limitations of the batch too. The Only difference will be in the Gameplay you'll see that, You need to provide various inputs from the keyboard. But, it worth the joy of playing an awesome Game like this one. You will get a Download link in this article for trying this game. In the download link - there will be simple Batch File - Source code of the Project. And, You can directly execute it by double clicking. Here's a little description of the project by The Main Author - JohnBatch.

The BatchPoker by JohnBatch 🙆

[Batch Game] BatchPoker by JohnBatch | Batch is a Fun Language ♥
Non-Aesthetic Output of Game
As you can see in the screenshot of the Game Above - It is a simple Card game in batch. Based on pure calculations. But, the layout and representation of the Data makes it extra ordinary. While working on this project with JohnBatch. We Faced a problem of Showing the Playing cards Side-ways (as in the screenshot above) instead of One over the other. 

And, Because the ASCII Images of the cards are in the separate files. We could not directly put them manually in a Single file. Because, Doing  test with 52 Files is not an easy task. If the test fails - we need to restore all the 52 files and all the handwork of modifying the files will go in vain.

Thus, After JohnBatch asked me about the problem. I Decided to make a Function - which will dynamically read all the required files and Display them on console as per our need.

Learning is the Key to Greatness:

You can See this function in the End of the Whole Main Code. If you want to learn more about tackling such problems in your projects. Then, This one will be very helpful in understanding the concept of Reading and Manipulating the Database Files (Text files), as per our own requirements.
Although, The main code of the Game contains lots of learning too. You can analyze the code by your own. If you'll find any problem in any phase, You can comment in below of this article. We'll try to help you out with your query.

Description of the Game - From Heart of Author 💓

The objective of the game is to make as much money as possible betting on hands of poker. The player wins if they draw a pair, two pair, trips, a flush, or a fullhouse. (would also like to add straights and four of a kind - with suggestions)

  • A pair is when one of the player's cards matches one of the cards on the table.
  • Two pair is when the player's first card and second card match a card on the table but not each other
    For example:
    • The player is dealt an Ace and a King and Then an Ace and a King are on the table.
  • Trips is when one of the players cards matches two of the cards on the table
    For example:
    • The player is dealt a Three and a Four and then two Fours are on the table
  • Trips can also occur when the player is dealt a pair and then a matching card is on the table
    For example:
    • The player is dealt a Ten and a Ten and there is a Ten on the table
  • A flush is when five of the cards suits match.  The suits include Spades, Clubs, Hearts, and Diamonds.For example:
    • The player is dealt the Five of Spades and the Six of Spades and then the Ten of Spades, Jack of Spades, and Queen of Spades is on the table.
  • A fullhouse is having trips and a pair at the same time.

You can download this amazing game and try your hands with the gambling. Make alot of money and try your luck. I'm not so good at it. Because, I'm not one of those people who'll like to play it safe. I'll either double my money or get nothing at all. And, Life goes on! I think, that is the real pleasure of gambling. Because, Life is too short to play it safe.

In the end, I Hope - You've liked this amazing work of JohnBatch in the field of batch programming. If you are in doubt with any aspect of game. You can leave a Comment below. And, Here's the Link for online Virus Scanning Report for this File. It will assure you that your system will be safe when You are enjoying the Game. Thanks for your time. Happy Coding!

Keep Learning, Keep Sharing...
Be Happy, Spread Happiness...

Download Link
BatchPoker By JohnBatch


  1. Four of a kind:
    setlocal enabledelayedexpansion
    set "foknd=0"
    set "chkcard=%card% %cardd% %fcard% %fcard2% %fcard3% %tcard% %rcard%"
    for %%a in (%chkcard%) do (
    if not defined foknd for /f "tokens=1-4" %%b in ("!chkcard:%%a=!") do if "%%e" equ "" set foknd=1
    if %foknd% equ 1 echo Four of a kind

    Mailed you about the script too.


    1. I've also mailed you about the straight.


  2. can't found the card error? , work not

    1. Hi Lego!
      We've Seen your comment and re-downloaded the game and tried again In Our system (i-3 5th Gen, 4 GB, 2 GHz) But, Didn't got such error! The Game is working fine. We think, You should learn to extract the zip file to a folder first. And, Then Try to run it. :p

    2. i know how to extract :D but ok

    3. Lego it sounds like you might have taken the .txt files which contain the cards and taken them out of their original folder/renamed the folder. It is crucial that you do not move around or rename file/folder names.


Powered by Blogger.