realbasic-games
[Top] [All Lists]

[ANN] RB Card Trick Program: A Simple Sample

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: [ANN] RB Card Trick Program: A Simple Sample
From: Barry Traver <rb at ix dot netcom dot com>
Date: Mon, 21 Nov 2005 17:46:36 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20051118180024 dot 8DD3FEAEB78 at lists dot realsoftware dot com> <5e8b2ed29d8d948ff5a29a3f026cf22c at adelphia dot net> <a0620070ebfa796fe4a41 at [10 dot 0 dot 1 dot 4]>
Windows Users Only! Download REALbasic source code for a simple card trick program accessing the Windows file cards.dll. This program "piggy-backs" on a cards.rbp program by Aaron Ballman. His program is based on the card game "War," whereas my adaptation of his code is a simple card trick described in a chapter in Martin Gardner's book Magic, Mathematics, and Mystery.

It's a simple trick. Twenty-seven cards are dealt face-up into three columns. The spectator is asked to secretly select a card and then to indicate the column in which the card appears. The cards are picked up and re-dealt into three columns. The spectator is asked in which column his card appears now. The cards are dealt a third time with the same question, and then the computer reveals the selected card. Not a very spectacular trick, but the source code does show how one person's code might be adapted for a rather different purpose. Perhaps it may inspire you to write a much better program than mine. You may even learn something from this sample program (even if it's how NOT to code). Who knows? Try it out and see!

P.S. Here's where you can find the original project by Aaron Ballman:

    http://www.aaronballman.com/programming/REALbasic/Cards.php

Here's basically where to go for my simple card trick program in RB:

    http://traver.org/rb/cardtrick/

Here's the REALbasic source code for my simple card trick, if you want it:

    http://traver.org/rb/cardtrick/cardtrick.rbp (77 KB)

Here's the card trick as a Windows executable program if you want to avoid having to compile it:

    http://traver.org/rb/cardtrick/cardtrick.exe (2,491 KB)

And here's the card trick as a Windows executable program in zip format:

    http://traver.org/rb/cardtrick/cardtrick.zip (825 KB)

Enjoy!

Barry Traver


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>