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

Username:   Password: 
 RegisterRegister   
 My Inventory Routine Not Working Properly
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Archi




PostPosted: Sun Jul 13, 2003 4:11 pm   Post subject: My Inventory Routine Not Working Properly

Thx for the criticism. I'll code how I like. 'Nuff Said!!
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Jul 13, 2003 4:53 pm   Post subject: (No subject)

wow, this is bad... but I'm not gonna lecture you on proper programming, the time will come when you understand that code above is... well "bad".

now, you seem to have a problem with your loop. Such as the stucture is something like

continue?
get choice
if choice = yes
loop
..
if choice = no
...
end loop


that doesnt seem right.

Also you should use call the item directly instead of going through a loop. You know what item number it is. So instead of

if i=choice and item(i) = whatever

use

if item(choice) = whatever
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Archi




PostPosted: Sun Jul 13, 2003 5:01 pm   Post subject: (No subject)

I tried the what you told me but it didn't work for some reason when i tried it. And how is it bad programming? Its not like I'm honestly going to manufacture this game. Its just a hobby of mine.
rizzix




PostPosted: Sun Jul 13, 2003 5:13 pm   Post subject: (No subject)

thats the whole point..

DONT PRACTISE BAD PROGRAMMING.

whether it's a hobby or some serious project.
Archi




PostPosted: Sun Jul 13, 2003 5:17 pm   Post subject: (No subject)

How is it bad programming ehh?
rizzix




PostPosted: Sun Jul 13, 2003 5:20 pm   Post subject: (No subject)

i dunno.. didin't see ur code..
but if tony saw something... u probably did something wrong Confused
rizzix




PostPosted: Sun Jul 13, 2003 5:20 pm   Post subject: (No subject)

the point i was trying to make is don't practise bad programming whether it's a hobby or not
SilverSprite




PostPosted: Sun Jul 13, 2003 5:21 pm   Post subject: (No subject)

well from what i got from tony's post.. i dont think your following the rules for structured programming.. you cant intertwine if, and loop statements.. they can be nested in one another but one cant dip into the other.. it just wouldnt make sense.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Jul 13, 2003 5:42 pm   Post subject: (No subject)

also the code itself is too hardcoded and too many if statments... its almost impossible to read without proper indentation.

try to write some custom functions, would make your program soo much better. We have some exelent tutorials available at http://www.compsci.ca/bbs/viewtopic.php?t=407
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Mon Jul 14, 2003 10:06 pm   Post subject: (No subject)

all u hafta do for indenting is press F2 and it does it for u, Laughing
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: