How to go back to a previous bit of code

I've got a Zork like game that runs in a console, but I want the console to back to a previous bit of code when a user inserts unreconized statements
if (Console.ReadLine() == "Clean up Room") // This is where the console is supposed to back to when the else statement is triggered
Console.WriteLine("Room is cleaned up, you can now go out to play.");
Console.ReadLine();
else // People will type the wrong statements
Console.WriteLine("I don't understand.");
Console.ReadLine();

Check this method:
bool repeat;
do
repeat = false;
Console.Write(
"Please type the statement: " );
switch(
Console.ReadLine() )
case
"Clean up Room":
Console.WriteLine(
"Room is cleaned up, you can now go out to play." );
Console.ReadLine();
break;
default:
// People will type the wrong statements
Console.WriteLine(
"I don't understand." );
repeat = true;
break;
while( repeat );
For other statements, add more “case” similarly.

Similar Messages

  • Anyone know how to revert back to the previous iTune?

    anyone knows how to go back to the previous iTunes?

    =Downgrading from iTunes 11 to iTunes 10.7=
    You may be able to go back with Time Machine but this may involve restoring other items too (https://discussions.apple.com/message/20441404).  Alternatively:
    Back up your computer first, in case the unexpected happens.
    Quit iTunes.
    Get iTunes 10.7 from http://support.apple.com/kb/DL1576 or the direct download link at:  http://appldnld.apple.com/iTunes10/041-7195.20120912.d3uzQ/iTunes10.7.dmg
    Do a few preparatory steps by making sure all iTunes components are not running and cleaning old files.   See https://discussions.apple.com/message/20475394.  Do steps 3 and 4.  Steps 6-8 may be also useful but I don't know if they are essential.  Some of the other steps are not necessary, duplicate steps listed later in my post or are perhaps even unhelpful in the process.
    Replace the iTunes 11 application with iTunes 10.7.  Simply dragging the application to the trash may not work. Lion (OSX 10.7) and newer systems have iTunes integrated into the operating system and deleting is a bit more involved.  Two ways to do this are:
    1.  Use the shareware Pacifist utility (http://www.charlessoft.com/) to install iTunes 10.7 including all associated system files. Details at http://forums.macrumors.com/showpost.php?p=16400819&postcount=6
    2. Check this reference on how to delete the iTunes application itself:
        Delete iTunes in Mac OS X 10.7 Lion - http://osxdaily.com/2011/09/13/delete-itunes-in-mac-os-x-10-7-lion/
        After deleting the application there may be other files that need downgrading too. See the note about error -42408 at the end of this post. You may want to tuck these away somewhere safe until you have completed the installation of iTunes 10.7.  I have not tested this but ideally if newer versions are not found then the installer will put in the old versions. This may include these files in /System/Library/PrivateFrameworks/ which apparently get updated by iTunes 11:
    AirTrafficHost.framework
    CoreFP.framework
    DeviceLink.framework
    iTunesAccess.framework
    MobileDevice.framework
    After doing one of the two procedures above you will have to rescue the most recent old iTunes library from your iTunes > Previous Libraries folder. Rename it "iTunes Library.itl"  and replace the existing one in the iTunes folder. A newer version of iTunes irreversibly updates your library file so you have to replace it with the old one or you will get an error message. Note, this will revert your library to the version at the time of the upgrade and you will have to update any changes made since.  See:
    https://discussions.apple.com/message/20401436 - turingtest2 11/2012 post on rebuilding empty/corrupt library from previous iTunes library file after upgrade/crash.
    iTunes: How to re-create your iTunes library and playlists - http://support.apple.com/kb/ht1451
    Other issues:
    - https://discussions.apple.com/message/20432309 - solution to mobile devices saying they need to be restored after downgrading
    - If you encounter error -42408:
    iTunes: Advanced iTunes Store troubleshooting - http://support.apple.com/kb/TS3297 > Specific Conditions and Alert Messages: (Mac OS X / Windows) - including specific error codes.
    Alternatively, check https://discussions.apple.com/message/20441424 which requires you have a Time Machine backup (though possibly if you remove the newer version of these files old ones may be installed with the iTunes 10.7 installer - untested).  A  variant of this is at: https://discussions.apple.com/message/20448184
    - Persistent "Show in iTunes Store" arrows after downgrade - https://discussions.apple.com/thread/4567064

  • I downloaded current version of itunes today not knowing I would lose the ability to burn the music I purchased to a cd as well as nano. can anyone tell me how to get back to the previous version or help me to be able to burn my music to a cd as well?

    today i made the mistake of downloading the update for itunes, 12 26 12, not realizing i would lose the choice to also burn my purchased music to a cd as well as the nano. can anyone tell me how to get back my previous version so I may continue to make my cds that I play in my vehicle. are there steps I can take to be able to transfer the purchased music to another exterior drive where I can then burn it to a cd, besides the nano? as my name indicates I am just getting too old to keep up with all these changes..

    https://discussions.apple.com/thread/4572096?start=0&tstart=0
    As for moving you itunes library, just copy the entier iTunes storage folder to the exterior drive.  user/MyDocuments/Music/iTunes

  • HT1414 how do I back up from previous back ups

    HOw can I back up from a previous back up

    When selecting Restore, hold down Shift or Alt to bring up the Finder/Explorer, and select your backup file.

  • How to go back to the previous selection screen window?

    I have a selection screen and I have a button that calls a basic report and displays it on screen 0. The basic report is displaying however when I push the back button the program exits.
    If I use "set screen 0" and if I press back button, the program goes to the code. It does exit.
    If I use "leave to list processing" and if I press back button, the screen is just stuck on that screen 0 forever.
    What I want is to go back to the selection screen window when I press the back button at the top.
    <b>Pls help. Im a newbie. Thanks people. </b>
    at selection-screen.
    case SY-UCOMM.
      when 'BTN1_PUSH'.            " Calls Plain Report
          set screen 0.
          perform plainreport.
      when 'BTNEXIT_PUSH'.
        leave program.
    endcase."

    Hi Jabbar,
    The reason it is exiting the program is because you are using set screen.
    Try the following instead:
    at selection-screen.
    case SY-UCOMM.
      when 'BTN1_PUSH'.            " Calls Plain Report
           call screen 0.
          perform plainreport.
      when 'BTNEXIT_PUSH'.
        leave program.
    endcase."
    Think of the call screen command as a chain that the program follows and exits the previous. When you say set screen you are leaving the history in the program and it will always go back to the last screen it remembers which is why you were stuck in screen 0.

  • How to go back to the previous window?

    Pls help me. I have this selection-screen window (my main window) and it has few buttons. One of the buttons of that main window is going to take you to another window which displays an ALV report. on that ALV report window when I press the back button (located at the top of the screen), it ends the entire program and goes back to my program editor.
    How can I go back to the main window? <b>PLS help.</b> im a newbie. <b>THANKS.</b>

    Hi Jabbar,
    I've got similar issue ..may not be same as your problem..
    I've solved as below..may be useful for you....
    AT USER-COMMAND.
      DATA : varb(10) TYPE c.
      CASE sy-ucomm.
        WHEN 'F3'.
          CALL FUNCTION 'POPUP_TO_DECIDE_INFO'
            EXPORTING
              defaultoption = 'Y'
              textline1     = 'Do you want to exit report ?'
              titel         = 'Exit report confirmation'
            IMPORTING
              answer        = varb.
          IF varb EQ 'J'.
            SUBMIT zreport.  "report name
          ENDIF.
      ENDCASE.

  • How can switching back to a previous phone be considered an upgrade?

    I had been using an S4 for about a year when I got a hold of a lumia 928 and wanted to try it out was using while waiting for the 8.1 update when I broke the phone beyond repair .I go to switch back to my S4 and get the message that my phone is not compatible with my current plan (unlimited Data) how can that be as this is the phone I had been using on the plan originally. Call customer service lady tells me she can take care of it I switched phones and everything is back to the way it was before except not I get a message telling me i'm now on a 2gb data plan. Another call to customer service to be told that I upgraded my phone and I had to be moved to a new data plan. How is this considered an upgrade?

    They probably coded it incorrectly.  Get them to code it as ce customer equipment and put the 29.99 feature back on. If they say it's not available request an inactive pricing request put in as you have 14 days to get unlimited feature when there's this type of error.

  • How to go back to a previous version of NI Motion

    Has anyone tried going back to an older version of NI Motion?  Specifically I loaded labview 8.5 and NI Motion 7.6 on to my computer after having run Labview 6.1 and NI Motion 5.1.1 successfully for seven year.  The newer version is not compatible with my system and will not run.  I've loaded the old system on a completely different hard drive and tried to get the system back the way it was.  My motor appears to be out of tune and will not run.  I note that both the new .xml file and the firmware files are bigger in the 7.6 version.  I've tried padding the 5.1.1 firmware files with NULL characters but that didn't help.  I suspect that some part of the new .xml file is being left on the board when I write the old one back.  Anyone know a work around?
    Jim Fee

    Jim,
    This sounds a lot like an issue with pull-in moves.
    "Pull-in: When stepper motors are run in closed-loop mode, the encoder feedback is used to
    verify the position of an axis when the motion ends. The motion controller then
    commands the axis to do a final move so that it is at the specified target
    position."
    If the number of pull-in moves is set extremely high I can see this causing what you are seeing.
    Can you give me more information on your setup and when you see this oscillation. I'm assuming it is only when you tell the motor to find home.
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • How to tab back to the previous item in sql form 3.0?

    Dear all,
    Which key combination is for doing this?
    Rgds,
    Edward

    Oraterm defines the keys for specific functions, e.g. F7 = Enter Query, F8 = Execute Query. Oracle has a standard list, but most applications redefine the keys.
    In Help -> Show Keys look for Previous Item to see which key to use (maybe Ctl-Tab or Shift-Tab).
    In Forms 3, if I remember correctly, Show Keys is Ctrl-K by default.

  • How can I go back to a previous version of software as iOS 5 has stopped car bluetooth working.

    I have an i-phone 3GS and a 56 Plate Ford Fiesta with factory fitted bluetooth audio.  This is a Nokia bluetooth but has allowed me to call hands free with this phone and previous i-phones and other brands with no problem.  I upgraded to iOS5 and I can now not make calls through it.  If I press call, the radio says 'dialling' but the ringing tone and when someone answers just goes straight back to the handset and not through hands free which makes it redundant in the UK.  I rang Apple and asked how to go back to a previous version of software that does work but was told Apple staff were not allowed to tell me how to do this.  His only other suggestion was that I buy a new car which wasn't massively helpful or practical.  I have seen quite a few messages on the internet of people having this sort of problem after they upgraded.  Does anyone know how to go back a previous version or how to get bluetooth back working with my car as I quite like the iOS 5 update it's just no good if I can't use it in car.? I've tried deleting and re-pairing but that hasn't worked.  Does anyone also know whether Apple have picked up on this bluetooth compatibility problem and whether they are planning on doing anything to fix it as it does seem to have affected a lot of people and if it can't be resolved I'll just have to stop using i-phones and go to another manufacturer as it's not helpful living in a country where you to have hands free and then not being able to do that because a software update prevents it.  Any help would be greatly received.

    Hi Shero89,
    Thanks for the answer.  I am not new to IOS software but I don't really ever bother with it, have discovered how little I take advantage of the i-phones capability, in reality I still only really use it to phone, text, check emails, listen to music and look on internet.  I'm not keen on jailbreaking it as I don't trust it to work so normally just update and leave it at that.  Only reason I wanted to downgrade was because the update had stopped my bluetooth working but Kilted Tim solved that problem for me so am now not interested in downgrading software.  I quite liked the things that IOS 5.1 gave me but wasn't happy with fact that bluetooth stopped working in car as it caused me problems.  One day I might try and work out exactly what I-phones can do but on the basis that it's a phone all I really want it to do is phone, if that bit works I'm happy.

  • I downloaded Firefox 4, but don't like it. I want to go back to the previous edition

    I downloaded Firefox 4, but don't like it. I want to go back to the previous version. I don't like having the bookmarks over on the right after all this time of having them on the left and I don't like the way the cursor won't autosnap to buttons the way they used to. I don't have a question other than how to go back to the previous version.

        No worries, agoetz. You can change your voicemail feature any time you'd like. Just log into My Verizon http://bit.ly/xB4iTc and select Change Features. There's a voicemail section to pick from all the different voicemail options available for your phone.
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • How do I re-adjust a previous Brush Adjutment?

    I am so new to LR. I can get around and make adjutments fairly well though. But I cannot figure out how to get back to a previous adjustment that I just made a few minutes earlier to say make the exposure a little darker.

    I do have one more silly question. When I am adjusting an image and the image is enlarged, so that I can be precise about where the brush is, I don't know how to move around in that image to get to another section of the same image without going over to the Navigator section on the left and moving around in that. I have seen tutorials where the instructor is making adjutments and then their cursor turns back into the hand and they grab the image and pull it around and then continue on with their adjustmenst. I can't figure out what I am missing. Thanks again for the previous responses. That helped tremendously!

  • How to go back to previous FCPX?

    Hi.
    I am in the midst of a couple projects this week.   My FCP was updated automatically by Maverik and I want to go back to the previous version, as I'm a bit wary of jumping into the new fcp 10.1 in the midst of 2 big projects...How do I go back??

    First, switch off auto update in system preferences, or it will keep happening.
    Second, don't update the OS in the middle of a project, but I guess it's too late for that.
    Third, do you have a backup of the old version of the software, maybe in Time Machine? If so, put the 10.1 version in a folder called Final Cut Pro 10.1 and then restore 10.0.9 from Time Machine or your backup software.
    If you don't have a backup you might be able to contact the App Store or a local Apple Store and see if you can get a copy of the previous version.

  • HT4859 My phone some how deleted not all but most of my contacts and then backup to the iCloud can I go back to a previous backup and retrieve the contacts. If so how.

    My phone some how deleted not all but most of my contacts and then backup to the iCloud can I go back to a previous backup and retrieve the contacts. If so how.

    Hi Shero89,
    Thanks for the answer.  I am not new to IOS software but I don't really ever bother with it, have discovered how little I take advantage of the i-phones capability, in reality I still only really use it to phone, text, check emails, listen to music and look on internet.  I'm not keen on jailbreaking it as I don't trust it to work so normally just update and leave it at that.  Only reason I wanted to downgrade was because the update had stopped my bluetooth working but Kilted Tim solved that problem for me so am now not interested in downgrading software.  I quite liked the things that IOS 5.1 gave me but wasn't happy with fact that bluetooth stopped working in car as it caused me problems.  One day I might try and work out exactly what I-phones can do but on the basis that it's a phone all I really want it to do is phone, if that bit works I'm happy.

  • I downloaded the new version of Firefox and it will not open certain of the addresses that I use to run my business. How can I delete this version and go back to the previous version? thank you

    I would like to revert back to the previous version of Firefox. Please tell me how to do this

    hello and thank you for your suggestion. I have tried it and, when trying to open a program which I previously was able to, still get the following message:
    Remote XUL
    This page uses an unsupported technology that is no longer available by default in Firefox.
    Please contact the website owners to inform them of this problem.
    Seems unbelievable that I previously had no problem and now I do. Have you any suggestions to overcome this? Do you think I can go back further in Firefox history to get a version that will make it possible to access this. Many thanks! Lynn

Maybe you are looking for