• What Are You Working On August 2012
    2,271 replies, posted
since the other thread gets less attention and i need a answer asap might aswell as go here i am working on a small text based game where the user rolls higher or lower than 15 depends on what happens either they get hit or the enemy gets hit. However i'm stuck as to why it stops rolling after the first roll and the roll is the same number every time. ignore the 13 i removed that just now [IMG]http://puu.sh/10hdu[/IMG]
[QUOTE=confinedUser;37465593]since the other thread gets less attention and i need a answer asap might aswell as go here[/QUOTE] fuck off. the reason the other thread exists is to get shit like this out of this thread.
[QUOTE=confinedUser;37465593]since the other thread gets less attention and i need a answer asap might aswell as go here i am working on a small text based game where the user rolls higher or lower than 15 depends on what happens either they get hit or the enemy gets hit. However i'm stuck as to why it stops rolling after the first roll and the roll is the same number every time. ignore the 13 i removed that just now [IMG]http://puu.sh/10hdu[/IMG][/QUOTE] Send me a message on Steam, I'll take a look, all my modules are cancelled for the day anyway :)
thank you also swift the other thread isn't effective as much
[QUOTE=qqqqqqqq;37465436]Too much OOP kool-aid going around.[/QUOTE] 1:37 PM (UTC) structural typing erryday :eng101:
[QUOTE=confinedUser;37465808]thank you also swift the other thread isn't effective as much[/QUOTE] Why not post in the news node to get more attention to your post while you're at it? [sp]if you're dense, don't actually do it, that's horrible[/sp]
[QUOTE=Perl;37465891]Why not post in the news node to get more attention to your post while you're at it? [sp]if you're dense, don't actually do it, that's horrible[/sp][/QUOTE] no i wasn't going to do it
[QUOTE=confinedUser;37465593]since the other thread gets less attention and i need a answer asap might aswell as go here i am working on a small text based game where the user rolls higher or lower than 15 depends on what happens either they get hit or the enemy gets hit. However i'm stuck as to why it stops rolling after the first roll and the roll is the same number every time. ignore the 13 i removed that just now [IMG]http://puu.sh/10hdu[/IMG][/QUOTE] Go to the other thread and post your code. I can't fix things just by looking at them.
[QUOTE=qqqqqqqq;37464820]The earlier implementation from that other guy put a reference (pointer) for each component into the structure. With 32 bit pointers that means you've now got a structure twice as big as it should be when holding 32 bit floats. This affects cache performance on top of the extra dereference required. [/QUOTE] I assumed compilers would be intelligent enough to actually represent the variable instead of pointing to it. Oh well, it is C++ after all. I will keep it that way though, the class is not used often and it's too convenient to access the values by .rgba. [editline]30th August 2012[/editline] [QUOTE=qqqqqqqq;37465436]This idea that creating a complex inheritance tree is somehow easier to understand than a few functions that work on a plain well specified piece of data is absurd. Too much OOP kool-aid going around.[/QUOTE] vec2_multiply(vec1, vec2); versus vec1 * vec2 vec3_multiply(vec1, vec2); versus.. you know vec4_multiply(vec1, vec2);
Since this is the new place to ask for help, here goes.. [IMG]https://dl.dropbox.com/u/27714141/conundrum.png[/IMG] So, there's me, with my A.D.D, chasing that rabbit furiously.. And there's a grid. It's actually a raw video frame in 24-bit RGB. I'm supposed to iterate the grid bottom-left to top-right. But check this: the right column and the top row may exist partially. Then I must iterate the individual cells and reverse the endianess accordingly. I get to the 3rd nested loop before I look away, spot the rabbit and chase it anyway. Can you do better? You sure? Okkay. [sp]That rabbit is my attention span right now.[/sp]
[QUOTE=WeltEnSTurm;37466361] I assumed compilers would be intelligent enough to actually represent the variable instead of pointing to it. Oh well, it is C++ after all. I will keep it that way though, the class is not used often and it's too convenient to access the values by .rgba. [/QUOTE] It depends on the situation as to what the compiler can eliminate, in real code it becomes harder for the compiler to do eliminate superfluous crap. Please at least make it an inline function. :) [QUOTE=WeltEnSTurm;37466361] vec2_multiply(vec1, vec2); versus vec1 * vec2 vec3_multiply(vec1, vec2); versus.. you know vec4_multiply(vec1, vec2); [/QUOTE] Operator overloading has little to do with inheritance or even OOP.
[QUOTE=qqqqqqqq;37466575]Operator overloading has little to do with inheritance or even OOP.[/QUOTE] I don't know what you're doing, but last time I checked one was required to create a distinct type to overload an operator (which also means they can be inherited). You might check your definition of OOP. [URL]http://en.wikipedia.org/wiki/Operator_overloading[/URL] What's that in the first sentence? On thread topic: Rewriting all class names to be upper case, variables to be lowercase. Going to write a GUI text class (for marking, copying, auto formatting and that) after that
[QUOTE=Dr Magnusson;37465310]The thing you have to ask yourself when dealing with object inheritance like this is: Is every Derived a Base? In this case, is every color a vector? If you can truthfully say that in your project, this is always true, then by all means go ahead. If this is not the case, you've gotta get more abstract. You could design a base class that implements the shared functionality between them, and then derive both vectors and colors from that.[/QUOTE] I'd view a color as much a vector as I'd view a direction, a position or a row of a matrix. The meaning to the vector is given by the programmer, and so it should be enforced by the programmer.
My small GUI project has 241 warnings. Is this bad? :v: [IMG]http://pasteboard.s3.amazonaws.com/images/1346333327872095.png[/IMG]
I don't know about anyone else, but I always have my warnings flagged as errors. A warning is basically saying "Hey, you really shouldn't be doing this, but we'll let you do it anyway in case you're trying to compile old code that you can't change."
When do you ever want to cross-multiply colors? :v: Whatta shitty timing to post this.
[QUOTE=qqqqqqqq;37466575]Please at least make it an inline function. :)[/QUOTE] Okay now this is something I've tested numerous times. If your compiler doesn't automatically inline your functions (and methods) then you need to find a new compiler. In most cases adding "inline" or moving a method to the .h doesn't actually do anything when compiling release. [QUOTE=qqqqqqqq;37466575]Operator overloading has little to do with ... OOP.[/QUOTE] What OOP are you talking about? Because operator overloading is a big bonus to what I consider object oriented programming. I've been trying to find your point this entire debate (even sent you a PM which I guess you haven't seen yet). But all I can get out of it is: "This isn't how I use OOP so you're wrong." I challenge the notion that there's a "correct" way to utilize object oriented programming.
[QUOTE=Lexic;37467908]I don't know about anyone else, but I always have my warnings flagged as errors. A warning is basically saying "Hey, you really shouldn't be doing this, but we'll let you do it anyway in case you're trying to compile old code that you can't change."[/QUOTE] <cue jokes about strange real life occurences happening to programmers because they ignore warnings>
[QUOTE=jalb;37468092]Okay now this is something I've tested numerous times. If your compiler doesn't automatically inline your functions (and methods) then you need to find a new compiler. In most cases adding "inline" or moving a method to the .h doesn't actually do anything when compiling release. [/QUOTE] I think he was talking about that I should create functions r(), g(), b(), a() and so on instead of using references in the class, which makes the class bigger and fills the cache with unneeded junk, causing more cache misses.
[QUOTE=DrLuckyLuke;37468095]<cue jokes about strange real life occurences happening to programmers because they ignore warnings>[/QUOTE] [img]http://rationalwiki.org/w/images/2/2f/Tumbleweed.gif[/img]
well this page was a disappointment
[img]http://24.media.tumblr.com/tumblr_m9kq7rrMnr1rv1no2o1_1280.png[/img] Image analysis script I wrote to mathematically analyse height-maps. Image shown is a 13x13 mile height-map segment from the Scottish highlands.
[QUOTE=amcfaggot;37468382]well this page was a disappointment[/QUOTE] Don't worry, I can liven things up.
[QUOTE=Mr.T;37468580]Don't worry, I can liven things up.[/QUOTE] Which programming language did you learn today?
[QUOTE=danharibo;37468600]Which programming language did you learn today?[/QUOTE] FORTRAN 4.
Dlaor, what kind of algoritm did you use to create the maps in space game?
I'm sure I could dig up some Unicode stuff before it's over if you want to. Geel get in here we need more memes.
nested if/else etc etc
if(true) do logic
use bullwhip
Sorry, you need to Log In to post a reply to this thread.