Click here to Skip to main content
6,292,811 members and growing! (10,070 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Intermediate License: The Code Project Open License (CPOL)

Fill MSFlexGrid with Numbers and Create Mathematical Trick

By Mostafa Kaisoun

Create Mathematical Trick by displaying seven numerical tables using MSFlexGrid
VB 6WinXP
Posted:9 Sep 2008
Updated:15 Sep 2008
Views:4,620
Bookmarked:2 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
2 votes for this article.
Popularity: 0.30 Rating: 1.00 out of 5
2 votes, 100.0%
1

2

3

4

5
ExeFile

Introduction

I am using seven numerical tables to create this Mathematical Trick. I found the idea of this trick in my old papers but I don't remember from which book or magazine I read it before. I confess that my work is a translation of this idea to a VB6 program.

Background

  • Choose number from 1 to 100, keep it in your mind.
  • I shall display (7) tables.
  • Every table contains some numbers.
  • Search for the number of your choice in every table.
  • If you find it: Click (Yes) button.
  • If not: Click (No) button.
  • After displaying last table (number 7):
  • I shall tell you your choice number!

Using the Code

The following code is an example to fill MSFlexGrid with numbers:

Dim c As Integer
Dim r As Integer
Dim n As Integer
Dim T As Integer

   With NumGrid
      T = 1
      For r = 0 To 4
         For c = 0 To 9
            .TextMatrix(r, c) = Str(T)
            T = T + 2
         Next c
      Next r

Please refer to the source code (Sub FillTab) to see how I fill the grid with numbers seven times.

Remarks

You can find the source code when you extract the file SourceFile.zip and you can find the *.exe when you extract the file ExeFile.zip.

Last Words

I hope that you enjoy this trick. If anybody knows the exposition of this trick, please let us know.

Contact Details

History

  • 9th September, 2008: Initial post
  • 15th September, 2008: Source and demo updated

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Mostafa Kaisoun


Member

Location: Egypt Egypt

Other popular Miscellaneous articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
GeneralI shall search again.. PinmemberMostafa Kaisoun9:31 12 Sep '08  
GeneralPart of solution.. PinmemberMostafa Kaisoun9:24 12 Sep '08  
Generalabout the trick PinmemberLotharLanger7:33 11 Sep '08  
GeneralI know, but how?! PinmemberMostafa Kaisoun8:13 10 Sep '08  
GeneralRe: I know, but how?! PinmemberRafael Oliveira12:43 10 Sep '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 15 Sep 2008
Editor: Deeksha Shenoy
Copyright 2008 by Mostafa Kaisoun
Everything else Copyright © CodeProject, 1999-2009
Web19 | Advertise on the Code Project