Welcome to the Builder Academy

Question how can fight.c call diag_char_to_char?

More
06 Nov 2012 02:21 #994 by Liko

wifidi wrote: Dear Liko,
Thanks a million. I'll stop posting unoptimized code until I can code the streamlined version of the idea in question. In the end, if two code segments achieve the same goal yet one takes less memory and CPU..., etc. I began thinking I'm good enough to teach how to code and now see I have too much to learn yet. I look forward to being a more substantial contributor.


Any time. I'm always willing to help. I should of noticed it when I read it was a static void, but I was too tired. Always good to have more contributors. I'm preparing to add a socket system for weapons and armors. I'm wanting to release it for TbaMUD and hope it makes it into an actual release.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
07 Nov 2012 19:00 - 07 Nov 2012 19:04 #1006 by wifidi
The attached melee health report code calls act.informative.c's diag_char_to_char() instead of duplicating its table in fight.c, plus modifies 'look' and 'diagnose' to say "You..." when its your character.

While convenient to consolidate a "buffet of information" into one function, it seems faster to invoke only the necessary information at the location instead of calling a fuller than necessary function. I've read criticism of "cargo cult" programming. There's probably an altogether smarter way to send melee messages to who wants to see them and is qualified to, instead of iterating the room, and conditionally sending messages or conditionally calling diag_char_to_char. Thanks again. I'm guessing screen efficiency aka style and efficiency sometimes differ. If I knew I could make a program faster with tailored instead of centralized information tables, I'd still be concerned about programming style. Plus consider many pieces of information are readied alongside others without getting utilized. It's more like an "if I knew the future I wouldn't ready this much information" problem.

To me it seems like what in real life would be setting the table before knowing how many people are eating v. setting two tables then deciding which one to use after the guests arrive.
Attachments:
Last edit: 07 Nov 2012 19:04 by wifidi. Reason: to add "conditionally sending *messages*"

Please Log in or Create an account to join the conversation.

Time to create page: 0.183 seconds