Help!
Moderator: Admins
- x-GAMBIT-x
- Cock-docker
- Posts: 2500
- Joined: Wed Apr 30, 2008 5:30 am
- Location: Minnesota
- Contact:
Help!
Getting stuck on my Command Line assingment and need to move onto other assignments. Here is my assignment, attached here. Also getting stuck on my Inrto to Programming class working with Python 3. Can't stand either of these classes. Some is cool to learn but just hard to catch on for me.
Any help I get Thanks.
Any help I get Thanks.
- Attachments
-
- Command Line.txt
- (847 Bytes) Downloaded 143 times
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Gambit Just Dealt You The Card of Death!!!!!
Re: Help!
Lemme preface that batch is horrible and I go out of my way not to use it. You should recommend to your teacher that she teach something useful like powershell. You will not pick up any good habits using batch. At least you guys are using Python as well. That's a great beginner language.
Here's a working example, but I've implemented it stupidly so you can correct some things.
1) You only have the illusion of choice, they all go to the same place. You will probably be marked lower for this.
2) Part of your problem was that you had no control flow in your if statements (read gotos). It would always fall through to invalid choice which kicked you into a loop. I took that out because it was annoying.
3) Try tracing where the program is going by writing a line down until you hit a jump statement, then jump to that statement. It's pretty simple.
[Note the @ symbols tell the console to not output the command text]
@set /p choice="Choose option A, B or C:"
@if %choice%==A ( goto Exit )
@if %choice%==B ( goto Exit )
@if %choice%==C ( goto Exit )
:invalidchoice
@echo you have selected an invalid choice
:Exit
@echo You selected %choice%
Here's a working example, but I've implemented it stupidly so you can correct some things.
1) You only have the illusion of choice, they all go to the same place. You will probably be marked lower for this.
2) Part of your problem was that you had no control flow in your if statements (read gotos). It would always fall through to invalid choice which kicked you into a loop. I took that out because it was annoying.
3) Try tracing where the program is going by writing a line down until you hit a jump statement, then jump to that statement. It's pretty simple.
[Note the @ symbols tell the console to not output the command text]
@set /p choice="Choose option A, B or C:"
@if %choice%==A ( goto Exit )
@if %choice%==B ( goto Exit )
@if %choice%==C ( goto Exit )
:invalidchoice
@echo you have selected an invalid choice
:Exit
@echo You selected %choice%
Friend + Friend + Friend - Titanfall = -1
Re: Help!
word
Re: Help!
This might not help with the above problem but
check out this http://www.youtube.com/watch?v=qybUFnY7 ... yer_popout
it is very interesting and funny
check out this http://www.youtube.com/watch?v=qybUFnY7 ... yer_popout
it is very interesting and funny
- x-GAMBIT-x
- Cock-docker
- Posts: 2500
- Joined: Wed Apr 30, 2008 5:30 am
- Location: Minnesota
- Contact:
Re: Help!
Thanks Ghosted that worked great.Ghosted wrote:Lemme preface that batch is horrible and I go out of my way not to use it. You should recommend to your teacher that she teach something useful like powershell. You will not pick up any good habits using batch. At least you guys are using Python as well. That's a great beginner language.
Here's a working example, but I've implemented it stupidly so you can correct some things.
1) You only have the illusion of choice, they all go to the same place. You will probably be marked lower for this.
2) Part of your problem was that you had no control flow in your if statements (read gotos). It would always fall through to invalid choice which kicked you into a loop. I took that out because it was annoying.
3) Try tracing where the program is going by writing a line down until you hit a jump statement, then jump to that statement. It's pretty simple.
[Note the @ symbols tell the console to not output the command text]
@set /p choice="Choose option A, B or C:"
@if %choice%==A ( goto Exit )
@if %choice%==B ( goto Exit )
@if %choice%==C ( goto Exit )
:invalidchoice
@echo you have selected an invalid choice
:Exit
@echo You selected %choice%
Now! do you want to do my Python assingment for me...
Yeah, the Into to Programming (Python 3) is required to take for a Computer Tech Support and I will more than likely never use it after school. I'm about a week or two behind on some of my assignments, Some I work on for hours then have to start all over "I hate this CRAP"
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Gambit Just Dealt You The Card of Death!!!!!
Re: Help!
Hermit wrote:This might not help with the above problem but
check out this http://www.youtube.com/watch?v=qybUFnY7 ... yer_popout
it is very interesting and funny
- CTC-JimRimya
- Site Admin
- Posts: 3926
- Joined: Wed Dec 12, 2007 8:31 am
- Contact:
Re: Help!
Extra credit: Make the code accept both upper case and lower case entries as valid (not just upper case)
Also, as ghosted said, powershell is so much more useful... even VBS under WSH would be better than batch.
Also, as ghosted said, powershell is so much more useful... even VBS under WSH would be better than batch.
"The abyss gazes also into you"
- x-GAMBIT-x
- Cock-docker
- Posts: 2500
- Joined: Wed Apr 30, 2008 5:30 am
- Location: Minnesota
- Contact:
Re: Help!
Yeah, the batchfile is just one of the many things that the instuctor is teaching for basic command line use. The instrctor just showed a few so far on some of the basic command phrases used in them "I Guess". Powershell is for a programming class except now they don't use it now, instead they use Python 3 now. Although we did learn a little bit of powershell in server classes. I guess for Computer Tech Support peeps, they just want us to have a basic understanding for them and what programmers do. Something like that.CTC-JimRimya wrote:Extra credit: Make the code accept both upper case and lower case entries as valid (not just upper case)
Also, as ghosted said, powershell is so much more useful... even VBS under WSH would be better than batch.
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Gambit Just Dealt You The Card of Death!!!!!
Re: Help!
Thank you "Mr.Bean" for inserting the "Picture Link with the arrow"
below my "written link" only. I clicked first on "URL" did not work so I tried
clicking on "Img" but still no luck. Now you put it in the correct way and thanks again.
I also clicked on to your website and downloaded the nice maps. Very impressive.
below my "written link" only. I clicked first on "URL" did not work so I tried
clicking on "Img" but still no luck. Now you put it in the correct way and thanks again.
I also clicked on to your website and downloaded the nice maps. Very impressive.
Re: Help!
- Don't copy the whole URL, only this qybUFnY7Y8wHermit wrote:Thank you "Mr.Bean" for inserting the "Picture Link with the arrow"
below my "written link" only. I clicked first on "URL" did not work so I tried
clicking on "Img" but still no luck. Now you put it in the correct way and thanks again.
I also clicked on to your website and downloaded the nice maps. Very impressive.
- Paste that part of the URL here in the forum
- Hi-lite the code you just pasted and click the "youtube" button
Try the same on Mike's Beatles 'Help!' post. I love that song. Glad you like my little projects.
- WeedVulture
- Holy sh*t!
- Posts: 835
- Joined: Fri May 23, 2008 7:36 pm
Re: Help!
gambit,
1+3+3=7
hope this helps.
1+3+3=7
hope this helps.