Kinitari said:So year one of school is done. I now have a bit of experience with languages (C++, C#, SQL), web dev (HTML, CSS, no Javscript until next semester) and Unix. I feel absolutely as though this was a right decision for me. But I still don't feel like I can do anything, we've only dabbled in anything GUI related, and the websites I can make are mediocre at best - what should I do this summer to keep myself sharp? I feel as though if I don't practice I'll lose my way.
Also,
Code:if(i > x) { x++ {
Is the only way I can read code now, anything else gives me heartburn.
Kinitari said:So year one of school is done. I now have a bit of experience with languages (C++, C#, SQL), web dev (HTML, CSS, no Javscript until next semester) and Unix. I feel absolutely as though this was a right decision for me. But I still don't feel like I can do anything, we've only dabbled in anything GUI related, and the websites I can make are mediocre at best - what should I do this summer to keep myself sharp? I feel as though if I don't practice I'll lose my way.
Also,
Code:if(i > x) { x++ {
Is the only way I can read code now, anything else gives me heartburn.
survivor said:I'm learning Python this summer and will try to make a simple 2d game with it. So yeah go make a game this summer.
I was initially thinking of using Pygame but Pyglet seems interesting. Is there any major differences between the two?BomberMouse said:I can recommend some libs I'm using:
- Pyglet for windowing
- If you don'nt want to use Pyglet for sprites also, use Rabbyt
- Chipmunk for 2D physics
- Planar for 2D geometry
- py2exe (or GUI2exe) to make standalone executables
Slavik81 said:Tabs are displayed inconsistently across different editors. I prefer spaces for that reason. That said, consistency is most important.
Personally, I start with the Google C++ Style Guide and deviate if I think something's dumb.
Zoe said:Everybody at my company uses the same IDE, and since it's all MS they automatically insert tabs anyway.
survivor said:I was initially thinking of using Pygame but Pyglet seems interesting. Is there any major differences between the two?
My only main concern about making a game outside of abandoning the idea halfway in is finding a good level editor. That's why I even considered using Game Maker but then I realized I rather pick something that teaches me a new language than just use GM.
Andrex said:First one is required if you do JavaScript, so I choose that to keep things consistent.
Andrex said:Considering you have two open braces there...
Well anyways I was going to suggest making an HTML5 game, but since you hate same line open braces you won't like JavaScript at all.
Stumpokapow said:JavaScript doesn't require any particular brace syntax.
The_Technomancer said:Mayhem...
So I have to just designate a third type "s" and then rewrite all of the methods, marginally modified, inside the Bay class, leading to a bloated mess of code. And this is definitely how we were supposed to handle it, the instructions were clear.
More Mayhem...
Wow, the Bay and Fish classes were given to you by your teacher? Not sure what to say, other than you probably shouldn't absorb any of the advice he/she gives to you.The_Technomancer said:So I've enjoyed my C++ class this semester, even though I was mostly self taught. But this final project sucks. I can't fathom why you would handle it this way, maybe GAF can enlighten me. This is definitely a "rant" though.
So we have to do a crude simulation of fish in a bay. We have a Fish class, but the only methods it has are setType, getType, setDirection, and getDirection. Why type you say?
Because our class Bay contains an array of Fish representing the grid, and each fish can either be type "f" or type ".", in which case its empty. The grid is literally composed of Fish in either on or off state.
This is incredibly annoying. All the methods for the Fish behavior are actually defined in the Bay class. Everything is updated by running the various behavior methods which scan through the array one by one and update all the values.
It wasn't a huge problem until we had to also define a shark. I can't actually make an inherited shark class or anything, because all the important methods are in the Bay class.
So I have to just designate a third type "s" and then rewrite all of the methods, marginally modified, inside the Bay class, leading to a bloated mess of code. And this is definitely how we were supposed to handle it, the instructions were clear.
This has led to all sorts of headaches. As best as the TAs can figure, there is no way to stop some fish devouring each other accidentally in specific patterns.
Oh, and part of the instructions have us use a list, even though we have a clearly defined size. There's absolutely no reason not to use an array, since nothing in the procedure teaches us about FIFO or FILO at all.
What methods are on the Bay class? Why can't you derive the shark from the fish and then just define whatever behavior you need in the new class? In each grid element check the fish settings and do whatever you need to do.The_Technomancer said:fish stuff
BomberMouse said:Wow, either:
- You misread the instructions
- It's an example of what NOT to do
- It's a very bad C++ class
Deriving shark from fish would allow me to use/change the get/setDir and get/setType methods, no more. All of the actual behavior is handled by Bay. Bay's only data is a two dimensional array of Fish, which displays as a two dimensional array of char (either ".", "f" or "s")ha1f said:What methods are on the Bay class? Why can't you derive the shark from the fish and then just define whatever behavior you need in the new class? In each grid element check the fish settings and do whatever you need to do.
The_Technomancer said:Deriving shark from fish would allow me to use/change the get/setDir and get/setType methods, no more. All of the actual behavior is handled by Bay.
The Bay class has four relevant functions. The population function takes in an int, and "flips" that many fish on in random locations, without overlapping. The display function is just overloading <<, a double nested for loop to output the grid.
It gets messy with the other two.
The "cluster" function scans through the Bay one element at a time, and each time it finds a fish it scans the neighborhood for other fish, then sets the direction pointing towards the mean of surrounding fish.
The "move" function scans through one element at a time and moves each fish one unit in the direction specified by their "direction" member.
Now to implement the shark I basically copy paste all of the above two functions, have the scan look for 's' instead of 'f', and then made some minor behavioral changes. (like allowing them to overlap with a f occupied square, thus overwriting it and "consuming it")
It really seems like a poor assignment. I mean, even to me it screams "procedural design" Even the TAs were commenting on it.
They weren't given to us, but we were told pretty much step by step how to build them. Exactly what methods and data to use, and exactly what behavior those methods should produce. Only the actual method implementation was up to us.
Yeah, it really boggles me. I thought of a much more OO way to handle it all, redesigning pretty much the entire system from scratch, and I would do it too if we weren't graded on using zis precise set of instructions und nicht else.BomberMouse said:The thing is, if you are doing a C++ class it should teach you OOP which is clearly the opposite of what you are doing. Even if you weren't, there are many irrational implementation choices like using a "turned off" fish to specify empty spaces.
The_Technomancer said:Yeah, it really boggles me. I thought of a much more OO way to handle it all, redesigning pretty much the entire system from scratch, and I would do it too if we weren't graded on using zis precise set of instructions und nicht else.
Oh yeah, ran it by my TA tonight, he liked my method. Just can't afford to re-write everything from scratch with an exam this week, and finals looming. I seriously might do one week this summer, just as a hobby.BomberMouse said:I'd say, at least give your idea a try and talk to your teacher or TA. It's hard for me to believe someone would give such instructions unless he is trying to make a point or is testing you. If not, monolothic wall of code is the way to go, fun!
survivor said:Alright school is over, time to learn Python.
Is there any preferred IDE for Python? The tutorial I'm reading is using Python Shell but I feel like I can do better than that.
Notepad++ was my weapon of choice for Python (and still is for many other purposes!)survivor said:Alright school is over, time to learn Python.
Is there any preferred IDE for Python? The tutorial I'm reading is using Python Shell but I feel like I can do better than that.
Doesn't that cost around $200? I guess if I am working for a company I can make them pay it, but in School its not like I have that money sitting around.Slavik81 said:You can install plugins. VisualAssistX is a must for C++.
i work in a python shop and pretty much everyone uses vim, emacs, or textmate. hippy complete in vim and emacs tends to work fine for some people, and others just use ctag. it's far from a necessity, though.survivor said:Alright school is over, time to learn Python.
Is there any preferred IDE for Python? The tutorial I'm reading is using Python Shell but I feel like I can do better than that.
eravulgaris said:So guys, I have to make a simple webpage in HTML. But my menu should be in javascript.
I found a menu online. It all looks very slick. But the only thing I can't get to work is that when I click on an item, it should open in the "home" frame. I don't know where to put the target.
This is a menu item called: "Sales". It should open in the "Home" frame.
<li><a href="Sales.html" onClick="return expandcontent('sc3', this)" theme="#EAEAFF"><font size="2" face="Verdana">Sales</font></a></li>
For example, in HTML it's <a href="sales.html" target="home">
How does this work in Javascript?
Thanks in advance.
Mister Zimbu said:Javascript just runs on top of HTML, so if your links are already defined in HTML then they should work the same- so just adding a target=home attribute to the <a> tag *should* work.
Whether it does or not is another question though, as the Javascript could be modifying the behavior of the link in the expandcontent method. There really isn't going to be a catch-all method for setting this target- it's going to depend on specifically what menu scripts you downloaded, and in some cases it may not even be possible.
So if putting target=home in the <a> tag doesn't work, you'll have to check the Menu script's documentation to see if there's a way around it, or modify the script yourself (which could be extremely difficult if it's minified).
Also: <font> tag. It burns IT BURNS
The student version is $50. I got the hobby one for $100.Drkirby said:Doesn't that cost around $200? I guess if I am working for a company I can make them pay it, but in School its not like I have that money sitting around.
List<Ball> balls; //defined for the whole class
List<Layer> layers; //defined for the whole class
private void CheckForCollision(int index){}
I'm a C/C++ guy, but I know how to use Google.Ecrofirt said:Quick C# question that I'm pretty sure I know the answer to.
I'm trying to make some of the functions in my game a little bit more generic so they can be used across multiple game modes. As it stands now, I've only been working on the 'standard' mode, but the other modes in the game will all act similarly.
I've got a function now that does collision checking, and it's got a signature that looks like this:
Code:List<Ball> balls; //defined for the whole class List<Layer> layers; //defined for the whole class private void CheckForCollision(int index){}
And that function basically checks if ball[index] possibly collides with any of the layers. Everything works just dandy now.
However, in two-player mode, there's going to be two lists of balls, and two lists of layers. The way this function works, the code will be fine, so long as it knows which list of balls and which list of layers to check with.
What I'm wondering is this (and I likely already know the answer, due to how C# works):
If I pass the list of balls, as well as the list of layers into the function, I'm only passing a reference in, right? I don't have to worry about it copying everything and doing it by value, even though the List class uses an underlying array, right?
I know I'm just over-thinking this. List is a class, and it should then automatically be a reference type, so there's nothing I've got to worry about, right?
In C#, parameters can be passed either by value or by reference. Passing parameters by reference allows function members (methods, properties, indexers, operators, and constructors) to change the value of the parameters and have that change persist. To pass a parameter by reference, use the ref or out keyword.
poweld said:I'm a C/C++ guy, but I know how to use Google.
"c# pass by reference"
First result:
http://msdn.microsoft.com/en-us/library/0f66670z(v=vs.71).aspx
Maybe? Here's the thing: if I was just using the counter itself, it tracked just fine, going from its initial position of 50 to the end of the array at 300. But when I implemented literally a single line for loop inside that copied the contents of the current "window" to a second array of the correct size, the counter would goHalycon said:If it's arrays could it have been an out of bounds error?
I'll make a more concerted effort not to.Ecrofirt said:Don't treat people like a dickass.
The_Technomancer said:Maybe? Here's the thing: if I was just using the counter itself, it tracked just fine, going from its initial position of 50 to the end of the array at 300. But when I implemented literally a single line for loop inside that copied the contents of the current "window" to a second array of the correct size, the counter would go
50
51
52
-1160876
-1160875
-1160874
...
C++Ecrofirt said:Peculiar! Which language is this in?
for(int i = min, i<=max, i++){
hann_window[i] = strip[i]
}
The_Technomancer said:Maybe? Here's the thing: if I was just using the counter itself, it tracked just fine, going from its initial position of 50 to the end of the array at 300. But when I implemented literally a single line for loop inside that copied the contents of the current "window" to a second array of the correct size, the counter would go
50
51
52
-1160876
-1160875
-1160874
...
Somehow a for loop that read
completely broke my programCode:for(int i = min, i<=max, i++){ hann_window[i] = strip[i] }
Yeah, that's one of the major pitfalls of arrays. Good catch.The_Technomancer said:EDIT:Shit....just found the error by retyping it here on GAF. Yup, array over bounds error.