Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 "How Much You Suck" Program
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
S_Grimm




PostPosted: Tue Apr 29, 2008 11:10 am   Post subject: "How Much You Suck" Program

A friend of mine wanted me to make a program for him that determined how muck people "sucked". So I did. I'm looking for some constructive critisism on the program : namely, anything I could do to clean up the code. Oh, and only use lower case letters.


How Much You Suck V2n.t
 Description:
The "How Much You Suck" program

Download
 Filename:  How Much You Suck V2n.t
 Filesize:  3.42 KB
 Downloaded:  403 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
petree08




PostPosted: Tue Apr 29, 2008 11:37 am   Post subject: RE:"How Much You Suck" Program

???

this is so bad...

there is no way a program that does this should be 139 lines
S_Grimm




PostPosted: Tue Apr 29, 2008 11:49 am   Post subject: Re: "How Much You Suck" Program

I ask for constructive critisism, not "This is so bad!". If I wanted that, I would have posted "Tell me how much this program sucks."
petree08




PostPosted: Tue Apr 29, 2008 12:10 pm   Post subject: RE:"How Much You Suck" Program

well now that you invited the how does it suck...


- No input error checking
- no repetition
- unnessecary ifs
- the idea behind the program is terrible
- can't handle upper case
- at the begging promt "Do you want to play Enter yes or no" i typed in "dfgasdfa" and it just went on as if i entered yes
- program still runs even if "no" is entered
- i told it i have 0 letters in my name and it kept going, but then crashes
- "you suck 30%" ... um 30% of what?



There is almost nothing good i can say about this program
Sean




PostPosted: Tue Apr 29, 2008 12:29 pm   Post subject: Re: "How Much You Suck" Program

Turing:

%You suck program
%A\V


% Inizilizes
var yesno : string
var numberofletters : int


% Opening : if you wanna play
for opening : 1 .. 1
    put "This program will tell you how much YOU suck. Do you want to play?"
    put "Enter yes or no : " ..
    get yesno
    if (yesno = "no") then
        put "Well, if you want to play, come on back!"
        exit
    end if
    if (yesno = "yes") then
        put "Great. This game uses the number of letters in your name to determine how much "
        put "you really suck."
    end if
end for

% Getting the variables
for variables : 1 .. 1
    put "How many letters are in your name? : " ..
    get numberofletters
    put "Let me make sure I have this right. You have ", numberofletters, " in your name. Is this right?"
    loop
        put "Type 'yes' or 'no' and press 'Enter' : " ..
        get yesno
        if (yesno not= "no") and (yesno not= "yes") then
            put "Invalid Answer......"
        end if
        if (yesno = "no") then
            put "Please re-enter the number of letters in your name : " ..
            get numberofletters
        end if
        if (yesno = "yes") then
            put "Okay, let's move on."
            exit
        end if
    end loop
end for


There is no need for the for loops in the beginning of the program. These for loops are doing nothing, therefore are not needed.

Turing:

for i : 1 .. 1
%Stuff
end for


That does nothing, you start at 1 point and end at the same point. It is doing just one thing, and requires no for loop for those put statements.

Also, there is no need for the numerous if statements determining the the value fo the letters. You can combine these if statements into elsif statements and it will make the program cleaner then it is.

Some of your put statements need to be re-worded for users to understand.

Turing:

put "This program will tell you how much YOU suck. Do you want to play?"
    put "Enter yes or no : " ..
    get yesno
    if (yesno = "no") then
        put "Well, if you want to play, come on back!"
        exit
    end if
    if (yesno = "yes") then
        put "Great. This game uses the number of letters in your name to determine how much "
        put "you really suck."
    end if


Above, you have specified that the user needs to enter the number of letters in your name. With the previous question typing yes or no, the person is going to type the word for the number instead of the numerical value. That will result in the program finishing, I believe you should change it to accept what the user inputs. Both numerical and words.
btiffin




PostPosted: Tue Apr 29, 2008 12:39 pm   Post subject: Re: "How Much You Suck" Program

I'm not going to critique the code, but when doing funny/punny in your face programming like this; If the answer to the Do you want to play? is negative ... come on. "You Suck!" Is the response to that one. Smile

Cheers.
Tallguy




PostPosted: Tue Apr 29, 2008 12:42 pm   Post subject: RE:"How Much You Suck" Program

y do we suck due to the letters that make up your name?
S_Grimm




PostPosted: Tue Apr 29, 2008 12:47 pm   Post subject: Re: "How Much You Suck" Program

The idea was, yes you suck based on the LETTERS of your name, not the Number. and Petree, It's 30% of 100%. It's like a rating system.
Sponsor
Sponsor
Sponsor
sponsor
petree08




PostPosted: Tue Apr 29, 2008 12:51 pm   Post subject: RE:"How Much You Suck" Program

why would you even bother trying to defend this program? it's not even funny , just a waste of 139 lines
S_Grimm




PostPosted: Tue Apr 29, 2008 12:55 pm   Post subject: Re: "How Much You Suck" Program

Thanks y'all for the critism. I'll reprogram it with your suggestions.
raidercom




PostPosted: Tue Apr 29, 2008 2:26 pm   Post subject: Re: "How Much You Suck" Program

I might be tempted to do some input validation:
You can enter 1 for the number of letters in your name, then put 12 characters in.

Also, how come you can have a total suck rating of over 100%?

And someone else mentioned this, but the initial for loops are not needed.

I could be mistaken, but couldn't you use:
for a: 1.. length(input_variable)
for the for loop at the bottom? Instead of the weird array that you are using?
repsoccer16




PostPosted: Wed Apr 30, 2008 7:40 am   Post subject: RE:"How Much You Suck" Program

petree you are supposed to be helpful not just critisizing his program and saying it sucks... help him improve don't discourage him.
Michael516




PostPosted: Wed Apr 30, 2008 7:41 am   Post subject: RE:"How Much You Suck" Program

I don't think that you should bother fixing this program.
raidercom




PostPosted: Wed Apr 30, 2008 9:53 am   Post subject: Re: "How Much You Suck" Program

Michael516 wrote:

I don't think that you should bother fixing this program.

I don't think that this program should be fixed either, but he asked for help, and so I am giving him the critic that he asked for.
DarkFrogFTW




PostPosted: Fri May 02, 2008 4:14 pm   Post subject: RE:"How Much You Suck" Program

Is that an "Exit" statement in a for loop?
... A for loop that does everything inside once?

Fail. I know its mean, but even your program would agree that sucks 100% (I actually didn't ask it, but I'm assuming your program's logical here.)

It'd be a lot easier to make it a random amount. That makes about as much sense as basing it on the letters of their name, in my eyes.

4 lines, mate:

var Garbage: string
put "Enter your name!"
get Garbage
put "You Suck This amount: ", Rand.Int(0,100),"%"

and voila, a working "you suck" program.

Tell you what. If your going to spend 137 lines doing something, make it something useful, like a "zomg l33t halo game!" or something. As a general rule, if stupid programs like this take you over 20 lines of code to write, you fail epically.

Have a nice day.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: