|
-
January 17th, 2011, 05:52 PM
#4
Re: Java Programming Code Help
Check out this link.
http://www.willamette.edu/~gorr/clas...9/arrays2d.htm
It's about using a 2D - array of int to simulate a checkers game. If that is not to your liking then google "java array example" and read read read. It's the only way to learn. And that is the point of your assignment.
Concerning your code (which Martin O has already reminded you to use the tags so I won't):
You have a bunch of "int" just kickin around but they aren't grouped in any fashion so systematically comparing them will be difficult (way more difficult than using arrays or a single multi-dimensional array).
Martin O speaks the truth. Arrays are about as basic as programming gets. First you have single primitive elements (i.e. int, long, boolean, etc...), which you seem to have a grasp on, after that the next most basic form of these primitive elements is to order them in a data structure called an array. If the basic concept of an array (or 2D arrays even) is beyond comprehension then maybe programing isn't right for you (at least at this moment). Of course you will never know until you try to learn it without being explicitly told how to tackle your problem.
So, what you are trying to do is create a multi-dimensional array of primitive type int (integers of course) and compare them in some fashion. So you need to learn how to create a 2D int array and how to "loop" through the elements and compare them for equality.
You're getting there though so I hope you keep trying. =D
Best of luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|