• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

Looks interesting, are you learning Direct3D/OpenGL by any chance?

Edit:

Wanted to share an interesting exercise I saw at data structure and algorithms class: create a class Queue<T> (in Java) that only uses (the minimum possible amount of) stacks in it's implementation (that is, you can't have any other variables). Implement the methods: add(T element), remove(), isEmpty(). Once you figure it out it's very easy.

Nope its all running on the cpu.
Direct3D and OpenGL do this automatic.
 

Magni

Member
It spoiled me. I can't go back to anything else now. Even Python looks ugly to me (but I can handle it).

Python used to be my favorite language before I started Ruby. It's nice too, but I can't see a single scenario where I would choose it over Ruby (for personal projects that is, if I were to work for a Django shop that's another story).

Python would be much nicer if it were more syntactic, or if objects just had built in methods to make it a bit more like other OO languages. (ie len(something) vs something.length)


Ruby's awesome, and Rails is quite useful. I don't think there's an easier way to build a unique, custom web application without it. I guess you should try to check out C#'s MVC and Entity stuff though.



Recently I've been getting into Scala, which is like writing Ruby on a different level.

Ruby's really easy to understand and use, but I feel like I need to learn more about Scala to apply it properly. But there are a few areas where I can see some of Ruby's inefficiencies and where Scala's ability to use types and compile can come in handy. Not to mention that it can pair up with Java without any pain. (I'm not sure about its status with C#.)

. . . which reminds me, anyone here use SBT?

I'm doing the Scala course by Martin Odersky on Coursera right now and loving it, but that's the only thing I'm using sbt for right now. Scala's mix of Java and Standard ML/OCaml/F# makes it my favorite statically typed language, I wish it had more adoption so I'd have a chance to work on it professionally.
 

Feep

Banned
All right, my Unity bros. (I'll be cross-posting this in the Indie Game Dev thread, as well.)

Here's a sample project that opens a .NET Console Application, opens a pipe, and sends a simple string through to the other end. It works! Sort of.

There seems to be some weird, jerky behavior going on. Attempting to drag the window is stuttery, and it seems to freeze for a second or two reasonably frequently before fixing itself. I don't know what's causing the problem...nearly identical code running outside of Unity, in another standard .NET Console Application, works perfectly fine.

Offering small cash reward to anyone who can solve the problem and get everything buttery smooth. = D
 
There seems to be some weird, jerky behavior going on. Attempting to drag the window is stuttery, and it seems to freeze for a second or two reasonably frequently before fixing itself. I don't know what's causing the problem...nearly identical code running outside of Unity, in another standard .NET Console Application, works perfectly fine.

I don't have a dev environment here so sorry I can't help properly. But from a quick glance I'd be moving the displayText = ss.ReadString(); operation out of the update method which is linked to your unity rendering process? (based on the comment there)

Have it on its own dedicated server thread updating a variable the update method can then use (whilst confirming unity is only spawning one instance of it) and see if that helps.
 

Feep

Banned
I don't have a dev environment here so sorry I can't help properly. But from a quick glance I'd be moving the displayText = ss.ReadString(); operation out of the update method which is linked to your unity rendering process? (based on the comment there)

Have it on its own dedicated server thread updating a variable the update method can then use (whilst confirming unity is only spawning one instance of it) and see if that helps.
I have NO IDEA how to spawn and safely utilize a separate thread. But, probably a good idea. I mean, that line is what's causing the problem...commenting it out, while breaking the desired functionality, removes the stuttery-ness.

Edit: Wait, holy shit, I did it. Hooooly shit. Threads are awesome.
 
Who wants to talk about ruby on rails? Its the only thing I want to work in but at work I have to do .net and C# and my network class is in C :(. I love ruby.

C# is fine, especially compared to Java. I had to write a Java EE MVC application a few days ago for school (JavaBeans, Servlet, JSP) and it's really annoying how much boilerplate code you need to write, just the stupid getter and setter methods for a Java bean take up like 100 lines. Properties are so useful.
 
Hmm, about to start a front end re-write/overhaul of a web application.
It's a Spring MVC application that I'm condensing a 10 page process into 5/6 pages.

Anyone got any reading recommendations for development strategy in doing this?
I don't want to mess this up.
There's going to be a significant amount of tests broken and code change involved as we do it.
 
I have NO IDEA how to spawn and safely utilize a separate thread. But, probably a good idea. I mean, that line is what's causing the problem...commenting it out, while breaking the desired functionality, removes the stuttery-ness.

Ah ok, no worries.

I'm not a .net guy at all so hopefully somebody will help out with code. But before then might as well try something like https://docs.google.com/file/d/0BwIG71i9puOOdGs4b1FnemR2Rms/edit?usp=sharing (completely untested/may not compile)

C# is fine, especially compared to Java. I had to write a Java EE MVC application a few days ago for school (JavaBeans, Servlet, JSP) and it's really annoying how much boilerplate code you need to write, just the stupid getter and setter methods for a Java bean take up like 100 lines. Properties are so useful.

What you'll probably find is all the boiler plate code will be auto generated by the tools and or framework you end up using. When something does end up breaking (which of course it will) having all that code there can be a big help to track things down. The issue I always have with more concise languages is scratching my head how to change things when there isn't much there to fiddle with. But then I'm just old school these days ;)
 
C# is fine, especially compared to Java. I had to write a Java EE MVC application a few days ago for school (JavaBeans, Servlet, JSP) and it's really annoying how much boilerplate code you need to write, just the stupid getter and setter methods for a Java bean take up like 100 lines. Properties are so useful.

Uugh i hate those function if im really lazy i just make those fields/members public for school assignments.
 

Feep

Banned
Ah ok, no worries.

I'm not a .net guy at all so hopefully somebody will help out with code. But before then might as well try something like https://docs.google.com/file/d/0BwIG71i9puOOdGs4b1FnemR2Rms/edit?usp=sharing (completely untested/may not compile)
I had to change like one thing. This was a better written version of the crappy test code I cobbled from MSDN documentation.

Still some odd problems (I need to close the Console Application first, or attempting to close the Unity application results in hanging), but once I fix that, I can probably change the Console Application to a Windows Application, never instantiate the window, and have the process running happily and silently along in the background.
 
What you'll probably find is all the boiler plate code will be auto generated by the tools and or framework you end up using. When something does end up breaking (which of course it will) having all that code there can be a big help to track things down. The issue I always have with more concise languages is scratching my head how to change things when there isn't much there to fiddle with. But then I'm just old school these days ;)
Well, actually the getter/setter methods were generated by Netbeans, but all those 2-line methods make the class look super cluttered and makes it a pain to find the really important stuff.

I think the properties syntax of C# is pretty genius. Instead of writing
Code:
private String name;
public void setName(String n) { this.name=n; }
public String getName() { return name; }
you just write
Code:
public string Name { get; set; }
You can also do { public get; private set; } if you want a publicly accessible variable that is read-only from outside the class. The best thing is that it also encapsulates data because the compiler will generate get/set methods for every property.
 
I had to change like one thing. This was a better written version of the crappy test code I cobbled from MSDN documentation.

Still some odd problems (I need to close the Console Application first, or attempting to close the Unity application results in hanging), but once I fix that, I can probably change the Console Application to a Windows Application, never instantiate the window, and have the process running happily and silently along in the background.

Yeah you can probably sort that out through options to your pipe to allow it to timeout and fail gracefully when it all goes wrong (Currently you have none so could tidy that up and then close, restart itself, display errors etc as required by your app).

Well, actually the getter/setter methods were generated by Netbeans, but all those 2-line methods make the class look super cluttered and makes it a pain to find the really important stuff.

True enough. I guess I just like to always be able to follow code through from start to finish. When your not getting the right results, you'll want to be able to track it down to the method and start furiously debugging or adding test cases. Simple/auto pilot things, even if they take more time or take up more space always make me feel comforted with what I'm trying to achieve in the big picture.
 

Feep

Banned
Yeah you can probably sort that out through options to your pipe to allow it to timeout and fail gracefully when it all goes wrong (Currently you have none so could tidy that up and then close, restart itself, display errors etc as required by your app).
Got it. Used Unity's "OnApplicationQuit" method, cleaned up the spawned thread and process. It's all good. Awesome. I can use Unity. = D

PM me your E-mail address for a bit o' spending cash.
 
Got it. Used Unity's "OnApplicationQuit" method, cleaned up the spawned thread and process. It's all good. Awesome. I can use Unity. = D

PM me your E-mail address for a bit o' spending cash.

Cool, glad it worked. Don't worry about any cash, I was just clutching at straws. Just make an awesome game for us.
 
Well, actually the getter/setter methods were generated by Netbeans, but all those 2-line methods make the class look super cluttered and makes it a pain to find the really important stuff.

I think the properties syntax of C# is pretty genius. Instead of writing
Code:
private String name;
public void setName(String n) { this.name=n; }
public String getName() { return name; }
you just write
Code:
public string Name { get; set; }
You can also do { public get; private set; } if you want a publicly accessible variable that is read-only from outside the class. The best thing is that it also encapsulates data because the compiler will generate get/set methods for every property.


This really only works in trivial cases. When dealing with composite classes,getters and setters will have still have 2 or 3 line functions
 
I wish AS3 had those set; get; style of setters and getters. It takes aaaaages to write VO:s and such, even if you just copypasta from a "template"
 
Anybody has a idea to what those getters and setter compile to maybe that java and c# do something special with them? Has been a while where i was forced to use them for every member but they seem kinda of overkill for class members you need to access a lot and a shitload of typing each time.

And it was never really explained to me why people do it. Just that they do it.But that was 2 years ago. Is it for readability so others know from what class you are setting or getting data from. It seems like OOP overkill. I only really use them for members i only want data from every once in a while.

/Maybe im stupid and forgot the reason i had to work half a year in a non OOP language.
 

nan0

Member
Anybody has a idea to what those getters and setter compile to maybe that java and c# do something special with them? Has been a while where i was forced to use them for every member but they seem kinda of overkill for class members you need to access a lot and a shitload of typing each time.

And it was never really explained to me why people do it. Just that they do it.But that was 2 years ago. Is it for readability so others know from what class you are setting or getting data from. It seems like OOP overkill. I only really use them for members i only want data from every once in a while.

/Maybe im stupid and forgot the reason i had to work half a year in a non OOP language.

There are a lot of reason for accessors:
- Easier to extend. Write them once, extend them later e.g. with additional validation. The function stays the same for the calling class. If you hadn't them, you'd have to change every single call.
- Different access levels for get and set. You may allow to read the value from other classes, but not to modify it (public get, private set).
- If the class supports inheritance, inheritors can override the accessors for different functionality.
- If you need to do memory management, it's easier to control the disposal of a certain object
 
I'm working on an assignment for class and could use some help. I have to use bitwise operations to perform IEEE floating point rules. I'm using this loop to convert from bits to int, but it is not working and I can't see why:

for (i = 9; i < 31; i++){ // this loop computes the fraction
frac = f << i;
frac = frac >> (31-i);
if ( frac == 1 ){
fract += pow(2,(i-10));
} // if
} // for
for (i = 8; i >= 0; i--){ // this loop computes the exponent
exp = f << i;
exp = exp >> (31-i);
if ( frac == 1 ){
ex += (pow(2,(i)));
} // if
} // for
fract += 1;
ex = ex - 127;
x = fract * pow(2,ex);
 

Chris R

Member
I'd really suggest you at least check out python. I've stuck with PHP for years, but I'm now switching all of my web dev stuff to python & django stuff. Django + TastyPie makes simple REST apis a piece of cake.

I'll have to look at python eventually.

And I was finally able to get the .net stuff working for me (turns out I was doing nothing wrong other than not including a single parameter that was causing everything to fail :( )
 

GSR

Member
Is anyone here familiar with Box2D? I'm trying to use it in a project this semester, and I'm getting a really weird result - when I create an application that just creates the Box2D structures, everything is simulated fine. However, when I attempt to integrate it with OpenGL, the physics simulation goes off the rails.

At the moment, I'm attempting to simulate about 40-50 spheres inside a box, only moving due to gravity and hitting each other.

Some pseudocode:
Code:
Initialize OpenGL world
Create "World" class, which contains a Box2d world as well
In "World" class:
   Initialize Box2D world
   Create a number of Sphere objects and initialize associated OpenGL stuff
   On each sphere, call initPhysics(), which creates a circle in Box2D
   Create a "Stadium", which draws a floor below the spheres, and four walls
   Generate a Box2D ChainShape with four corners matching the walls
Start main OpenGL loop
On each display call:
   Call Box2D's world->Step() function
   Update the OpenGL position for each sphere to be the position of the circle in Box2D
   Draw the spheres/Stadium

...But instead of the expected results, the spheres just go crazy after falling for a while. Debugging shows that it's not me misdrawing them; the actual Box2D circle objects are moving strangely.

This following code gives me no errors (eg. it simulates the circles as desired), and is pretty much lifted from the OpenGL project.

http://pastebin.com/hJqBM5ec
 
Ever since university, I've been doing most of my projects and assignments in Windows (don't kill me), but I kinda wanna change that just to get more comfortable with Unix systems.

What are some IDEs for C/C++ development that you guys would recommend (for Linux)?
 

jon bones

hot hot hanuman-on-man action
I have a programming question from something I saw in a different thread about a PSP emulator:

What is this written in, hopefully not Java?

Gonna try it out, hope it's better than JPCSP, Java's terrible for emulators.


Thank you kindly. That puts it in the caliber of PCSX2 and Dolphin. Awesome.

And then people got real excited by this news. Why do Java emulators run worse than ones written in C++? I hypothesized that it was because of C++'s ability to manually manage memory, but I don't understand enough about emulation software to think of a reason why this might be.

What do you say, code-GAF?
 
Learning Prolog for a class and I am stuck on a few questions. The biggest problem right now is that for question 2 our code returns all the answers in terminal when you use ; but we need all the answers in a list.

2. post_reqs(C1, L) &#8211; given C1, return in L a list of courses that have C1 as a prerequisite

Our code:
Code:
prereqs(cse115, []).
prereqs(cse116, [cse115]).
prereqs(cse191, [cse115]).
prereqs(cse241, [cse116,cse191]).
prereqs(cse250, [cse116,cse191]).
prereqs(cse305, [cse250]).
prereqs(cse321, [cse341]).
prereqs(cse331, [cse250,mth142]).
prereqs(cse341, [cse241]).
prereqs(cse379, [cse241]).
prereqs(cse380, [cse241]).
prereqs(cse396, [cse250]).
prereqs(cse411, [cse241]).
prereqs(cse421, [cse305]).
prereqs(cse422, [cse421]).
prereqs(cse431, [cse331]).
prereqs(cse435, [cse250,mth309]).
prereqs(cse442, [cse305]).
prereqs(cse443, [cse305]).
prereqs(cse452, [cse493]).
prereqs(cse453, [cse442,cse380]).
prereqs(cse455, [mth309,cse250]).
prereqs(cse462, [cse305]).
prereqs(cse463, [cse305]).
prereqs(cse467, [cse305]).
prereqs(cse474, [mth309,cse250]).
prereqs(cse484, []).
prereqs(cse486, [cse305]).
prereqs(cse487, [cse305]).
prereqs(cse489, [cse250,cse341,mth411]).
prereqs(cse490, [cse341]).
prereqs(cse493, [cse341,ee310]).

Code:
prereqs(C1,C2):-prereqs(C1,Y),member(C2,Y).

no_prereqs(L):-setof(F,(prereqs(F,[])),L).
post_reqs(C1,L):-setof(X,(prereqs(X,Y),member(C1,Y)),L).

course(cse115, &#8216;Intro to CSE I&#8217;).
&#8230;
course(cse331, &#8216;Intro to Algorithms&#8217;).
&#8230;
prereqs(cse115, [ ]). % [ ] means no prerequisites
&#8230;
prereqs(cse331, [cse250, mth141]).
&#8230;
 
And then people got real excited by this news. Why do Java emulators run worse than ones written in C++? I hypothesized that it was because of C++'s ability to manually manage memory, but I don't understand enough about emulation software to think of a reason why this might be.

What do you say, code-GAF?

Any Java program runs in a virtual machine. Whilst this has advantages for a lot of applications in terms of porting to other platforms (which have their own virtual machine) and security and so on, it comes at a cost which is often performance.

C or C++ code, whilst much more platform specific will typically perform faster assuming the code is written to equal standards. For emulation or other game based applications, the difference can be quite noticeable.

In very broad terms, think of Java as reliability/stability and C++ as speed.
 

jon bones

hot hot hanuman-on-man action
Any Java program runs in a virtual machine. Whilst this has advantages for a lot of applications in terms of porting to other platforms (which have their own virtual machine) and security and so on, it comes at a cost which is often performance.

C or C++ code, whilst much more platform specific will typically perform faster assuming the code is written to equal standards. For emulation or other game based applications, the difference can be quite noticeable.

In very broad terms, think of Java as reliability/stability and C++ as speed.

thanks, i appreciate it
 

Slavik81

Member
Ever since university, I've been doing most of my projects and assignments in Windows (don't kill me), but I kinda wanna change that just to get more comfortable with Unix systems.

What are some IDEs for C/C++ development that you guys would recommend (for Linux)?

I've heard Qt Creator is pretty good even for non-Qt projects. It would be my pick.

Code::Blocks is also rather popular.
 

survivor

Banned
Learning Prolog for a class and I am stuck on a few questions. The biggest problem right now is that for question 2 our code returns all the answers in terminal when you use ; but we need all the answers in a list.

2. post_reqs(C1, L) &#8211; given C1, return in L a list of courses that have C1 as a prerequisite

Our code:

Code:
prereqs(C1,C2):-prereqs(C1,Y),member(C2,Y).

no_prereqs(L):-setof(F,(prereqs(F,[])),L).
post_reqs(C1,L):-setof(X,(prereqs(X,Y),member(C1,Y)),L).

course(cse115, &#8216;Intro to CSE I&#8217;).
&#8230;
course(cse331, &#8216;Intro to Algorithms&#8217;).
&#8230;
prereqs(cse115, [ ]). % [ ] means no prerequisites
&#8230;
prereqs(cse331, [cse250, mth141]).
&#8230;

Is there any requirements to use setof? I just ran a test code with findall and it's returning all the solutions in one list without the use of ;
 
Is there any requirements to use setof? I just ran a test code with findall and it's returning all the solutions in one list without the use of ;

I added the offical class list.
We were told it is possible so we were trying to do it that way. I tried findall/3 earlier but I kept getting an empty list.

Edit: Thanks for the help. It works now.
 

dpatel304

Member
Got an idea and just want to know the feasibility of it:
I want to be able to run software on any Windows/Mac and have it be able to detect a song that is being played from that machine. The should be able to be played from a variety of programs (iTunes, Spotify, Grooveshark, etc..), and my software could still extract the artist and title.

My software won't actually play any songs itself, it'll just sorta run in the background and broadcast what is being played.
 
Python is awesome, I just love ruby blocks way too much; Ruby's syntax is so much cleaner.

SO CLEAN. I love the way it handles objects. It just fucking works.

Python would be much nicer if it were more syntactic, or if objects just had built in methods to make it a bit more like other OO languages. (ie len(something) vs something.length)


Ruby's awesome, and Rails is quite useful. I don't think there's an easier way to build a unique, custom web application without it. I guess you should try to check out C#'s MVC and Entity stuff though.



Recently I've been getting into Scala, which is like writing Ruby on a different level.

Ruby's really easy to understand and use, but I feel like I need to learn more about Scala to apply it properly. But there are a few areas where I can see some of Ruby's inefficiencies and where Scala's ability to use types and compile can come in handy. Not to mention that it can pair up with Java without any pain. (I'm not sure about its status with C#.)

. . . which reminds me, anyone here use SBT?

I haven't used Scala but I'm gonna look into now. One of my classes has me making ruby scripts that heavily use bash commands. Really interesting how flexible Ruby can be.

Been messing around with PHP and Ruby since asp.net has been giving me fits when it comes to RESTful stuff (400/401 errors everywhere :<)

They are pretty cool though, I'm thinking of continuing to use them on my own to build up my skills with them. Is there anything like Code Academy for PHP? The Ruby stuff has seemed alright so far.

My friend and I plan on learning PHP this summer so this would be helpful to me as well.

C# is fine, especially compared to Java. I had to write a Java EE MVC application a few days ago for school (JavaBeans, Servlet, JSP) and it's really annoying how much boilerplate code you need to write, just the stupid getter and setter methods for a Java bean take up like 100 lines. Properties are so useful.

Oh ya C# is pretty nice (I fucking hated Java when I had to use it in school) I'm just not very proficient at it yet.

Is it really the best IDE on Linux? :( This is gonna be painful coming from Visual Studio. Also, I just did a quick google search and the general preference is for Unix tools...

But yeah, guess I'll use Eclipse for now, even though I really hate its debugger.

To be honest I do all of my work stuff in Windows and all of my school stuff in Linux(or osx). I only use an IDE in windows so I have no clue. Maybe I'll give Eclipse a look at when I have some free time.
 

jon bones

hot hot hanuman-on-man action
Code:
template <class myType>
myType GetMax (myType a, myType b) {
 return (a>b?a:b);
}

can someone explain to me what's going on in the return line? i'm not sure what the "? a:b" bit means.
 

GSR

Member
Code:
template <class myType>
myType GetMax (myType a, myType b) {
 return (a>b?a:b);
}

can someone explain to me what's going on in the return line? i'm not sure what the "? a:b" bit means.

That's a conditional operator. It's basically saying

Code:
If a > b
   use a
else 
   use b
 
Learning Prolog for a class and I am stuck on a few questions. The biggest problem right now is that for question 2 our code returns all the answers in terminal when you use ; but we need all the answers in a list.

2. post_reqs(C1, L) &#8211; given C1, return in L a list of courses that have C1 as a prerequisite

Our code:
Code:
prereqs(cse115, []).
prereqs(cse116, [cse115]).
prereqs(cse191, [cse115]).
prereqs(cse241, [cse116,cse191]).
prereqs(cse250, [cse116,cse191]).
prereqs(cse305, [cse250]).
prereqs(cse321, [cse341]).
prereqs(cse331, [cse250,mth142]).
prereqs(cse341, [cse241]).
prereqs(cse379, [cse241]).
prereqs(cse380, [cse241]).
prereqs(cse396, [cse250]).
prereqs(cse411, [cse241]).
prereqs(cse421, [cse305]).
prereqs(cse422, [cse421]).
prereqs(cse431, [cse331]).
prereqs(cse435, [cse250,mth309]).
prereqs(cse442, [cse305]).
prereqs(cse443, [cse305]).
prereqs(cse452, [cse493]).
prereqs(cse453, [cse442,cse380]).
prereqs(cse455, [mth309,cse250]).
prereqs(cse462, [cse305]).
prereqs(cse463, [cse305]).
prereqs(cse467, [cse305]).
prereqs(cse474, [mth309,cse250]).
prereqs(cse484, []).
prereqs(cse486, [cse305]).
prereqs(cse487, [cse305]).
prereqs(cse489, [cse250,cse341,mth411]).
prereqs(cse490, [cse341]).
prereqs(cse493, [cse341,ee310]).

Code:
prereqs(C1,C2):-prereqs(C1,Y),member(C2,Y).

no_prereqs(L):-setof(F,(prereqs(F,[])),L).
post_reqs(C1,L):-setof(X,(prereqs(X,Y),member(C1,Y)),L).


&#8230;

Okay I have been trying to conceptualize this question for hours and I have given up after many failed attempts.

4.) all_prereqs(C, L) &#8211; return in L a list of all prerequisite courses for C, considering both direct (or immediate) as well as indirect prerequisites.

I am aware that I will need a helper predicate to aid in the recursive nature of the predicate. I just don't know where to go from here and how to branch off each pre-requisite.

Code:
prereq1(C1,C2):- prereqs(C1,L),member(C2,L) %input C1 and return the pre-requisites for it
%prereq2(C1,C2):-


%all_prereqs(C,L):-
 

Tomat

Wanna hear a good joke? Waste your time helping me! LOL!
Just finished up my first game a little while ago. Made it using C# and XNA. I should be happy about this, but I'm depressed about all the things I didn't have time to add instead. Game is called Original Space Shooter 2: Xenophobic Space Blood Fued.

How it works:
Title Splash -> Instructions Splash -> game part. The first round is always the same, 30 enemies, spawn at random X,Y coordinate off the top of the screen with random speed values. Every round after that has anywhere from 20-60 enemies with random spawns/speed. Simple scoring system where every kill is worth 50 points. If 5 enemies get to the bottom of the screen in a round you lose the game.

Originally the group wanted to do a simple Ikaruga style shoot em up with color switching/bullet eating but I didn't feel I had enough time to make it so I went for a Space Invaders clone. Ended up changing to the spawn/movement system I described above instead of Space Invaders style movement after I realized that the enemies would jump down a row one by one instead of an entire row of enemies jumping down to the next row at the same time.

Really wish I had more time to implement enemies shooting back at the player and dropping powerups on death but I really don't think I could do that between now and the due date (later today).
 

Feep

Banned
Just finished up my first game a little while ago. Made it using C# and XNA. I should be happy about this, but I'm depressed about all the things I didn't have time to add instead. Game is called Original Space Shooter 2: Xenophobic Space Blood Fued.

How it works:
Title Splash -> Instructions Splash -> game part. The first round is always the same, 30 enemies, spawn at random X,Y coordinate off the top of the screen with random speed values. Every round after that has anywhere from 20-60 enemies with random spawns/speed. Simple scoring system where every kill is worth 50 points. If 5 enemies get to the bottom of the screen in a round you lose the game.

Originally the group wanted to do a simple Ikaruga style shoot em up with color switching/bullet eating but I didn't feel I had enough time to make it so I went for a Space Invaders clone. Ended up changing to the spawn/movement system I described above instead of Space Invaders style movement after I realized that the enemies would jump down a row one by one instead of an entire row of enemies jumping down to the next row at the same time.

Really wish I had more time to implement enemies shooting back at the player and dropping powerups on death but I really don't think I could do that between now and the due date (later today).
Feud*

I just saved your A+, son.
 
Just finished up my first game a little while ago. Made it using C# and XNA. I should be happy about this, but I'm depressed about all the things I didn't have time to add instead. Game is called Original Space Shooter 2: Xenophobic Space Blood Fued.

How it works:
Title Splash -> Instructions Splash -> game part. The first round is always the same, 30 enemies, spawn at random X,Y coordinate off the top of the screen with random speed values. Every round after that has anywhere from 20-60 enemies with random spawns/speed. Simple scoring system where every kill is worth 50 points. If 5 enemies get to the bottom of the screen in a round you lose the game.

Originally the group wanted to do a simple Ikaruga style shoot em up with color switching/bullet eating but I didn't feel I had enough time to make it so I went for a Space Invaders clone. Ended up changing to the spawn/movement system I described above instead of Space Invaders style movement after I realized that the enemies would jump down a row one by one instead of an entire row of enemies jumping down to the next row at the same time.

Really wish I had more time to implement enemies shooting back at the player and dropping powerups on death but I really don't think I could do that between now and the due date (later today).

Congrats, sounds like good experience. You can always finish it up outside of class. If the project is relevant to your career goals, you'd be able to point out to potential employers how you went above and beyond to polish it up.
 

squidyj

Member
Okay I have been trying to conceptualize this question for hours and I have given up after many failed attempts.

4.) all_prereqs(C, L) &#8211; return in L a list of all prerequisite courses for C, considering both direct (or immediate) as well as indirect prerequisites.

I am aware that I will need a helper predicate to aid in the recursive nature of the predicate. I just don't know where to go from here and how to branch off each pre-requisite.

Code:
prereq1(C1,C2):- prereqs(C1,L),member(C2,L) %input C1 and return the pre-requisites for it
%prereq2(C1,C2):-


%all_prereqs(C,L):-

wow, that's what I get for not reading. I didn't notice they were all lists
 

Septimius

Junior Member
This really only works in trivial cases. When dealing with composite classes,getters and setters will have still have 2 or 3 line functions

In which case, I hope everyone an equivalent of:
Code:
class SomeClass {
    public object Something { get; set; }
    private object _something;

    SomeClass() {
        _something = SomeHow();
    }
}

and never

Code:
public object Something
{
    get
    {
        return SomeHow()
    }
}

as a property is not a method, and thus getting a property should really just be getting something, not calculating something.
 

GSR

Member
Box2D stuff

Just an update - it had nothing to do with OpenGL. I made the mistake of trying to update the position of the b2CircleShape in addition to the b2BodyDef, whereas the correct code is to leave the position of b2CircleShape at (0, 0).
 

Relix

he's Virgin Tight™
How much C# (or VB.net I guess) do you know? Have you used any MVC frameworks in the past? (like previous .NET MVC versions, or maybe Rails, Django, etc?)

VB.NET just getting the ropes of C#. None-Zero MVC experience.
 
Top Bottom