
-----------------------------------
Archi
Sun Jul 13, 2003 4:11 pm

My Inventory Routine Not Working Properly
-----------------------------------
Thx for the criticism. I'll code how I like. 'Nuff Said!!

-----------------------------------
Tony
Sun Jul 13, 2003 4:53 pm


-----------------------------------
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

-----------------------------------
Archi
Sun Jul 13, 2003 5:01 pm


-----------------------------------
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
Sun Jul 13, 2003 5:13 pm


-----------------------------------
thats the whole point..

DONT PRACTISE BAD PROGRAMMING.

whether it's a hobby or some serious project.

-----------------------------------
Archi
Sun Jul 13, 2003 5:17 pm


-----------------------------------
How is it bad programming ehh?

-----------------------------------
rizzix
Sun Jul 13, 2003 5:20 pm


-----------------------------------
i dunno.. didin't see ur code..
but if tony saw something... u probably did something wrong  :?

-----------------------------------
rizzix
Sun Jul 13, 2003 5:20 pm


-----------------------------------
the point i was trying to make is don't practise bad programming whether it's a hobby or not

-----------------------------------
SilverSprite
Sun Jul 13, 2003 5:21 pm


-----------------------------------
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.

-----------------------------------
Tony
Sun Jul 13, 2003 5:42 pm


-----------------------------------
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

-----------------------------------
krishon
Mon Jul 14, 2003 10:06 pm


-----------------------------------
all u hafta do for indenting is press F2 and it does it for u,  :lol:
