Help!

Latest news and general discussion.

Moderator: Admins

User avatar
x-GAMBIT-x
Cock-docker
Posts: 2500
Joined: Wed Apr 30, 2008 5:30 am
Location: Minnesota
Contact:

Help!

Post by x-GAMBIT-x »

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.
Attachments
Command Line.txt
(847 Bytes) Downloaded 72 times
Image
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Image
Gambit Just Dealt You The Card of Death!!!!!

User avatar
Ghosted
Cock-docker
Posts: 2897
Joined: Thu Jun 12, 2008 1:58 am
Location: Dark Iron Prison

Re: Help!

Post by Ghosted »

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%
Friend + Friend + Friend - Titanfall = -1
Image

User avatar
ru_exp
Cock-docker
Posts: 2556
Joined: Sun Aug 17, 2008 5:50 am

Re: Help!

Post by ru_exp »

I don't wtf he just said but I'd hit that.


:x
Image

User avatar
Mr Bean
Cock-docker
Posts: 2495
Joined: Sun May 04, 2008 7:35 am
Location: Above ground
Contact:

Re: Help!

Post by Mr Bean »

word
Image

Hermit
Dominating
Posts: 340
Joined: Sat Mar 05, 2011 6:34 am

Re: Help!

Post by Hermit »

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

User avatar
x-GAMBIT-x
Cock-docker
Posts: 2500
Joined: Wed Apr 30, 2008 5:30 am
Location: Minnesota
Contact:

Re: Help!

Post by x-GAMBIT-x »

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%
Thanks Ghosted that worked great.
Now! do you want to do my Python assingment for me... :mrgreen:
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"
Image
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Image
Gambit Just Dealt You The Card of Death!!!!!

User avatar
Mr Bean
Cock-docker
Posts: 2495
Joined: Sun May 04, 2008 7:35 am
Location: Above ground
Contact:

Re: Help!

Post by Mr Bean »

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
Image

User avatar
CTC-JimRimya
Site Admin
Site Admin
Posts: 3926
Joined: Wed Dec 12, 2007 8:31 am
Contact:

Re: Help!

Post by CTC-JimRimya »

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.
"The abyss gazes also into you"

User avatar
x-GAMBIT-x
Cock-docker
Posts: 2500
Joined: Wed Apr 30, 2008 5:30 am
Location: Minnesota
Contact:

Re: Help!

Post by x-GAMBIT-x »

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.
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.
Image
D/L Maps for CTC Server+More-> http://ctc-map-downloads.synthasite.com
Image
Gambit Just Dealt You The Card of Death!!!!!

Hermit
Dominating
Posts: 340
Joined: Sat Mar 05, 2011 6:34 am

Re: Help!

Post by Hermit »

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.

User avatar
MikeFiend
Cock-docker
Posts: 1374
Joined: Fri Dec 14, 2007 11:53 pm

Re: Help!

Post by MikeFiend »


User avatar
Mr Bean
Cock-docker
Posts: 2495
Joined: Sun May 04, 2008 7:35 am
Location: Above ground
Contact:

Re: Help!

Post by Mr Bean »

Hermit 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.
- Don't copy the whole URL, only this qybUFnY7Y8w
- 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.
Image

User avatar
WeedVulture
Holy sh*t!
Posts: 835
Joined: Fri May 23, 2008 7:36 pm

Re: Help!

Post by WeedVulture »

gambit,
1+3+3=7
hope this helps.
Image

rimmer59
Cock-docker
Posts: 1103
Joined: Wed Jun 02, 2010 12:39 am
Location: Minnesota.

Re: Help!

Post by rimmer59 »

WeedVulture wrote:gambit,
1+3+3=7
hope this helps.
gambit,
1+1/2+1/2+5=7
hope this helps.

User avatar
WarDad71
Cock-docker
Posts: 2300
Joined: Tue Jun 03, 2008 3:39 pm

Re: Help!

Post by WarDad71 »

rimmer59 wrote:
WeedVulture wrote:gambit,
1+3+3=7
hope this helps.
gambit,
1+1/2+1/2+5=7
hope this helps.
Weed's post is LEET :wink:
Image

Post Reply