• What are you working on? v15
    5,001 replies, posted
[QUOTE=Doritos_Man;27996983]Would C# benefit me learning C++ later?[/QUOTE] If you want to learn C++, why don't you learn C++? To answer your question: yes, it would.
[QUOTE=Irtimid;27996999]If you're already using forces and can get the velocity of the object, you could just handle the collisions physically with the use of elastic/inelastic collision equations. Then it wouldn't matter in what direction the object is moving.[/QUOTE] It isn't an _actual_ force, it's just a way to handle gravity, there is no velocity, only the strength of the force and the length of it, and the direction of it.
[QUOTE=Z_guy;27997025]If you want to learn C++, why don't you learn C++? To answer your question: yes, it would.[/QUOTE] I am new to programming and I am looking at some different languages I like how C# is close to Java I like C++ has low dependencies and could land me a job in Game Development if I learn it very well What are the main differences between C++ and C# [editline]11th February 2011[/editline] [QUOTE=Z_guy;27997025]If you want to learn C++, why don't you learn C++? To answer your question: yes, it would.[/QUOTE] I am new to programming and I am looking at some different languages I like how C# is close to Java I like C++ has low dependencies and could land me a job in Game Development if I learn it very well What are the main differences between C++ and C# [editline]11th February 2011[/editline] [QUOTE=Z_guy;27997025]If you want to learn C++, why don't you learn C++? To answer your question: yes, it would.[/QUOTE] I am new to programming and I am looking at some different languages I like how C# is close to Java I like C++ has low dependencies and could land me a job in Game Development if I learn it very well What are the main differences between C++ and C# [editline]11th February 2011[/editline] Oh my god Slowpunch at its finest [editline]11th February 2011[/editline] Oh my god Slowpunch at its finest
[QUOTE=Doritos_Man;27997075]What are the main differences between C++ and C#[/QUOTE] The biggest difference is that C# is garbage collected, so you don't have to manually take care of the memory you are using. The second biggest difference I would say is that C# doesn't #include files, but is more like Java and always knows about everything that is referenced in your project.
Which would you guys recommend to start with C++ or C#
C++ [i]all the way[/i]
[QUOTE=Doritos_Man;27997248]Which would you guys recommend to start with C++ or C#[/QUOTE] I would personally recommend C++, because I think it teaches you more. But I'm sure there are a lot of people here who will beg to differ.
[QUOTE=Doritos_Man;27997248]Which would you guys recommend to start with C++ or C#[/QUOTE] I'd say start off with C#. Learn the basics of programming, structure of code, classes, loops and conditionals and things like that - all the fundamentals. Once you've learnt them in C#, you'll have learnt how to write much of the basics in most languages with similar syntax - C++ being the primary one here. There's small changes between the languages and C# is far easier to program in, but if you want to use C++ eventually I'd still suggest you learn the fundamentals in C# because it's easier.
So far I think I will start with C# and if I decide to I can either go the Java or C++ route
In Java, is there a quick way to randomly select one index in an array that contains a specific value? I was thinking of going through the whole array, seeing which indexes had the right value, adding the indexes to a list, and choosing randomly from there. This seems a bit inefficient to me though.
I don't think there is. Maybe you could change the array though, for example to an ordered list, so all the same values are next to each other, or by storing a Pair<object, amount>. [editline]12th February 2011[/editline] I don't think there is. Maybe you could change the array though, for example to an ordered list, so all the same values are next to each other, or by storing a Pair<object, amount>.
[QUOTE=thomasfn;27952423]You're on a 64 bit machine, right? I can't remember what we did to make it work on 64 bit, but try changing the target platform to x86 and recompile it. It should create a new folder called x86 with Debug/Release inside. You'll then need to copy all of the misc files from the original debug/release folder back in - but don't overwrite anything.[/QUOTE] I tried this and everything I could think of. Could you post an already compiled version? :saddowns:
Been expanding on my Shunting-yard/RPN expression parser a bit. I Added support for user-defined variables and functions (as well as built in ones). I also expanded the parser a bit to allow functions defined in terms of other functions, and composite functions (e.g. g(x) = 2*f(x) or h(x) = g(f(x))). Here's a screenshot of progress: [media] [url]http://dl.dropbox.com/u/8965316/consolecalc_1.png[/url] [/media] Sorry about the "Translated to RPN" clutter, I was fixing a bug and forgot to remove the debug code. EDIT: The sin of pi coming up as 3E -15 is a rounding error, I'll look into fixing it.
I've just entered a stage in my app where it's mostly about ui design (performance also, actually). What I have looks pretty good on the emulator, but I worry about all the different screen sizes. Does anyone have any pointers? Is it going to consume my life? (please no xkcd quotes)
change the screen size of the emulator from the AVD manager, see if it scales properly? You won't get a realistic representation of performance on the emulator btw, even a low-end phone will run a lot smoother than the emulator.
I learned a nice C++ (should work in C etc.) trick today. [code]foo() || bar(); foo() && bar();[/code] is the same as [code]if (!foo()) bar(); if (foo()) bar();[/code] Looks kinda ugly though.
[QUOTE=sim642;28002599]I learned a nice C++ (should work in C etc.) trick today. [code]foo() || bar(); foo() && bar();[/code] is the same as [code]if (!foo()) bar(); if (foo()) bar();[/code] Looks kinda ugly though.[/QUOTE] That code is the same as just calling bar() without any conditions.
[QUOTE=i300;28002812]That code is the same as just calling bar() without any conditions.[/QUOTE] C defines that || and && are short-circuiting.
[QUOTE=i300;28002812]That code is the same as just calling bar() without any conditions.[/QUOTE] Who said foo() was deterministic? Besides, they're supposed to be two separate examples, not a legitimate example where you call one after the other. If it was a code example where you call both operations, then you are correct in saying you could simplify it down to just foo() without any conditions.
I've been working on this thing for over 24 hours and still nothing to show.
[QUOTE=ZenX2;27998461]I tried this and everything I could think of. Could you post an already compiled version? :saddowns:[/QUOTE] put this: [url]http://filesmelt.com/dl/MCServerApp.csproj[/url] Here: MCServer_Working/MCServerApp
-snip for late-
Hey, [QUOTE=sim642;28002599]I learned a nice C++ (should work in C etc.) trick today. [code]foo() || bar(); foo() && bar();[/code] is the same as [code]if (!foo()) bar(); if (foo()) bar();[/code] Looks kinda ugly though.[/QUOTE] It's certainly cool and all, but make sure you don't use it. The intention is extremely obscure and if anyone else (or your future self) ever has to maintain that piece of code, it will cause great confusion.
[QUOTE=limitofinf;28006283]Hey, It's certainly cool and all, but make sure you don't use it. The intention is extremely obscure and if anyone else (or your future self) ever has to maintain that piece of code, it will cause great confusion.[/QUOTE] I would say that the behavior of the short circuiting operators is fairly common knowledge, and that most people will know what these do. That said, I can't particularly see a reason to do it, as they're not so much shorter that the readability deficit is worth it.
Hey, [QUOTE=TheBoff;28006481]I would say that the behavior of the short circuiting operators is fairly common knowledge, and that most people will know what these do. That said, I can't particularly see a reason to do it, as they're not so much shorter that the readability deficit is worth it.[/QUOTE] [QUOTE=limitofinf;28006283] The [b][i]intention[/i][/b] is extremely obscure and if anyone else (or your future self) ever has to maintain that piece of code, it will cause great confusion.[/QUOTE] This is not a question of whether or not short-circuiting is common knowledge. The problem is that when a good programmer sees A || B, they see an out-of-place conditional statement. They don't think "well, this is C++, so, clearly, what the original programmer meant is if (!A) B;" When a good programmer sees if (!A) B; they think "well, if A is false, then do B."
[QUOTE=limitofinf;28006598]Hey, This is not a question of whether or not short-circuiting is common knowledge. The problem is that when a good programmer sees A || B, they see an out-of-place conditional statement. They don't think "well, this is C++, so, clearly, what the original programmer meant is if (!A) B;" When a good programmer sees if (!A) B; they think "well, if A is false, then do B."[/QUOTE] [B]Which is exactly what he said[/B]
Hey, [QUOTE=esalaka;28006684][B]Which is exactly what he said[/B][/QUOTE] My apologies. I was going off the fact that he "disagreed" with my post.
[QUOTE=limitofinf;28006730]Hey, My apologies. I was going off the fact that he "disagreed" with my post.[/QUOTE] Which is why you shouldnt look at ratings and stop rating your self "gay"
[QUOTE=Richy19;28006761]Which is why you shouldnt look at ratings and stop rating your self "gay"[/QUOTE] Technically it's not a gay rating, it's just that most of facepunch thinks so because of the many colors.
[QUOTE=Dj-J3;28006772]Technically it's not a gay rating, it's just that most of facepunch thinks so because of the many colors.[/QUOTE] [B]It is the gay rating.[/B] [editline]12th February 2011[/editline] Also I rated you optimistic just for that
Sorry, you need to Log In to post a reply to this thread.