I'm having a problem involving Processing.
For a school project, I'm making a Tetris clone. I'm using G4P for gui elements, and the inbuilt Minim for sound.
I want to have the menus as separate files, as well as the game as a separate file. However, I cannot find out a way to have a processing file call another processing file. I've checked all over the internet and I can't find one.
I don't think declaring each menu as a class would work, as it needs to create a new background for each menu.
What can I do?
Should i use the Java 64bit sdk or the 32bit? Does it even matter?
If your app will [url=http://stackoverflow.com/a/16369136/2557070]use a lot of memory[/url] (above 2GB), use 64-bit. Otherwise, there's no big difference.
There is really zero reason to use 32-bit now.
A few years ago an argument could be made for compatibility reasons, but now 64-bit is some 95% of the market.
Same reason you should use at least OpenGL 3 or DirectX 10, by the way. Steam hardware survey shows ~98% support. OGL 4/DX 11 is a little more iffy, with only about 75%.
You just kinda need to decide these things based on your target audience.
If you're making an game with fancy graphics, there is no reason to not use DirectX 11, as people who have a 5+ year old GPU, won't be able to play it even if they had Dx11 support.
If you're making a 2d platformer, there will be plenty of people who try to run it on their netbook or phone, or some chineese people on 10 year old hardware.
The thing with 64bit is just that you lose 5% of your audience, and you get nothing in return if you don't use more then 2-3gb of ram.
We're talking about the version of the JDK the developer runs. I'd imagine the 64-bit version of the JDK can compile 32-bit applications, but if the developer wishes to write applications that would require the 64-bit support in the future then he should run the 64-bit version of the JDK. Really, there's no reason to be running the 64-bit version (unless you need the extra heap size support) when we're talking about the JDK according to the SO post above and the other sources I've read (which are linked in the question) as they are very similar.
I have a really small starter question. I'm learning C from some online tutorials, but I can't find out how to run the program. I've written out a basic "hello world" program in Notepad++ but I don't know how to actually run it.
C is a compiled language. You'd need to run the program through a compiler to get an executable (.exe) file. I remember using GCC (GNU Compiler Collection) on Windows a while ago, which is provided with [url=http://mingw.org/]MinGW[/url]. Here's how you'd compile a .c file, once you get it installed (IIRC):
[CODE]gcc whatever.c -o whatever.exe[/CODE]
Then you'd run it by typing
[code]whatever.exe[/code]
So the Intro to Programming class requires us to use Microsoft Visual Studio. I can get the 2013 Professional edition off of Dreamspark but it's only the 32 bit apparently? Is this ok?
Also the professor was using "system pause" in his lecture but that's only for Windows systems right? What would be the C++ equivalent that would work on multiplatforms if that makes sense? I lurk in the WAYWO thread and I remember a little debate about that earlier. I don't want to learn something from the professor that would detract from my learning proper programming (even if I basically have to start with C++).
[QUOTE=TerrorShield;45198320]professor was using "system pause"[/QUOTE]
Whyyyyy.
Anyway i'd use [URL="http://www.cplusplus.com/reference/cstdio/getchar/"]getchar[/URL]
Nice avatar man. Using a rating as an avatar is kinda gimmicky though don't you think?
Anways, getchar seems to be a function designed for a different purpose though? Is that ok to use? I just briefly skimmed what it's supposed to do on that site you linked.
[editline]23rd June 2014[/editline]
I'm sure I'll get a better understanding of what all these functions and stuff do in the future, it just doesn't sit well with me learning something from a professor who doesn't completely understand his own material.
I asked him in class what you would use on a non-Windows system and he literally said he didn't know and left it at that.
[QUOTE=TerrorShield;45198507]Anways, getchar seems to be a function designed for a different purpose though? Is that ok to use? I just briefly skimmed what it's supposed to do on that site you linked.[/QUOTE]
Programming is about doing something out of nothing, there's no [I]right[/I] way to do something. You use what you need. That function just waits for next character from the standard input and returns it, you can do something with it or just don't do anything with it.
[QUOTE=TerrorShield;45198507]Nice avatar man. Using a rating as an avatar is kinda gimmicky though don't you think?
Anways, getchar seems to be a function designed for a different purpose though? Is that ok to use? I just briefly skimmed what it's supposed to do on that site you linked.
[editline]23rd June 2014[/editline]
I'm sure I'll get a better understanding of what all these functions and stuff do in the future, it just doesn't sit well with me learning something from a professor who doesn't completely understand his own material.
I asked him in class what you would use on a non-Windows system and he literally said he didn't know and left it at that.[/QUOTE]
You don't even need to use getchar or system pause, just run the program in an already open console session to read the output. A command line program should terminate after it's done and not wait for an extra enter if you're looking for the "right way". You are a bit quick to judge the professor by something that isn't even a language feature but a little detail that is completely irrelevant outside of example programs
Yeah sorry if I came off that way, I'm entirely new to this and have little idea of what I'm even talking about. I just recalled someone being chastised for using it in WAYWO a while back I think. I'm sure the professor is very programming proficient, I'm not trying to act like I know more than him.
[QUOTE=tdlive aw'sum;45195238]We're talking about the version of the JDK the developer runs. I'd imagine the 64-bit version of the JDK can compile 32-bit applications, but if the developer wishes to write applications that would require the 64-bit support in the future then he should run the 64-bit version of the JDK. Really, there's no reason to be running the 64-bit version (unless you need the extra heap size support) when we're talking about the JDK according to the SO post above and the other sources I've read (which are linked in the question) as they are very similar.[/QUOTE]
Java applications can run independent if they were compiled for a 32-bit or 64-bit JRE. Likewise, if you compile a Java application with the 64-bit JDK, it'll run as if it was compiled for 32-bit on a 32-bit JRE (and vice versa).
[b]Edit:[/b] for an explanation, it's deathly simply: Java bytecode.
I'm trying to work on a chip8 interpreter, however I can't make any progress because I don't understand the instructions.
Here's a sample chip8 demo I got from the internet, and @ 0x14 address the jump instruction makes no sense, is there something I'm missing?
I used the documentation from wikipedia and other sites to try and understand the opcodes.
[IMG]http://i.imgur.com/WkoCZtN.jpg[/IMG]
[URL="http://en.wikipedia.org/wiki/CHIP-8#Opcode_table"]this[/URL] has all the information you will need to understand that
[QUOTE=G4MB!T;45199737][URL="http://en.wikipedia.org/wiki/CHIP-8#Opcode_table"]this[/URL] has all the information you will need to understand that[/QUOTE]
I used that exact table. However look at the instruction 14h. It's 1200, which means jump to address 200. But.. there's no address 200, the code is not that long. Is there some weird endianess to these ch8 files?
[QUOTE=ollie;45199767]I used that exact table. However look at the instruction 14h. It's 1200, which means jump to address 200. But.. there's no address 200, the code is not that long. Is there some weird endianess to these ch8 files?[/QUOTE]
[quote]CHIP-8's memory addresses range from 200h to FFFh[/quote]
You didn't read the article.
[QUOTE=cartman300;45199794]You didn't read the article.[/QUOTE]
Oh damn, I thought the jumps were relative. Thanks!
So I'm working on this tool thing for BF4 that works by injecting a .DLL and it's making me rage:
I complete or change something and sometimes it just completely breaks stuff not related to that thing. I just finished making the named pipe system better and now the 1st Person camera system doesn't work at all. And the funny thing is it works on my friend's computer. Anyone know what could be causing this?
[del]does anyone know why in OpenGL, GL_TEXTURE0 will always render gray (even if a working texture is bound to it), but all GL_TEXTUREi units above 0 work perfectly?[/del]
turns out in my entity's render function i was binding GL_TEXTURE0 to a blank texture, oops!
Alright so I'm basically going through C++ Early Objects and doing every single programming challenge to cement in concepts.
I've gotten to this problem.."Write a program that asks for the names of three runners and the time it took each of them to finish a race. The program should display who came in first, second, and third place. Think about how many test cases are needed to verify that your problem works correctly.".. [URL="https://github.com/Proclivitas/CPP_Early_Objects_Eighth_Edition/blob/master/Chapter%204/Problem%2012/Source.cpp"]https://github.com/Proclivitas/CPP_Early_Objects_Eighth_Edition/blob/master/Chapter%204/Problem%2012/Source.cpp[/URL]
So yeah. Obviously I haven't finished because I decided to trash it, but the next problem is like the exact same. Basically we're expected to do this with only knowledge of the data types, if statements, enums, and the string class. So we only know super basics. I figured that the only way to do this is to map it out logically. If I'm totally overdoing this let me know.
You're comparing hours and minutes separately, don't do that. Convert them to milliseconds or seconds and compare these.
[code]
int ToSeconds(int Hours, int Minutes) {
int sHours = Hours * 60 * 60;
int sMins = Minutes * 60;
return sHours + sMins;
}
[/code]
[editline]25th June 2014[/editline]
1 hour has 60 minutes and 1 minute has 60 seconds, so you just multiply these and get seconds and then add together to get seconds in total, and then you can just use TimeA < TimeB to compare who is faster.
[editline]25th June 2014[/editline]
Or you can simplify that even more by writing a comprasion function and running it with different runner combinations and use a switch on the comprasion result to do stuff
[code]
int Compare(int TimeA, int TimeB) {
if (TimeA < TimeB) then return 0; // Dude A is faster
if (TimeA > TimeB) then return 1; // Dude B is faster
return 2; // They are equally fast
}
[/code]
[QUOTE=cartman300;45205858]You're comparing hours and minutes separately, don't do that. Convert them to milliseconds or seconds and compare these.
[code]
int ToSeconds(int Hours, int Minutes) {
int sHours = Hours * 60 * 60;
int sMins = Minutes * 60;
return sHours + sMins;
}
[/code]
[editline]25th June 2014[/editline]
1 hour has 60 minutes and 1 minute has 60 seconds, so you just multiply these and get seconds and then add together to get seconds in total, and then you can just use TimeA < TimeB to compare who is faster.
[editline]25th June 2014[/editline]
Or you can simplify that even more by writing a comprasion function and running it with different runner combinations and use a switch on the comprasion result to do stuff
[code]
int Compare(int TimeA, int TimeB) {
if (TimeA < TimeB) then return 0; // Dude A is faster
if (TimeA > TimeB) then return 1; // Dude B is faster
return 2; // They are equally fast
}
[/code][/QUOTE]
Can't use other functions either; and I noticed I was being dumb with the whole hour/minute thing and just had the use enter seconds to begin with.
[QUOTE=Proclivitas;45206679]Can't use other functions either;[/QUOTE]
Why?
[QUOTE=FlandersNed;45190631]I'm having a problem involving Processing.
For a school project, I'm making a Tetris clone. I'm using G4P for gui elements, and the inbuilt Minim for sound.
I want to have the menus as separate files, as well as the game as a separate file. However, I cannot find out a way to have a processing file call another processing file. I've checked all over the internet and I can't find one.
I don't think declaring each menu as a class would work, as it needs to create a new background for each menu.
What can I do?[/QUOTE]
Can I please get an answer to this?
[QUOTE=FlandersNed;45208111]Can I please get an answer to this?[/QUOTE]
[url]https://www.processing.org/reference/import.html[/url]
You could ask nicely though :|
[QUOTE=KatNotDinner;45142272]Alright, I hit a wall again. So I've tried to draw a 3D cube via OpenGL, building on top of my previous code. The thing is the output is very weird.
[IMG]http://i.imgur.com/O24e9PU.png[/IMG]
Here's the new code:
[url]http://pastebin.com/Xvmffzyd[/url]
I have tried changing the angle at which the cube is rotated, doesn't work.[/QUOTE]
Anyone?
[QUOTE=cartman300;45206794]Why?[/QUOTE]
Functions aren't introduced at this point of the book I'm in.
Sorry, you need to Log In to post a reply to this thread.