• Announcements

    • rei

      Battle of the Anime Characters   02/10/17

      THE BATTLE OF THE ANIME CHARACTERS HAS BEGUN   Find it here http://duelistgroundz.com/index.php?/forum/615-battle-of-the-anime-x/
Sign in to follow this  
Followers 0
Ronald Zimmerman

Coding help

17 posts in this topic

So because i am 26 and have had 0 need to learn coding before i was forced to take into to programming I have 0 idea what the hell i am doing Urthor said to try here so if i get yelled at i am complaining to him later

 

http://pastebin.com/6b0pcPj8

 

i have to take that code and make it do this:

 

Once a valid input file is specified, the program will read in, decode, and process all the cards in the file.  The output of the program will be written to the specified output file. 

                 

The program will evaluate each coded card entry and determine if it is valid in terms of rank, suit, and format.  If valid, the program will output the possible values of the card (multiple values for an ace, single values for the others).  If invalid, the program will output out the appropriate error message.  If two or more coding errors are found, the card code is deemed “unrecognizable”. .

 

with these documents:

Posted inside google docs to make my life easier

 

https://drive.google.com/file/d/0B8Emx1BIWRCTbEdfcFVGaGZ6Ums/view?usp=sharing

https://drive.google.com/file/d/0B8Emx1BIWRCTei1adTRIbzVXT2s/view?usp=sharing
https://drive.google.com/file/d/0B8Emx1BIWRCTZXk0WXNCRU1LUmc/view?usp=sharing
https://drive.google.com/file/d/0B8Emx1BIWRCTdUpxS2J0alVBdjg/view?usp=sharing
https://drive.google.com/file/d/0B8Emx1BIWRCTMlg2akliQllBZWc/view?usp=sharing
https://drive.google.com/file/d/0B8Emx1BIWRCTYVpYRUxUNEZwZW8/view?usp=sharing

 

IN:       2-H

OUT:  Two of hearts (value = 2)

IN:       1-C

OUT:   Invalid card rank in 1-C

IN:       7-K

 

I have 0 idea what i am doing would prefer you to use smaller words due to english not being my first language plz

 

Any help is appericated like i need help

-1

Share this post


Link to post
Share on other sites
WHY DOES YOUR CODE HAVE NO COMMENTS IN IT
3

Share this post


Link to post
Share on other sites
WHY CAN'T YOU DO YOUR HOMEWORK ON YOUR OWN
0

Share this post


Link to post
Share on other sites

I don't think it's "his' code. Just something he got from the teacher.

 

Can the OP confirm/deny?

0

Share this post


Link to post
Share on other sites
You clearly have never had to work on anyone elses code
-1

Share this post


Link to post
Share on other sites

except that i do it daily

you have no idea what you're talking about

 

code should be self documenting. comments are most of the time unnecessary and misleading overtime.

-1

Share this post


Link to post
Share on other sites
Self-documenting code is just a fancy term for using good naming conventions and style, it's a component of good programming, much like actual documentation is

I'm not sure how to even argue this, every best practices document out there encourages documenting your code
4

Share this post


Link to post
Share on other sites
Do you think explaining what youre doing before every line is necessary with good code? No
If u mean documenting what the function does + input parameters before the start of the function then i agree
0

Share this post


Link to post
Share on other sites
That's probably what he means and I would agree.
0

Share this post


Link to post
Share on other sites
-facepalm
0

Share this post


Link to post
Share on other sites

Comments should clarify what potential readers might fail to grasp?

0

Share this post


Link to post
Share on other sites

code should be self documenting , fuck comments

LMFAO

0

Share this post


Link to post
Share on other sites

anyone not understanding that should probably read the clean code

have fun maintaining your code, dumbfuck

 

and a documention of the function before it starts isn't regarded as "comments". i raise your facepalm with a facepalm

0

Share this post


Link to post
Share on other sites
you're being pedantic and yet incorrect, pre-function documentation is still comments, and comments are still relevant in complex algorithms when it would be easier to sum up function and use rather than expect someone to trace through the chain of logic.
1

Share this post


Link to post
Share on other sites

comments (no, not documents to the code that you would afterwards generate to html - doxygen and whatnot) should only be used when absolute necessary. i'm against the ideology of sticking comments wherever possible 'to make it more understandable'. people are just lazy and would rather have unreadable code filled with comments. that's bad practice.

if your logic is complex, it's fine, but it should be a last resort.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.