Help!

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
giantpimp
Posts: 4
Joined: May 10th, 2013, 11:08 am

Help!

Post by giantpimp » May 10th, 2013, 11:16 am

Okay..

I need help with this code

everything up to the code below works fine! But when I type the answer to the question it does nothing..

Everything up to this..

Code: Select all

Console.WriteLine("I need to ask you a few questions before you start your adventure.. is that okay?") 

Here is the full code

Code: Select all

Module Module1

    Sub Main()

        Console.WriteLine("Hello and welcome to my game!")
        Console.WriteLine("Press Enter...")
        Console.ReadLine()
        Console.WriteLine("In this world you will come across great adventures and make many friends")
        Console.ReadLine()
        Console.WriteLine("may I ask you something.... Are you a boy or a girl?")
        Dim playergender As String = Console.ReadLine
        If playergender = "boy" Then
            Console.WriteLine("ahhh... a boy huh?")
            Console.ReadLine()
        ElseIf playergender = "girl" Then
            Console.WriteLine("oh... you're a girl!")
            Console.ReadLine()
        End If

        Console.WriteLine("I need to ask you a few questions before you start your adventure.. is that okay?")
        Console.ReadLine()

        Dim player As String = Console.ReadLine
        If player = "yes" Then
            Console.WriteLine("okay, lets move on")
            Console.ReadLine()
        End If
        Console.ReadLine()
    End Sub
End Module
would be great if I could get some help!
PS: I'm trying to create a choose your own adventure/text based story.

Cheers!
-Nathan

User avatar
Fenlig
Posts: 16
Joined: April 12th, 2013, 10:51 am

Re: Help!

Post by Fenlig » May 10th, 2013, 11:28 am

Do you get a error in the compiler?

User avatar
giantpimp
Posts: 4
Joined: May 10th, 2013, 11:08 am

Re: Help!

Post by giantpimp » May 10th, 2013, 11:36 am

Fenlig wrote:Do you get a error in the compiler?

No it does not.

when I am prompt to enter my answer it just flashes and closes.

User avatar
Fenlig
Posts: 16
Joined: April 12th, 2013, 10:51 am

Re: Help!

Post by Fenlig » May 10th, 2013, 11:42 am

wait, I'm kind of a newb but isn't your code missing a whole lot of semi colons as well as curly brackets?

Conflictus
Posts: 53
Joined: January 7th, 2013, 8:09 am

Re: Help!

Post by Conflictus » May 10th, 2013, 1:16 pm

wait, I'm kind of a newb but isn't your code missing a whole lot of semi colons as well as curly brackets?
This looks to be a form of Visual Basic. The statements are instead terminated by new lines rather than semicolons. Unfortunately, I don't know enough of the language to offer any insight.

User avatar
giantpimp
Posts: 4
Joined: May 10th, 2013, 11:08 am

Re: Help!

Post by giantpimp » May 11th, 2013, 1:37 am

Yeah it is VB 2010.. I should have stated that before.

can anyone tell me whats going on? :|

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: Help!

Post by viruskiller » May 11th, 2013, 10:49 pm

sry friend this is directx and c++ forum:D, so unless u get lucky and someone knows vb u might not find the answer here:)

User avatar
viruskiller
Posts: 399
Joined: June 14th, 2012, 5:07 pm

Re: Help!

Post by viruskiller » May 11th, 2013, 10:58 pm

i read the code and it seems u need to delete console.readline() after the line that u say i causes troubles, i think that because up till then in the boy/girl questions u used the comnsole.readline() a few lines after.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Help!

Post by LuX » May 12th, 2013, 5:30 pm

I know some VB, but I haven't worked much with consoles. I'd say about the same as viruskiller, if the code in the boy/girl section worked, maybe replicate the same method in the yes/no input.
ʕ •ᴥ•ʔ

User avatar
giantpimp
Posts: 4
Joined: May 10th, 2013, 11:08 am

Re: Help!

Post by giantpimp » May 12th, 2013, 10:13 pm

Ahhh!! thanks guys!!

worked perfectly! :D

Post Reply