Hello I am a college student, my major is requiring me to take this coding class that I am struggling to understand but i do not have a choice but to take it.
Right now I have a program to write that is due Friday But I too have a midterm for math to study for. I can't spend to much time on this program but it is a major part of my grade so I have to get it done.
The program is called hedgehogs in a hurry. It is board game of some sort. So far All I have done is generate the board but I have No Idea where to go from there can any of you point me in the right direction?
I would go to office hours but they were cancelled this week lucky me. And I can't go to extra sessions until tomorrow which I want to spend doing math.
This is my current code.
public class Main {
public static void main(String[] args) {
Board player = new Board();
player.printNum();
player.printDash();
int s;
for (s = 1; s <= 6; s++){
player.printline(s);
player.printlineA(s);
player.printline(s);
player.printDash();
}
}
}
import java.util.Scanner;
public class Board {
Scanner input = new Scanner(System.in);
public static void printNum(){
System.out.print(" ");
for (int i=1; i<=9; i++){
System.out.print(" ");
for(int j=1; j<=9; j++){
System.out.print(i);
}
}
System.out.println();
}
public static void printDash(){
System.out.print(" ");
for (int i=1; i<=9; i++){
System.out.print("+");
for(int j=1; j<=9; j++){
System.out.print("-");
}
}
System.out.print("+");
System.out.println();
}
public static void printline(int f){
System.out.print(f);
for (int i=1; i<=9; i++){
System.out.print("|");
for(int j=1; j<=9; j++){
System.out.print(" ");
}
}
System.out.print("|");
System.out.println();
}
public void printlineA(int f){
System.out.print(f);
for (int i=1; i<=9; i++){
System.out.print("|");
for(int j=1; j<=9; j++){
System.out.print(" ");
}
}
System.out.print("|");
System.out.println();
}
}
[QUOTE=U_Zirc;36071171]-snip-[/QUOTE]
First of all please use code tags.
Secondly coding is about problem solving. I (we) can't help you without definition of problem first. Luckily quick google search yielded [url]http://www.gamecabinet.com/rules/IgelArgern.html[/url] is this correct?
[code]
public class Main
{
public static void main(String[] args)
{
Board player = new Board();
player.printNum();
player.printDash();
int s;
for (s = 1; s <= 6; s++)
{
player.printline(s);
player.printlineA(s);
player.printline(s);
player.printDash();
}
}
}[/code]
[code]
import java.util.Scanner;
public class Board
{
Scanner input = new Scanner(System.in);
public static void printNum()
{
System.out.print(" ");
for (int i = 1; i <= 9; i++)
{
System.out.print(" ");
for (int j = 1; j <= 9; j++)
{
System.out.print(i);
}
}
System.out.println();
}
public static void printDash()
{
System.out.print(" ");
for (int i = 1; i <= 9; i++)
{
System.out.print("+");
for (int j = 1; j <= 9; j++)
{
System.out.print("-");
}
}
System.out.print("+");
System.out.println();
}
public static void printline(int f)
{
System.out.print(f);
for (int i = 1; i <= 9; i++)
{
System.out.print("|");
for (int j = 1; j <= 9; j++)
{
System.out.print(" ");
}
}
System.out.print("|");
System.out.println();
}
public void printlineA(int f)
{
System.out.print(f);
for (int i = 1; i <= 9; i++)
{
System.out.print("|");
for (int j = 1; j <= 9; j++)
{
System.out.print(" ");
}
}
System.out.print("|");
System.out.println();
}
}
[/code]
What exactly do you need help with? Like what are you trying to achieve?
The next step I think is to create players. I believe that the game is anywhere from 2-6 payers? My question how would I go about creating these players?
[QUOTE=U_Zirc;36072445]The next step I think is to create players. I believe that the game is anywhere from 2-6 payers? My question how would I go about creating these players?[/QUOTE]
You need to focus on choosing method/variable names that make sense. ;)
everyone tells me that but i have no idea what to name them.
well you have a Board class instance, you could call it "bored" or "currentBoard" something that makes sense. "player" is confusing and has no context
ok. that still doesn't change the fact that i don't know what to do now.
[editline]23rd May 2012[/editline]
It seems my professor wants me to create a 2D array of string buffer to create the players how do i do that?
Let me get this straight before I continue writing code.. (not all of it but to help you out)
1. You're to make a game? (Yes/No)
2. Game is played in Console? (Yes/No)
3. [url]http://www.gamecabinet.com/rules/IgelArgern.html[/url] (Yes/No) [Thanks for the link, Burak]
4. The code that you gave us, was it written by you? (Yes/No) [Be honest here, if it was made by the prof its all good]
Can you take all the instructions given to you and post them here please.
I also find it odd/unsettling that you do not know how to make a 2D array.
1 yes
2 if by this you mean it will be executed using the command prompt on a computer then yes
3 yes
4 Yes this is what i have written with my lab partner...
and yes there are a lot of instructions which is why I didnt post them earlier.
let me know if the link isn't working
[url]https://ecommons.ucsc.edu/access/content/group/6e415fa3-8c38-400c-a48e-8d51c28ea8a0/Programming%20Assignments/Program%203[/url]
[QUOTE=U_Zirc;36073193]1 yes
2 if by this you mean it will be executed using the command prompt on a computer then yes
3 yes
4 Yes this is what i have written with my lab partner...
and yes there are a lot of instructions which is why I didnt post them earlier.
let me know if the link isn't working
[url]https://ecommons.ucsc.edu/access/content/group/6e415fa3-8c38-400c-a48e-8d51c28ea8a0/Programming%20Assignments/Program%203[/url][/QUOTE]
The link is working thanks.. I'll get back to you soon (after I understand them myself :D )
thank you i really need the help...[QUOTE=peepin;36073233]The link is working thanks.. I'll get back to you soon (after I understand them myself :D )[/QUOTE]
[QUOTE=U_Zirc;36073193]1 yes
2 if by this you mean it will be executed using the command prompt on a computer then yes
3 yes
4 Yes this is what i have written with my lab partner...
and yes there are a lot of instructions which is why I didnt post them earlier.
let me know if the link isn't working
[url]https://ecommons.ucsc.edu/access/content/group/6e415fa3-8c38-400c-a48e-8d51c28ea8a0/Programming%20Assignments/Program%203[/url][/QUOTE]
I mostly wrote the program but your prof asks for point by point different folders. :rolleyes:
I wrote no blocking code for lolz :smile: First time coding in java.
So its ready as you can see in video and I can send you source for only 50$
pm me if you interested :v:
[video=youtube;jJ9bE7z0fD4]http://www.youtube.com/watch?v=jJ9bE7z0fD4[/video]
You ruthless bastard
Thanks but I'm not desperate enough to the point were I'd pay, not to mention I spoke to my professor he said I will have till Wednesday for only a 10% penalty. [QUOTE=burak575;36077338]I wrote no blocking code for lolz :smile: First time coding in java.
So its ready as you can see in video and I can send you source for only 50$
pm me if you interested :v:
[video=youtube;jJ9bE7z0fD4]http://www.youtube.com/watch?v=jJ9bE7z0fD4[/video][/QUOTE]
[QUOTE=U_Zirc;36078878]Thanks but I'm not desperate enough to the point were I'd pay, not to mention I spoke to my professor he said I will have till Wednesday for only a 10% penalty.[/QUOTE]
Wow thats so much time I could make this an android app and probably release by that time :v:
well at least one of us is confident in their programming skills[QUOTE=burak575;36078998]Wow thats so much time I could make this an android app and probably release by that time :v:[/QUOTE]
[QUOTE=burak575;36078998]Wow thats so much time I could make this an android app and probably release by that time :v:[/QUOTE]
Do it.
[QUOTE=DeadKiller987;36080645]Do it.[/QUOTE]
Already got the android sdk :D
Just out of curiosity, what is your major?
[QUOTE=burak575;36080675]Already got the android sdk :D[/QUOTE]
You're not seriously going to do that? You're the reason people are afraid of posting their code as it [i]may[/i] get stolen.
[QUOTE=Jookia;36164859]You're not seriously going to do that? You're the reason people are afraid of posting their code as it [i]may[/i] get stolen.[/QUOTE]
Are you implying burak575 is incapable of coding on his own?
[QUOTE=Jookia;36164859]You're not seriously going to do that? You're the reason people are afraid of posting their code as it [I]may[/I] get stolen.[/QUOTE]
I already posted a video that shows, I already coded the working game logic. I don't know what made you think, I [I]need[/I] to [I]steal[/I] someone else's code. :rolleyes:
But on the other side; I've already made ready android sdk and cloned AndEngine to see how easy to setup the environment. I may get working on this in few weeks. Because I am currently enjoying with my main project. My main project is not going to be finished anytime soon, so I could do an android game as a "taking break" :rolleyes:
Sorry, you need to Log In to post a reply to this thread.