Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Reegan

  • Rank
  1. Ah yeah, makes sense, thanks for clearing that up. This refactoring stuff is hard, im trying to change the code to what was suggested here but i feel like something is going to break if i refactor to much ( if you can understand what im saying ). Got any specific tips for refactoring? ill read your article on it again see if i can find any.
  2. Reegan

    Problem with Random Numbers

    Quote:Original post by Chadwell Only thing I can see wrong from skimming it is this: int random() { srand((unsigned)time(0)); number = (rand()% 6) + 1; return number; } You don't need to call srand() every time you want a random number. You should call it once before any call to rand(), and then afterwards just call rand(). Oh yeah, i forgot that >_< i must be tired ( 3:24 am ) that should solve your problem.
  3. Reegan

    Problem with Random Numbers

    What exactly isnt right? What number range are you getting?
  4. Quote:Original post by jpetrie Quote: I could have sworn this person See the link in my signature ;) Haha, good stuff, ive already read the article on the home page but i get what you was trying to say with your last post. [smile] I am a little confused though, in the article about Rewrite or Refactor you refer to the programmer in question as "she" so i assumed the article was written by a woman, but are you not a man? correct me if im wrong please and why would you target that specific gender ( im kinda confused here [lol] ) EDIT: Did i get rated down for this post? i thought i was at 935.. it went up from 932, to 935, and back down again to 924, i dont like this rating system i never get rated up for the all the friendly help i give to people... ( mostly because they are fairly new and have easy questions to answer lol ) [Edited by - Reegan on March 25, 2009 12:29:43 AM]
  5. Quote:Often, inexperienced programmers will come to a point where they decide that their existing code base is fatally flawed in some way. Perhaps they’ve learned some new techniques that cannot be cleanly integrated into the code, perhaps they’ve stumbled across a requirement they cannot address, or perhaps they simply don’t like the naming conventions they used. Whatever the reason, the programmer will often decide that the solution is a complete re-write of her code base. “This time,” she says, “I’ll get the design right the first time! My new code will be better, cleaner, more robust, more generic, and overall more powerful and less buggy!” I could have sworn this person was writing about me specifically [lol] I guess ill be refactoring then. Thanks again.
  6. Well, if it were me in your shoes, id grab myself the free Visual C++ Express IDE Then hunt for some Online Tutorials and/or a Good Book, finally a C++ Referance Site. Then id knuckle down and start learning. [smile]
  7. Ok, I think im going to rewrite almost everything, while sticking by what everyone here has said. Thanks for you help.
  8. Reegan

    [Question] Meshes

    I think there is a Panda X plugin for blender google Panda X exporter or something to find it. EDIT: My mistake. im sure you can find an exporter somewhere around though.
  9. Your right, i do need to get a tougher skin, sorry for being such an idiot, i do really want to become a better software/game developer and yours and others knowledge is worth a tremendous amount to me. Im in the process of making the changes suggested, for the poor names of chosen for my methods and and parameters, could you point out which ones are not easily understood and perhaps (if you'd be so kind) suggest some replacements for them? Thankyou [smile]
  10. My friend tells me im a "douche bag" for writing what i did in my previous post, about me getting a sense of hostility from jpetries post, so im sorry to you guys. [sad]
  11. Ok, @jpetrie: Your post seems a little hostile and unforgiving ( if it was not intended to be that way, im sorry for assuming ). - I find the STL's implementation of a dynamic array even more confusing than mine, for staters, it is called a 'vector' and the word vector can mean any number of things, such as the mathmatical interpretation of a vector and vector graphics they should have called it something like std::darray or something. snippet taken from vector ( size_type n, const T& value= T(), const Allocator& = Allocator() ); how is size_type n any easier to read than unsigned size? and const T& value= T() ? I dont find that easy to read atall. I could post more examples of std::vector's poor naming, but there is no point, you already know the names of each parameter, method and member - Those methods that are overloaded all did origionally have thier own names ( such as Insert, but i decided to overload them because I prefered it that way ) - Changing Delete to Remove, i like it, thanks. - I also had a non const [] operator but a friend of mine to me to change it, why would it mater anyway? i dont intend on having that operator change any of the members, i thought thats what const methods prevent from happening (changing member values inside itself). - GetFirst and GetLast, was again a friends idea (not the same friend as the one i mentioned previously) and yes i too find the kind of pointless, im going to remove them. GetData returns the pointer to the array, i made it so i could check against it to test to see if an array had been created or not, this prevents an exception being thrown ( or rather will be thrown ) when using [] when ArrayData is null - Capacity in my class is not the same as std::vectors it just returns ArraySize - 1, which is kinda pointless, i dont even remember why i put it there. But if you mean there is no way to adjust the size of the array then that is Resize(). - Iterators and Allocators, dont even know what they are, so meh. - going by your other post, i found the "censored" comment to be a tad spiteful, tell me, have i angered you in some way? [sad] Im sorry my class is not STL worthy, [lol] but theres little i can do about that, however, ive taken on board what you've said and am going to go through my class again and change a bunch of stuff ( also do some research on Allocators and Iterators ) @Palidine Ok, ill take a look into making it work the way you have suggested ( the STL way ) the performace boost must and probably is big judging by you insisting i work with a dynamic array this way [smile]. I dont mean to be rude, but the class isnt for you/anyone [lol] but if it was im positive when learning std::vector you had to look at C++ referance sites to find out what each method/member does/is, how is this any different from looking into the header a bunch of times? eventually you will learn what each method is through repetition of use [smile] Thanks guys!
  12. I realise the stuff about exceptions, just havent done anything about it yet, main reason i started this thread was to have people test the functionality of my class, not its implementation, but this is good advice all the same [smile]
  13. Thanks for teh suggestions, ill start working my way through them [smile] however i dont think i can do the 5th one, because i dont understand why i would want to do that as that method takes extra elements, lets say i have an array of 1000 elements, in actual fact there would be 1500, with 500 taking up extra space. If i had a supposed 2000 elements, i would actually be taking up 3000 spaces in memory. Plus, this is for fun and it would take to much time to implement that, in the end, i just cant be bothered [lol] Thanks again PS: So how does memcpy differ from my loop? what does memcpy do internally?
  14. Nope, "... dynamic array class ( just for the heck of it )" lol besides all code i write is for myself, no employer or team, so if it were for production code then thats, really, ultimately, up to me. I mean, if the code is bad, i wont be hurting anyone but myself, so yeah. [smile]
  15. Hi there, ive been working on a dynamic array class ( just for the heck of it ) and ive basically got everything i wanted done, except for a couple of obvious methods with inefficiency written all over them ( only like 2 i think ). Anyway i wondered if anyone here would like to take a shot at using it and help me find bugs? or am i not aloud to post stuff like this? Heres the code, just slap it into a header and include it in your project: PasteBin Linky Thanks lots everyone [grin] ~Reegan PS: Im also open to suggestions from those who have tested [smile].
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!