10 questions about coding.
Happy hollidays everyone,
I should have asked these questions 2 years ago, but oh well.
I have come across many C tutorials over the last couple years.
I find that with every tutorial I read there are some concepts that I think are not explained well at all but then another tutorial makes that part of the language crystal clear.
There are still a few areas I am having trouble in, such as writing arrays, for loops, and case statements propperly.
I suppose I will move on to readingg and writing to a file after I finish learning about the basics.
I have limited vision and am stuck using a screen reader, which does make coding more difficult.
I have played around with code on and off for the last 2 years, and still feel that I don't know nearly as much as I should by now.
I don't expect any one person to answer all these questions, I just figure itt would be a great help to many new coders who want to become proficient coders and hopefully contribute to the mudding community.
1. Why is it that some functtions use numbered case statements?
I thought case statements are great for menus, and that the correct way to use them is to have a case for every choice.
I see numbered statements used in the makearmor skill in swr1.0.
2. In the following for loop, why is obj used twice?
I am talking about the second instance of obj to tthe left of the second ;.
for( obj = first_object; obj; obj = obj->next )
3. What is a gsn, gsn_cook for example? I think it is used for holding a value from 0 to 100 showing how much of the specified skill the player has learned.
4. How do arrays work?
In the pcdata structure, there is the learned vvariable, and it has a [] which I believe makes it a variable holdingg a list of numbers.
5. What is the best known reference of standard C functions, by that I mean anything betwene printf and strcat to one_argument.
6. Can anyone recommend a tutorial on how to use valgrend?
I understand valgrend is a great tool for detecting memory leaks.
7. In the event a code starts out dicoo based and say 10 years later is totally diffferent and the code has been rewritten, what steps if any could be taken to get out of dealing with the dicoo licensing restrictions?
I figure one possible strategy would be to download the latest version of dicoo and see what its features are and gradually rewrite code they wrote.
8. Is it practical to have a 3d environment, you still have your normal exits, but each room has coordinates and sub coordinates.
Sub coordinates would be inside the room itself and would work about the same as the idea mentioned at Herne's smaug building site at the bottom of the ideas page.
It would be great to have the code parcially generate the description, maybe the first 3 lines of it, and then have builders fill in the details such as sound and sent if they wish.
I will not need any graphical components for this system as 30% of the players on my mud are blind anyway.
9. What is the easiest way to get the mud to delete a file?
I have a situation where ships are being built with cargo holds which save objects to a file, the file name is the same as the vnum, whenever the game loads up it loads the equipment and skips processing equipment in filenames nnamed after rooms that have been destroyed.
What happens is that someone will create a ship using some or all the destroyed ships vnums, causing the destroyed ships cargo to reappear anywhere the old vnum comes back into use.
10. What is the umin macro, and what is one example use?
Thanks in advance for the help.