If, else statements for a c# Console text adventure game

I need help for a small project.

I'm learning a bit of code before going to College in the fall, so I have some experience.
I am using Visual c# Express 2010. I'm debut with console applications. Basically, I was looking for websites and YouTube videos on orders, then trying to do things out of them.
My first minor project was last week where I learned to take the text that someone puts in and make a value. So I did a very simple and easy to do program mad lib. I ask for names, verbs, etc. and it is easily attached to a chain and I remember them in the paragraph that is created by their words.
I want to work on a text-adventure like Zork now. It's essentially have a few sentences of information, and you can make one of two choices. I want it so that if they make a choice, they will go. Another choice is another way.
But I keep a bunch of different ways to do this, and a lot of it seems very complicated. I "m looking for a simple and easy to do.
Also, I need help finding how to organize all of these choices and the person can take different paths.
Any help will be great! Thank you.

Hello

These are forums for vista for users who have problems with vista programs

Repost in the sub forums

Questions about Visual c# Express Edition and put underway with c#.

http://social.msdn.Microsoft.com/forums/is/Vsexpressvcs/threads

Tags: Windows

Similar Questions

  • The use of objects multi-state for the next stage of the course 9

    In my old clumsy e-Learning authoring tool, I could create a slide with several steps. You would click the button Next to display text and graphics.  When you get to the last step, the next step button disappears, so that you know that you have completed. How can I make this work with multi-state Cap 9 objects?  I created an object with 3 States multi-state. I created a button with an action go to Next State.  It is fine until you get to the last State.  If you click the button again, it starts again with the first State.

    Yes, I can create several buttons. But I really just want a button called next step which disappears after posting the last State.  The user would know that she had displayed all the steps.

    Any suggestions are welcome.  Thank you.

    Jeanne M

    Here is a sample script:

    This has been implemented for 6 States (for a container of text, the Normal State is an empty form).

    There are 2 user variables:

    • v_counter has a default value of 0
    • v_max is the number of States, you can replace it with the literal '6' or you need to

    The first decision "done" check if the counter reaches the maximum value (v_max). If this is the case all States should have been disclosed, and it should end the loop. That's why this decision will disable the button used to change States (SB_StateTrigger) and here also to change its status to an invisible state (AfterLoop). Upon return to the slide, the State will be back to Normal (visible), and simply activate the button again. You can replace this with a simple action to hide as well if you want.

    If the first decision is not true, there are still reports to be shown and the counter is incremented.

    All 6 other decisions are similar (I collapsed 2 of them): they will test the value of the counter and show the associated State. I used to state3 on a common standard. This makes it possible to use exactly the same advanced also action if the total number of States is less than 6. Simply change the value of v_max.

  • JavaScript custom for If/Then/Else statement code

    Can someone help me understand this code. I have a field in a PDF file that I need to generate a discount based on the price of an item. If the price is higher than 5000, then I need the field to say 1500. Otherwise the field discount must be price *. 30.

    I tried, but it did not work: if price > 5000 then discount = discount 1500 = price*.3

    Someone at - it help?

    Thank you!

    Acrobat forms use JavaScript, so you need to use the JavaScirpt syntax for JavaScript syntax appropriate for the 'If... else' statement. You will also need to access the domain object as established by the Acrobat JavaScript object using the method "getField" of the doc, "this.getField (cName)" object, then the property "value" for this object.

    custom calculation script for the ' discount field

    establish the name of the price field

    var c = "price";

    get the value of the price field

    var nPrice = this.getField (c) .vallue;

    Assume that the discount is 30% of the price

    NPrice = Event.Value * 0,30;

    the value of reduction 1 500 if the price is higher to 5,000

    If {(nPrice > 5000)

    Event.Value = 1500;

    }

    end of the custom calculation script

    For more information, see Conditional Execution by Thom Parker.

  • 'Go to the State' vs 'Go to the next State' for the selected button state

    I have a series of image galleries in my publication that uses MSOs and buttons to "Go to another" - the thumbnails then have a small edge to have indicated that they are 'selected' - it works very well. The border is added to the click for each thumbnail button state.

    I have a similar scenario is a YouTube embed of the video and an article as a MSO with two States: a State is the vid to youtube and the other State is the article of the text. I have a set place button to switch between these two States. This button is set to "Go to the next State" so he'll just between the two States MSO. Is there any way to have a selected State for this button so that the words under the button change to 'play' video in 'see article' while keeping this button set to "Go to the next State" - the only way I can think to do is with two buttons.

    I realize, this is a very specific use case and I do not expect the features, but if there is a solution I am curious to know if anyone else has come across this.

    Thanks in advance for your help.

    Implement for the buttons in the different States. Then add an invisible button on it to the next State meetings.

    Bob

  • If/else statement in the MathScript node

    I want to write if/else statement in MathScript node.

    If (Yes is Yes)

    {

    a = 0;

    }

    other (no = no)

    {

    b = 1;

    }

    'Yes' and 'No'--> of Type String

    'a' and 'b'--> Type Double

    Hi johndoe.

    Thank you for contacting National instruments.

    I would like to highlight a number of items which you may find useful for the implementation of an if-else statement in a MathScript node.  The first is a book white tutorial, which the second part explains how to use LabVIEW MathScript node. The second is an article describing the required syntax to write functions and scripts in the MathScript node, including instructions for the use of the If-Else statements.

    I hope that these help. Please let me know if you need additional assistance.

    Kind regards

    James

  • Using "States" on the image and text together

    I'm having a problem with 'States' of an image with text above. I would like for the image to 100% opacity and text to be hidden in the States 'normal' and 'active '. In the States of "mouse down" and the 'reversal', I would like the image to have an opacity of 20% as well as the text to be visible.  Basically, I'm trying to achieve a similar effect to this Web page: http://www.shedbuilt.com/#mi=11 & pt = 0 & pi = 39 & p = -1 & a = -1 & at = -1. I can define States for text and image separately, but I would like that they work as a single object when it is tilted. Thanks for your help!

    Try the widget status button

    Abhishek

  • OATS: script entering does not in the if-else statements

    I created a functional test using Oracle's Web. My database file (.csv) contains a number of numbers that are used to browse through the script with different values. now in my loop for, I have included an if-else with action statements in these (Actions like) by clicking on the different tabs. Now, when I run my script, is to not enter the if-else statement and jumping directly to the next step.

    Here are my script:

    beginStep ("search page", 5)

    {page opening}

    String Var1 = (string) 'value from the .csv data bank ";

    for (int i = 1; i < = 2; i ++)

    {

    beginstep("/ASC",0)

    {

    if(var1=="ABC")

    {

    Task1;

    Task2;

    }

    ElseIf (Var1 == "efg")

    {

    Task1;

    Task2 ;}

    }

    }

    endStep();

    beginStep("/asc",0)

    {

    Task3;

    Task4;

    }

    endStep();

    }

    According to my above script, the script is to jump directly to TAsk3 and 4, instead of going to task if-else performing 1 and 2.

    Thanks in advance.

    Kind regards

    Deepak Khari

    Hello

    Use eval(), c.


    String Var1 = eval ("{{db. Var1.ColumnName}} ")." ToString();

    System.out.println ("scnro_class--->" + Var1);


    Kind regards

    Dembélé M

  • How to use an IF ELSE statement and the xdoxslt: get_variable together?

    First of all, I'm a big fan of this forum and I would like to thank the community for helping to make better the world BI Publisher.

    I'm trying to populate a table with a value of years of data with column = PRODUCT and row = month to DATE. Here's the catch, not every month will be given. Then here's where is my problem, I am not able to use an IF ELSE statement with an expression XDOXSLT:GET_VARIABLE so that if there is no given for this month the default value will be 0.

    Can someone help me find a solution to one of the attempts below or a method entirely new? Thank you!

    BP4 = numeric value of months with a DATE (more code to extract only the month DATE not included here)
    JAN1 = PRICE if there is data, 0 otherwise

    (1) I tried and it did not work:
    <? If: xdoxslt:get_variable($_XDOCTX,'BP4'), 01 xdoxslt:set_variable($_XDOCTX,_'JAN1',PRICE) then another end if xdoxslt:set_variable($_XDOCTX,_'JAN1',0)? >
    <? xdoxslt:get_variable($_XDOCTX,'JAN1')? >
    <? end if? >

    (2) I tried and it did not work:
    <? xdoxslt:IfElse (xdoxslt:get_variable($_XDOCTX,'BP4') = '01', xdoxslt:set_variable($_XDOCTX,_'JAN1',PRICE), xdoxslt:set_variable($_XDOCTX,_'JAN1',0))? >
    <? xdoxslt:get_variable($_XDOCTX,'JAN1')? >
    <? end if? >

    (3) I tried and it did not work:
    <? xdofx:If xdoxslt:get_variable($_XDOCTX,'BP4') = '01' xdoxslt:set_variable($_XDOCTX,_'JAN1',PRICE) then another end if xdoxslt:set_variable($_XDOCTX,_'JAN1',0)? >
    <? xdoxslt:get_variable($_XDOCTX,'JAN1')? >
    <? end if? >

    example of XML data:
    < ROW >
    < name > Craig Hernandez < / NAME >
    < DATE > 2013 - 01-01 T 00: 00:00.000 + 08:00 < / DATE >
    < PRICE > 31 < / PRICE >
    BPD of < PRODUCT > < / PRODUCT >
    < / ROW >


    -TRD

    Published by: 990965 on February 28, 2013 08:27

    >
    (1) I tried and it did not work:


    (2) I tried and it did not work:


    (3) I tried and it did not work:


    >
    so

    
    
    

    works for me, it's

  • Transfer discount: If/Else statement

    His assignment that I spent hours on:

    http://ImageShack.us/a/img834/7124/273e.PNG

    http://ImageShack.us/a/img706/4691/fhfd.PNG

    That of how long I'm away until now, according to my code:

    __________________________________________________________________________________________ ________________________________

    var body_txt:TextField = new TextField();

    body_txt.x = 225;

    body_txt.y = 300;

    body_txt. AutoSize = TextFieldAutoSize.LEFT;

    var myFormat:TextFormat = new TextFormat();

    var yourPurchase:String;

    var yourDiscount:String;

    var yourPrice:String;

    delivery of the var: number;

    var total: Number;

    yourPurchase = max_txt.text;

    discount: 10.00 / 10%

    yourDiscount = discount_txt.text;

    yourPrice = price_txt.text;

    Total = yourPurchase - discount

    If (yourDiscount)

    {

    trace();

    }

    on the other

    {

    trace();

    }

    __________________________________________________________________________________________ ________________________________

    As you can see, I have no idea on how to get the discounts written into the code, I don't know how.

    Please explain as much as possible on how to resolve this dilemma (in simple terms if possible). Thank you!

    use:

    ______________________________________________________________________ ____________________________________________________

    var body_txt:TextField = new TextField();

    body_txt.x = 225;

    body_txt.y = 300;

    body_txt. AutoSize = TextFieldAutoSize.LEFT;

    var myFormat:TextFormat = new TextFormat();

    I'm not sure the above is

    var yourPurchase:Number;

    var yourDiscount:Number;

    var discount: Number =. 1;

    the code below (up to formatF) should run WHEN the user finishes coming into max_txt

    yourPurchase = Number (max_txt.text);

    {if(yourPurchase>10)}
    yourDiscount = discount * yourPurchase.
    } else {}
    yourDiscount = 0;
    }

    discount_txt. Text = formatF (yourDiscount);

    price_txt. Text = formatF (yourPurchase *(1-discount));

    function formatF(n:Number):String {}

    now write a function that converts numbers into dollars and cents for display

    }

  • using an Exit statement for a deletion without affecting an oracle error msg

    Hello all;

    I have one similar to this delete statement below
      delete from tbl_one t
      where t.tbl_one_location = location 
      and location not in (select distinct p.issuearea  from tbl_two p);
    the delete statement is in a package, however I would like to make out a simple message to indicate if the deletion was successful which means that a real element has been deleted and if this was not successful another statement for this.

    I have an idea in my mind which is to track the number of items in tbl_one before deleting and then check the count after removal and if the number is lower, the deletion was successful... therefore the output message. Is the best way to go or there at - it an easier way to do it.

    Thank you, any help is appreciated.

    You could put something like this directly after the DELETE statement:

    IF SQL%ROWCOUNT > 0 THEN
            DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ' items deleted.');
    ELSE
            DBMS_OUTPUT.PUT_LINE('Nothing deleted!');
    END IF;
    

    SQL % ROWCOUNT attribute: how many lines were affected?

  • If else statements

    Hello world!

    I cannot re written one "if else" statement of Excel in ActionScript 3. Maybe someone can tell me what am I translated badly in the new formula of AS3.

    The original argument of Excel is:

    =IF(AND(F8<=5,F39>=10),10,IF(AND(F8<=5,F39<10),F39,IF(AND(F8>=6,F8<=10,F39>30),30,IF(AND(F8>=6,F8<=10,F39<=30),F39,IF(AND(F8>10,F39<30),F39,30)))))

    I translated this into AS3 as follows:

    if(q1_preCalc <= 5 && q13_preCalc >= 10)
         {
              q13_preCalc = 10;
         }else if ( q1_preCalc <= 5 && q13_preCalc < 10)
         {
              q13_preCalc = q13_preCalc;
         }else if (q1_preCalc >= 6 && q1_preCalc <= 10 && q13_preCalc > 30)
         {
              q13_preCalc = 30;
         }else if (q1_preCalc >= 6 && q1_preCalc <= 10 && q13_preCalc <= 30)
         {
              q13_preCalc = q13_preCalc;
         }else if (q1_preCalc > 10 && q13_preCalc < 30)
         {
              q13_preCalc = 30;
         }else
         {
              q13_preCalc = 30;
         }

    As you can see, I'm trying to set the vaule of the variable "q13_preCalc" according to the value of 2 other variable: q1_preCalc and q13_preCalc (himself).

    After you set the value, I do the calculation with the value:

    q13_preCalc_2 = (q13_preCalc*0.01)*-2.787;

    I don't know if I translate the "If another 'instructions properly in AS3 since Excel."

    Thank you in advance for your help!

    Rafa.

    It seems correct to me, just the last part is different:

    IF (AND (F8 > 10, F39<>

    but in AS3 you wrote:

    If (q1_preCalc > 10 & q13_preCalc)<>
    {
    q13_preCalc = 30;

    ...

    }

    and I see in your AS3 to 2 variables: q1_preCalc, q13_preCalc

    Where is the 3. ?

    in Excel, you have 3 cells (values): F8, F39 and the cell containing the formula.

  • IF and ELSE statements

    The man... I'm so close to figure this out and I didn't have to go back on the forum for this because I had a few topics here already when I started this project and to halfway through it and now towards the end of it, LOL! I hope that you all don't mind!

    in any case...

    Now I am trying to get users to fill out 4 boxes with the correct information, then press the ENTER key to go to the next section. Everything works perfectly with this part of my code, however, it is the part on whether they enter the wrong info that I be puzzled over.

    I tried the ELSE statements and various forms of listeners and IF statements, but I can't seem to make it work.

    When they enter the wrong info, in the entry boxes, I have to be taken to a different image. I had a script in there little worked, but instead of him awaiting until they entered all the information, it would just automatically go to the 'wrong' because technically, they received only a chance to enter the first letter of the first word.

    in any case, the code that I use now is attached. It works very well except the part of the erroneous info being entered. If a user has just this framework (where the code is located) and hits ENTER, thn, they are taken as part of 'Wrong', which is good, because technically they do not capture in 4 boxes. But. If they start typing in a box and then press ENTER, they need the same "Incorrect" framework because they have not all enter, but it is not that. Even if they conclude each info box and a letter is missing for example, which is wrong and should go to this 'Wrong' page, but is not.

    Any ideas?

    It is strange.so your code looks like this (and all the other stuff that was already there?):

    If (Key.isDown (Key.ENTER)) {}
    trace ("talk to the hand, because I'm no longer listening.");
    Key.removeListener (listener);
    trace ("the time it was the Enter key, then I should evaluate.");
    Evaluate();
    }

    It should work. I just tested it and it works for me. Well, it worked on the second try, the first time that I misspelled "listner", so be sure that you have spelled everything correctly!

    Unless you are sure that it is the function of battery called? How do you know? Y at - he got another code which could be initially move the playback cursor?

    BTW, if you use Actionscript, you shouldn't use scenes. There are strange things that occur with it and it is not worth!

  • Buy iPhone 6s in the United States for use in other countries

    Hello!

    I'll buy the iPhone 6s in the United States for use in Russia. What problems can apear while using in Russia? I'll use it in Russia so I need of the Russian company. If I buy iPhone 6s SIM-free what will be its real price (without a contract with the USA carrier)? I'll be able to use this iPhone with no problems (upgrate problems, no problem).

    Thank you.

    Best regards

    Lily

    Hi Lily,

    First of all, you can not buy a "SIM-free" iPhone, that would not work. You can buy an iPhone without a contract. You can view your options pricing here: http://www.apple.com/shop/buy-iphone/iphone6. As you can see, the iPhone 6s will leave $ 649 without a contract or a payment plan. Your iPhone will be much anointing in Russia, as long as you have the appropriate adapter and a Russian company or international service plan. With respect to the upgrade, it may be possible to sell your phone for an upgrade, however this is dependent on the carrier you choose.

  • I bought an iPhone 6s and more in the United States, now its screen is broken, I live in China, personal APPLE let me come back to the United States for maintenance!  So ridiculous, help! Thank you!

    I bought an iPhone 6s and more in the United States, now its screen is broken, I live in China, personal APPLE let me come back to the United States for maintenance!  So ridiculous, help! Thank you!

    the iPhone may be served only in the country where it was purchased. Nothing strange in this situation. You can ask your friends or relatives in US to take your device at the Apple Store it.

  • Prefs in user.js for the Mozilla rich text editing has stopped working

    Prefs in user.js for the Mozilla rich text editing has stopped working. He worked, then stopped. you had to do system restore. user.js file replaced, does not work

    This has happened

    Don't know how many times

    solved with this

    https://addons.Mozilla.org/en-us/Firefox/addon/852/

Maybe you are looking for