Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Think of a number
Logged in as: Guest
arrSession:exec spGetSession 2,16,64979
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Think of a number
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Think of a number -
10/11/2008 3:52:03 PM
TomRiddle
Posts: 188
Score: 4
Joined: 2/7/2008
Status:
offline
A bit of mathematical magic
Option Explicit msgbox "Think of a number, any number between 2 and 20." msgbox "Multiply that number by 2." Dim objRnd:Set objRnd=CreateObject("System.Random") Dim magic:magic=objRnd.Next_2(4, 12) if magic mod 2=1 then magic=magic+1 msgbox "Add "&magic&" to the total." msgbox "Divide your number by 2." msgbox "Finally, "&vbcrlf&"Subtract first number you picked"&vbcrlf&"from the current total." msgbox "The number you have in your mind right now is "&magic/2&"."
Sorry code is not commented, that would make it less mysterious.
Post #: 1
RE: Think of a number -
10/12/2008 7:47:52 AM
Fredledingue
Posts: 383
Score: 0
Joined: 5/9/2005
From:
Status:
offline
Wow! First time I see a software able to read in my mind. If it could find some application we wouldn't need mouse or keyboard.
_____________________________
Fred
(in reply to
TomRiddle
)
Post #: 2
RE: Think of a number -
10/12/2008 10:11:34 AM
DiGiTAL.SkReAM
Posts: 1183
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status:
offline
Now if only you could get it to find the number I picked in the beginning... THAT would be truly magical.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers)
"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury
(in reply to
Fredledingue
)
Post #: 3
RE: Think of a number -
10/12/2008 10:17:34 AM
TomRiddle
Posts: 188
Score: 4
Joined: 2/7/2008
Status:
offline
Always pushing the boundaries
(in reply to
DiGiTAL.SkReAM
)
Post #: 4
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Think of a number
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI