Search found 173 matches
- Mon Aug 26, 2013 3:02 am
- Forum: Programming Discussion
- Topic: What Does This Code Do?
- Replies: 3
- Views: 3370
What Does This Code Do?
I came across this code that compiles and runs (XCode, iOS) but it definitely isn't initializing the contents of the array. I'm pretty certain it's got to be doing something nasty. Can anyone explain this? std::string* myStrings = new std::string[4] { "Apples", "Oranges", "B...
- Fri Jun 14, 2013 10:50 pm
- Forum: Programming Discussion
- Topic: To use GL or not to use GL ( and which GL to use )
- Replies: 4
- Views: 3442
Re: To use GL or not to use GL ( and which GL to use )
You pretty much have 2 options. Option 1: Choose an older version of OpenGL and make sure you don't use any functionality that is newer than that version. This is a good choice for most indies because most of us aren't trying to do anything cutting edge, graphics wise. GL 2.1 is a pretty popular ver...
- Sun Jun 09, 2013 3:17 pm
- Forum: Programming Discussion
- Topic: Per-pixel Destructible Terrain
- Replies: 5
- Views: 4998
Per-pixel Destructible Terrain
I've been working on a project for a little over a month now, it's got a per-pixel destructible environment similar to Worms. I've reached a point where I could use some help trying to solve an issue I'm faced with though. My method of "destroying" the environment is to simply take circle-...
- Fri Jun 07, 2013 8:52 pm
- Forum: Programming Discussion
- Topic: Calling All Mathematicians
- Replies: 5
- Views: 3306
Re: Calling All Mathematicians
If I'm understanding this correctly, the solution is to always spend $0 on pest control because as the number of pests increases, so does the number of tourists. This doesn't make sense
- Tue Oct 18, 2011 7:23 pm
- Forum: Programming Discussion
- Topic: Regular Expressions
- Replies: 15
- Views: 2895
Re: Regular Expressions
Yep, thanks short. You're example was great, showed me how to use a DFA to get my regex :D
Ginto, that's the same answer that I got
Ginto, that's the same answer that I got
- Tue Oct 18, 2011 11:46 am
- Forum: Programming Discussion
- Topic: Regular Expressions
- Replies: 15
- Views: 2895
Re: Regular Expressions
Gah, I meant to write exactly two 0's. Thanks for all the replies, I skimmed them and short seems to know exactly what I'm talking about. Gonna read your reply in more detail and reply back. The class I'm in is also called Theory of Computation. Edit: Thank you very much short! The key is to constru...
- Tue Oct 18, 2011 12:45 am
- Forum: Programming Discussion
- Topic: Regular Expressions
- Replies: 15
- Views: 2895
Regular Expressions
Not technically a programming question since this is a theoretical CS question, but sort of relevant. I need to give a regular expression for a language that contains an odd number of 1's or exactly two 0's. The alphabet is {0, 1}. Here's my attempt, idk if this is correct or not. (1* 0 1* 0 1*) OR ...
- Wed Oct 05, 2011 11:55 pm
- Forum: Game Development
- Topic: Pong (Edited)
- Replies: 3
- Views: 1561
Re: Pong (Edited)
You forgot to include all the .dlls for SDL, SDL_image and SDL_ttf. I played it for a couple minutes because no offence but, pong is pong. Good work for your first game
- Thu Jun 16, 2011 9:57 pm
- Forum: Programming Discussion
- Topic: Help on the most ridiculous map editor bug ever?
- Replies: 8
- Views: 1079
Re: Help on the most ridiculous map editor bug ever?
Yep sorry, should have been camera.y. There is no problem starting the for loop at 0 when rendering, it's just inefficient and easily made more efficient. I changed it because I had to change the rendering loop anyway in the code I posted. In my sample TILE_SIZE is the width/height of a single tile....
- Thu Jun 16, 2011 6:16 pm
- Forum: Programming Discussion
- Topic: Help on the most ridiculous map editor bug ever?
- Replies: 8
- Views: 1079
Re: Help on the most ridiculous map editor bug ever?
When you are indexing into map[][], it looks like you're using the tiles screen position instead of world position. Also, you don't need to be storing positions in your tiles if your tiles are in a grid. You should be doing something like this when you lay a tile (assuming origin is in the top left ...
- Thu Jun 16, 2011 5:36 pm
- Forum: Programming Discussion
- Topic: Help on the most ridiculous map editor bug ever?
- Replies: 8
- Views: 1079
Re: Help on the most ridiculous map editor bug ever?
Can we see the code where you actually lay new tiles?
- Tue Jun 14, 2011 3:38 pm
- Forum: Programming Discussion
- Topic: Compiling without an IDE
- Replies: 6
- Views: 962
Re: Compiling without an IDE
IDEs and compilers are not the same thing. IDEs are just fancy text editors that include a compiler and a bunch of other useful features to make things easier. A compiler is a program that actually transforms source code into it's compiled form (usually used as a command line tool). So even if you d...
- Thu Apr 28, 2011 1:25 am
- Forum: Programming Discussion
- Topic: Is it even necessary?
- Replies: 11
- Views: 1172
Re: Is it even necessary?
From my understanding, it does have an impact on compile time... The inclusion of a header takes place before the code is actually compiled and (from what I understand) more or less "copies and pastes" the header into whatever file. Mainly this. Also, it's easier to glance at a header fil...
- Wed Apr 27, 2011 2:39 am
- Forum: Programming Discussion
- Topic: [SOLVED] SFML window not showing
- Replies: 5
- Views: 1163
Re: Weird SFML issue. REALLY need help.
Well, I'm running win7 64-bit so that's not an issue. You said:
Does the program exit successfully if you immediately return from your main function before doing anything?like80ninjas wrote:Even if I add cout before the SFML stuff it just opens a blank console window and hangs there.
- Wed Apr 27, 2011 1:52 am
- Forum: Programming Discussion
- Topic: [SOLVED] SFML window not showing
- Replies: 5
- Views: 1163
Re: Weird SFML issue. REALLY need help.
That code runs perfectly fine for me :S