- Posts: 37
- Thank you received: 3
Please Log in or Create an account to join the conversation.
wifidi wrote: Dear tbaMUD,
I'd like to call act.informative.c's diag_char_to_char from fight.c. The only difference in fight.c is showing "You" versus "GET_NAME(ch)/someone/an immortal" so it hardly needs to be fully written out twice. I'll pay tbaMUD tuition to learn function scope. Otherwise I have to wait until it comes up in class or magically dawns on me.
'Preciate it,
wifidi
p.s. - I steadily notice the code I'm actually adding getting smaller and smaller, which means I'm becoming a better C programmer.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
wifidi wrote: I'll track down send_to_char() since that function seems callable from anywhere. Beginners want everything accessible everywhere. The programming class I'm in is covering functions now. Maybe the concept of scope in programming becomes challenging in a similar way to the story of Solomon and the baby. "What file is the baby's Mom? And who gets the baby." etc.
Newbs with good ideas, in my case one of CoffeeMUD's, are sometimes bound to write unnecessary lines of code then crawl back onto a forum or site seeking the key to programming as well as an expert or insisting they have a new, awesome MUD. I don't see anything awesome about having to define essentially the same function in act.informative.c, in fight.c. I could cheat and include a header file with the code, yet the point is avoiding redundancy, clarity, efficiency, etc., instead of a program twice as long as another that produces the same result. The tbaMUD admins have either thought of nearly all the basics or implented them. Therefore being unable to call a function from somewhere should serve as a warning re: its intended scope.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024