Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Who Want's to be a... Billionaire...?  (Read 7506 times)

0 Members and 1 Guest are viewing this topic.

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: Who Want's to be a... Billionaire...?
« Reply #15 on: December 10, 2008, 08:53:43 PM »
Hmm, I tried running it in a sandboxed environment, but it stopped responding.  You feel like giving it a shot, Carbon?  (Despite your previous response...  Heh.)
I'll try it on my old unused laptop later if I remember.  :D

CBMatt

  • Mod & Malware Specialist


  • Prodigy

  • Sad and lonely...and loving every minute of it.
  • Thanked: 167
    • Yes
  • Experience: Experienced
  • OS: Windows 7
Re: Who Want's to be a... Billionaire...?
« Reply #16 on: December 10, 2008, 08:56:56 PM »
Looks like all it downloads is the .NET Framework 3.5 SP1 (if you don't already have it installed).  I can't get the game to work properly for me, but so far, it doesn't appear to have any malicious signatures or activities.  It should be okay for anyone to try it out if they wish to do so.  Of course, everyone should always exercise caution when downloading unfamiliar files.  Everything has come back clean, but you can never be 100% certain, so download at your own discretion.
Quote
An undefined problem has an infinite number of solutions.
—Robert A. Humphrey

Artimis.Rules

    Topic Starter


    Greenhorn

    Re: Who Want's to be a... Billionaire...?
    « Reply #17 on: December 10, 2008, 08:58:43 PM »
    ...if I remember.  :D

    Do remember. Anyone with VB08 with SP1 and really cares, here is the source. (Code is a bit bloated, i know. I'm working on it [2077 lines])

    http://www.mediafire.com/download.php?cnywizmgklt

    Artimis.Rules

      Topic Starter


      Greenhorn

      Re: Who Want's to be a... Billionaire...?
      « Reply #18 on: December 10, 2008, 08:59:38 PM »
      Yaay! I have trust with evidence! =P

      Sorry, had to.

      Sorry for the double-post BTW.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Who Want's to be a... Billionaire...?
      « Reply #19 on: December 10, 2008, 09:54:45 PM »
      Do remember. Anyone with VB08 with SP1 and really cares, here is the source. (Code is a bit bloated, i know. I'm working on it [2077 lines])


      Visual Studio Professional '08...

      I'll take a gander when I'm bored. might have suggestions... if you're open to them.

      I was trying to dereference Null Pointers before it was cool.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Who Want's to be a... Billionaire...?
      « Reply #20 on: December 10, 2008, 10:23:49 PM »
      Alright, took a quick look see at yer code; got some tips for you.


      First; the four buttons appear to run the same code, but in four different places (Click events)

      I recommend creating a separate procedure- for example, "CheckAnswer", which will take A,B,C, or D as it's argument.

      then, each of your four buttons will be one line; "CheckAnswer("A")" for button A, and so forth. I could hazard a guess and say you've never used separate subroutines, which is OK, but they make programming a lot easier, and you can never learn them too early.


      Also; you've got no error handling code. While this is acceptable for a Alpha or beta, it never hurts; and you can never add, (or learn how to write) them too early.


      For example, in Button2_Click, where you open the text file whose name resides in textbox2 (love your imaginative names, btw  ;D) the readAlllines() call could easily fail; rather then have your game crash with a generic framework error, you could enclose the procedure code in Try...Catch Block, and then provide a more descriptive error to your users. I'd be more specific, but I'd Rather be accurate then dead wrong, and I'm far more experienced with VB6 then .NET... In fact I almost suggested the use of an "On Error" statement, but that doesn't exist in .NET, and if it does it was deprecated by try...catch.

      Last critique would be to rename your controls. I happened under the same problem when I learned VB way back with Visual basic 2 on Windows 3.1; I simply used the default names. Nowadays I wonder why it even provides a default name... under how many circumstances does the name "Command1" or "Text1" describe the controls purpose? Not often, I'm sure. Even today, over 15 years later, the default behaviour for control naming is exactly the same as it was in 1991. On the up-side, they actually changed the menu editor after VB6 (although they changed pretty much everything and it only stood to reason that they would also revamp the 15 year old menu editor)

      lastly- your use of the "lines()" array seems a but non-linear; from what I can gather, it contains the various questions. a more extensible method would be to use a integral variable to store your question number; them multiply that question number by 7(number of lines in each questions definition), and add 1 (the introduction question); this will give you the first line (hopefully) for the question; you can then add the numbers 1 through 6 to extract the various portions of the questions data.



      I'd add some more positive stuff here, but I think my years of experience makes me a bit blind to what I used to think was neat and cool years ago. In any case, I commend your efforts ;)


      I was trying to dereference Null Pointers before it was cool.

      Artimis.Rules

        Topic Starter


        Greenhorn

        Re: Who Want's to be a... Billionaire...?
        « Reply #21 on: December 11, 2008, 05:00:29 PM »
        On the part about my code being bloated -- I know. Been working on it. Like this?:

        Code: [Select]
        If qnum = "1" Then
                    readline = lines(6)
                    If readline = "a" And correctanswer = "a" Or readline = "b" And correctanswer = "b" Or readline = "c" And correctanswer = "c" Or readline = "d" And correctanswer = "d" Then
                        MsgBox("CORRECT!")
                        'Question
                        readline = lines(8)
                        Question.Text = readline
                        'AnsA
                        readline = lines(9)
                        AnsA.Text = readline
                        'AnsB
                        readline = lines(10)
                        AnsB.Text = readline
                        'AnsC
                        readline = lines(11)
                        AnsC.Text = readline
                        'AnsD
                        readline = lines(12)
                        AnsD.Text = readline
                        qnum = "2"
                        Timer1.Enabled = True
                        correctanswer = lines(13)
                    Else
                        MsgBox("INCORRECT!")
                        qnum = "start"
                        readline = lines(0)
                        Question.Text = readline
                        AnsA.Text = "Yes"
                        AnsB.Text = "No"
                        AnsC.Visible = False
                        AnsD.Visible = False
                    End If
                End If



                If qnum = "start" Then
                    AnsC.Visible = True
                    AnsD.Visible = True
                    'Question
                    readline = lines(1)
                    Question.Text = readline
                    'AnsA
                    readline = lines(2)
                    AnsA.Text = readline
                    'AnsB
                    readline = lines(3)
                    AnsB.Text = readline
                    'AnsC
                    readline = lines(4)
                    AnsC.Text = readline
                    'AnsD
                    readline = lines(5)
                    AnsD.Text = readline
                    qnum = "1"
                    correctanswer = lines(6)
                End If
                If Question.Text = "end" Then
                    MsgBox("Congradulations! You have completed this version of 'Who Wants to Be a Billionaire?'!")
                    qnum = "start"
                    readline = lines(0)
                    Question.Text = readline
                    AnsA.Text = "Yes"
                    AnsB.Text = "No"
                    AnsC.Visible = False
                    AnsD.Visible = False
                End If

        I know about renaming the commands and such -- Those few controls we're my most recent addition... and aren't exactly up-to-par yet

        The rest was like a toothpick against a brick wall. Not sure what you said lol.

        EDIT: Going to start a new VB Project, copy the basic parts of code and the objects into it, then re-work the "Answer selection, checking, and changing question"-part