Simple Games

AID: 9009
  • Status: Published

6780 points

  • ByMartinLiss
  • TypeGeneral
  • Posted on2011-12-30 at 17:22:39
Awards
  • Experts Exchange Approved
Here are a few simple, working, games that you can use as-is or as the basis for your own games.

Tic-Tac-Toe
This is one of the simplest of all games.
 
Tic-Tac-Toe.zip
  • 2 KB
  • Tic-Tac-Toe (Two Player)
Tic-Tac-Toe.zip


The game allows for a choice of who goes first and keeps track of the number of wins for each person. Here is a picture of the game in action.
 
Tic-Tac-Toe.jpg
  • 20 KB
  • Two-Player game in action
Two-Player game in action

The following is a variation of the game that allows you to play against the computer (which can't be beaten).
 
Tic-Tac-Toe-VS-CPU.zip
  • 3 KB
  • Tic-Tac-Toe vs. Computer
Tic-Tac-Toe-VS-CPU.zip


Hangman
Hangman is also a simple game but depending on the word you need to solve, it can be challenging. The words used are in a file called SecretWords.txt and it's included in the zip file. You can of course add to or delete words in the list.
 
Hangman.zip
  • 73 KB
  • Hangman game
Hangman.zip


Here's a picture of the game in progress where the player is trying to solve the word 'elephant' and has incorrectly tried 'F'.
 
HangmanInProgess.JPG
  • 31 KB
  • Hangman in progress
Hangman in progress


Blackjack
The 3rd and last game is blackjack which you can download from
here.

The programming for this game is more complex than the other two and here is what the game looks like.
 
Blackjack.jpg
  • 58 KB
  • Blackjack
Blackjack

The game allows you to place a bet of any size up to the limit of your bankroll (which it shows you) and after you start the hand it gives you the chance to 'Hit', 'Stick', 'Double Down' (not shown). While the hand is in progress the game keeps track of your hand count (which in this case is 20) following the normal blackjack rule where an ace counts for either 1 or 11. Another rule it follows is that the dealer must continue to hit until his total is 17 or more.

The Options menu allows you to select the design for the back of the cards, the 'table' background color, the delay time between the dealing of each dealer's card, your starting bankroll, and the number of decks in play.

Finally, the following is a very stripped down version of the blackjack game which demonstrates how to use the card deck.
 
Card-Deck.zip
  • 1 KB
  • Basic card handling
Card-Deck.zip

It looks like this.
 
Simple.jpg
  • 31 KB
  • Simple
Simple
    Asked On
    2011-12-30 at 17:22:39ID9009
    Tags

    games

    ,

    blackjack

    ,

    hangman

    ,

    tic-tac-toe

    ,

    tictactoe

    Topic

    Visual Basic Programming

    Views
    1775

    Comments

    Expert Comment

    by: jquerynewbie on 2012-02-29 at 05:08:10ID: 44385

    The blackjack link is dead BTW

    Author Comment

    by: MartinLiss on 2012-02-29 at 06:40:45ID: 44386

    Thanks for letting me know. I've corrected the link.

    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top Visual Basic Classic Experts

    1. MartinLiss

      157,163

      Guru

      30 points yesterday

      Profile
      Rank: Wizard
    2. vb_elmar

      106,196

      Master

      4,000 points yesterday

      Profile
      Rank: Sage
    3. dlmille

      89,880

      Master

      0 points yesterday

      Profile
      Rank: Genius
    4. chris_bottomley

      44,900

      0 points yesterday

      Profile
      Rank: Genius
    5. imnorie

      44,400

      2,000 points yesterday

      Profile
      Rank: Genius
    6. GrahamSkan

      44,040

      0 points yesterday

      Profile
      Rank: Genius
    7. aikimark

      40,814

      2,020 points yesterday

      Profile
      Rank: Genius
    8. craisin

      38,300

      0 points yesterday

      Profile
      Rank: Guru
    9. eemit

      37,188

      0 points yesterday

      Profile
    10. matthewspatrick

      34,254

      10 points yesterday

      Profile
      Rank: Savant
    11. mlmcc

      29,332

      0 points yesterday

      Profile
      Rank: Savant
    12. VBClassicGuy

      28,604

      0 points yesterday

      Profile
      Rank: Wizard
    13. Brook1966

      26,800

      2,800 points yesterday

      Profile
      Rank: Wizard
    14. CodeCruiser

      26,576

      0 points yesterday

      Profile
      Rank: Genius
    15. kaufmed

      26,000

      0 points yesterday

      Profile
      Rank: Genius
    16. LSMConsulting

      24,075

      0 points yesterday

      Profile
      Rank: Savant
    17. rorya

      23,450

      0 points yesterday

      Profile
      Rank: Savant
    18. Dhaest

      22,640

      0 points yesterday

      Profile
      Rank: Genius
    19. capricorn1

      22,448

      0 points yesterday

      Profile
      Rank: Savant
    20. mbizup

      20,300

      0 points yesterday

      Profile
      Rank: Genius
    21. Idle_Mind

      19,700

      0 points yesterday

      Profile
      Rank: Savant
    22. fyed

      19,448

      0 points yesterday

      Profile
      Rank: Genius
    23. ssaqibh

      18,960

      0 points yesterday

      Profile
      Rank: Genius
    24. DatabaseMX

      17,252

      0 points yesterday

      Profile
      Rank: Savant
    25. boag2000

      16,847

      0 points yesterday

      Profile
      Rank: Genius

    Hall Of Fame