Wednesday, May 27, 2009

Birth Date Quiz

Yesterday, I read a book about magic (How to Know her Birth Day)
It, just an ordinary book with simple math calculation.
you just have to know about basic calculation such as multiply and other.

Then i think, why don't i write this calculation become simple software.
So i start to write the code for this magic
trick.

Lets Start
Open Your Notepad

This is the code. I Use VB Script or Visual Basic Script so everyone without assembler can use it.

--------------------------START--------------------------------------
  1. msgbox "Guest your Birth Date",0,"made by S - http://2toorialle.blogspot.com"
  2. on error resume next
  3. dim h, t,b,x
  4. msgbox "Follow This Instryction",0,"made by S - http://2toorialle.blogspot.com"
  5. msgbox "Imagine your Birth Date .....!!"&vbnewline&"Keep in your mind and i will write it",0,"made by S - http://2toorialle.blogspot.com"
  6. msgbox "Now your Birth Month, Imagine in number. Example: "&vbnewline&"If januari Then 1, februari 2 Etc",0,"made by S - http://2toorialle.blogspot.com"
  7. msgbox "Multiply your birth date with 5(five)",0,"made by S - http://2toorialle.blogspot.com"
  8. msgbox "Then Add With 17",0,"made by S - http://2toorialle.blogspot.com"
  9. msgbox "Multiply The result with 20 (Twenty)",0,"made by S - http://2toorialle.blogspot.com"
  10. msgbox "Subtract with 19(nine teen)",0,"made by S - http://2toorialle.blogspot.com"
  11. msgbox "Add More with your Birth Month"&vbnewline&"Please Remember Month In Number....!!!",0,"made by S - http://2toorialle.blogspot.com"
  12. h=inputbox ("Tell Me your Result...?")
  13. h=h-321
  14. t=h/100
  15. t= round (t)
  16. x=t*100
  17. b=h-x
  18. if t<0>31 and b<0>13 then
  19. msgbox "You Sure Birth in That Day...?"&vbnewline&"coba lagi",0,"made by S - http://2toorialle.blogspot.com"
  20. else
  21. msgbox "Done"&vbnewline & "Result is:"&vbnewline &vbnewline &"You birth Day is: "&t& " "&bulan(b),0,"made by S - http://2toorialle.blogspot.com"
  22. end if
  23. function bulan(data)
  24. select case data
  25. case 1
  26. bulan ="january"
  27. case 2
  28. bulan ="February"
  29. case 3
  30. bulan ="Maret"
  31. case 4
  32. bulan ="April"
  33. case 5
  34. bulan ="Mei"
  35. case 6
  36. bulan ="june"
  37. case 7
  38. bulan ="july"
  39. case 8
  40. bulan ="Agustus"
  41. case 9
  42. bulan ="September"
  43. case 10
  44. bulan ="October"
  45. case 11
  46. bulan ="November"
  47. case 12
  48. bulan ="December"
  49. end select
  50. end function
--------------------------------END-------------------------------------------

Now save as your work with extension .vbs
Explaination...:
Line 1 ....................... Introduction
Line 2....................... Avoid all error
Line3........................ Declare all Variable
Line4-line11............. Magic Trick Instruction
Line12...................... Input The Result
Line13-Line17.......... Counting The Result
Line 18-Line22 ........ Cose a branch of counting
Line 23- End ........... Function to chose month.

That all the script i made, maybe it not perfect but i only a newbie and this is my place to share my knowledge...
You Can Download this file here
See You with my next articles...

No comments:

Post a Comment