Cobain Programming

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

What would you want Java files for? Do you like a Java game but don't want to be online while playing or something? If you think you are going to learn Java via DEcompiled applets, think again. There are no comments and unless I'm mistaken, function and var names are nothing but random chars and numbers. A compiled program doesn't have Variable names.... its all numbers. Now I might be wrong on this with Java, but I doubt it.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

No, all programming is just levels of abstraction. There is no such thing as a variable, there is no such thing as a function or any of that. There isn't even such thing as 1 or 0, true or false. There is only electric current or no current which themselves are abstract representations.

Yes, you can barf now.

But seriously, a decompiler isn't going to have your variable names, comments, etc. I think 99% of the time decompiled code is garbage. I don't even think there is such thing as a Java decompiler.

I think he got kicked off of a Java game and wants to download it, decompile it, and |-|4>< it to allow him to do all sorts of things. If that doesn't work, he'd want to resort to changing his IP address so he isn't banned anymore.
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

No, all programming is just levels of abstraction. There is no such thing as a variable, there is no such thing as a function or any of that. There isn't even such thing as 1 or 0, true or false. There is only electric current or no current which themselves are abstract representations.
*cough* I meant phisically on the hard drive, or I suppose more truly when loaded into memory. I know you got that from somewhere but I'll ask you anyway, what else is there after:
There is only electric current or no current which themselves are abstract representations.
See, I think the line of "abstract representations" ends where the program is stored. Instructions etched in somewhere.

Dang, well if you think about it, all programs are interpretted.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Post by MarauderIIC »

cobain wrote:Um...you can obtain the source code by hacking the host's comptuer via his ip, given he has no proxy first of all. From there you can proceed to get to the files and whatnot, but then they're in java.
Whoa, we try to refrain from using our powers for 3vil here. Okay, well, I do...
cobain wrote:but what is an internal IP even used for?
So routers know where to send stuff, is one way of looking at it.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
cobain
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 45
Joined: Mon Nov 22, 2004 5:37 pm
Location: Tennessee

Post by cobain »

dont worry, I can't even hack. :D But the whole reason for this java whatnot is a friend of mine (goes to richview) plays a game called Runescape. Personally I think its boring, but to each his own. He is paying me a little bit to get him the code that he can read and i'm tryin to be a friend. And Gyro, that stuff about there are no ...anything... thats pretty cool.
There isn't even such thing as 1 or 0, true or false
Was that a question there?
Last edited by cobain on Mon Dec 20, 2004 9:25 am, edited 1 time in total.
Image
cobain
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 45
Joined: Mon Nov 22, 2004 5:37 pm
Location: Tennessee

Post by cobain »

Lets say I have a console application, written in DEV C++ here. (If you need, I can post the code.) Once the program has completed in the command prompt, and the DOS window remains up. I want to re-run the program without having to go into the folder and selecting it again, is there anything I can type in that command promtp to make the program that was previously run repeat or re-run itself? Or, would I need to insert a line of code, if so what? If code, what I want it to say at the end of the program is "Would you like to repeat this program, Y or N?", What code would I need to insert after that?
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

cobain wrote:Lets say I have a console application, written in DEV C++ here. (If you need, I can post the code.) Once the program has completed in the command prompt, and the DOS window remains up. I want to re-run the program without having to go into the folder and selecting it again, is there anything I can type in that command promtp to make the program that was previously run repeat or re-run itself? Or, would I need to insert a line of code, if so what? If code, what I want it to say at the end of the program is "Would you like to repeat this program, Y or N?", What code would I need to insert after that?
Whoah whaoh.
First off, you said it was "written in Dev-C++." You do realize that's not a language. That's just the compiler. And either way it should be the same nomatter where you compile so I don't understand what you're trying to say there.

What you could do (and what Dinosaur Sniper and I did in Poke'mon Hangman) is make your main function recursive.

You could try calling main() from main.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Post by MarauderIIC »

Agh! Recursive main?! Why?! Just put the whole thing in a while loop or something :P

If you don't care about actually exiting the program, put the whole main thing in a while loop that tests to see if the variable that stores the answer to that question is y and if it is break. Just make sure it doesnt start on y.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

If you don't care about the program being nice or efficient like I don't 99.99% of the time in C programming, you could do the while.

Actually, I looked back at the Poke'mon source and it looks like we did decide to have some pride and do an infinate while loop.

Yeah, what Mar said is just better period. Recursive main is like about as bad as using gotos...
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

HOLY CRAP!!!! Gyrovobis...... your the only guy I know who'd use recursion for something like that. :lol:
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

Well, in C programming it's so much easier to be a lazy bum and use all gotos and main function recursion to finish work early and work on something like NEStix or have a LAN of some first person shooter with all of my friends in C programming.

No, I take pride in having a good and efficient coding style. I think outside of class I have a good style.
cobain
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 45
Joined: Mon Nov 22, 2004 5:37 pm
Location: Tennessee

Post by cobain »

Ok, how would I put a loop in it...or put it in a loop. Which ever. BTW, what does the "return 0" thing at the end of the code do? What happens if you change that "0"? And for the loop, or recursion, whichever is easier, if you need I can post some code, that is if that would make it simpler. And I do realize that DEV C++ is a compiler, and is not a language.
Last edited by cobain on Sun Dec 26, 2004 10:00 am, edited 1 time in total.
Image
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

Look at your C++ book's loooopen chapter. So easy, you won't have to read but like 2 sentences.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
cobain
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 45
Joined: Mon Nov 22, 2004 5:37 pm
Location: Tennessee

Post by cobain »

I spent like 30 or 45 minutes looking through the chapter entitled "Pointers" because that is where the index directed me for the entry "loop" and I read and re-read the chapter, and found this thing, but my compiler says it is a non-existant command.

Code: Select all

somestring[0];
and

Code: Select all

UserWantsToContinueYorN();
I have no clue what either command does, but thats all I gained from that chapter. Would you please just tell me what lines to insert in my code?
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

Dude, OMG. Back up. You're jumping into things that you obviously have no clue about. I have no clue what kind of a substandard book has loops in the index where it talks about pointers.

Also, you really need to quit calling everything a "command". There are functions and other things. Have you been using game makers and stuff? Gay things that do all the work for you are where "commands" are used. Those things you showed are a user defined function and array. Neither are commands.

You know what. Maybe you should reread everything. I think you're jumping WAY too far ahead of yourself. You need to go back and try to understand the general concepts or you'll never be successful with this.
Post Reply