hey hi to everyone im new in the site bout i thin its cool
but the reason i am writing is that i have a home work in java and i have no idea how to do it can someone help me???????
a matrix in wich a number moves some kind of snake. please someone help me

Recommended Answers

All 19 Replies

hmmm thats not at all vague! you know we like to see some effort before we help!

Your post is vague and no one will help you unless you post some code (basically the effort majestic0110 was talking about). Make a list of all the steps you have to do to complete the program, small steps, and then as you start coding you might have an epiphany and need no help whatsoever.

i love this community, but the amount of 'homework hackers' that post here is irritating

It's becasue most of them are stupid teenagers who don't feel the need to read the rules.

Yes jimmy bones is not exactly the best type of student, but sometimes you can't help it to ask stupid questions on the forum. Would you like to check my first questions in C++ forum nearly 3 years ago?
If you see any more post like this either ignore it or politely ask them to be more specific about they homework, either they will replay and provide more data or they would not come at all. If you get the responce you can start buil on it and you may find that person on other side actually did something but over looked some banal thing.
I belive there sort of saying China that say "There are no bad students just bad teachers."
Think about it...

I belive there sort of saying China that say "There are no bad students just bad teachers."
Think about it...

Something I utterly disagree with. There are a lot of kids who are completely unwilling to learn anything if it costs them any effort at all.
Even the best teacher can't do a thing about that if there's a system like the internet where you can just post your homework assignments and get some fool to do them for you while you're lazing around.

Hopefully those kids will fail their exams in the end, but current educational systems are ever more geared towards not making anyone fail, either by reducing the passing score to make sure the failure rate stays low or by getting rid of failing grades completely because failure "hurts the self esteem of students" (yes, I've heard of that happening in several places).

Are you trying to code a game where a moving snake is displayed ? Why do not you try some basic java coding before trying game programming ?

I think what bugs me more than the lack of effort in describing the problem is the lack of effort in proper writing style. The Internet is not an excuse for poor grammar; feels like I'm reading posts by a 6yr old.

but current educational systems are ever more geared towards not making anyone fail, either by reducing the passing score

Oh, you mean DeVry? I'm ashamed to have attended there.


Almost forgot actual helpful advice.

Jimmy, look at the Canvas class for drawing your snake or whatever. (assuming I'm thinking of the same game you have in mind) Read up on key listeners so the users can control the snake with their keyboard. I can offer you more advice after you've explain specifically where you're having trouble.

I think the general feeling is that we are all here to help each other and interact with each other but a little respect and effort is all we ask

The best you can usually do for someone is to help him help himself.
Guide him towards the solution without revealing it, hint at where to find information or what information to look for rather than providing the information.

I agree on this one jwenting

hej i am an good student but i am on the first year and in ouer country this an experimental class we have no books no materials nothing thats why i dont have any idea about the project so if some one helps me would be very kind

ps: I m not stupid at all

hej i am an good student but i am on the first year and in ouer country this an experimental class we have no books no materials nothing thats why i dont have any idea about the project so if some one helps me would be very kind

ps: I m not stupid at all

You have not even asked a question yet. You merely posted an extremely vague description of an assignment. Do you expect us to just start coding whatever we think a solution might be and post it here for your inspection?

If your class has no books or materials, how is it a class at all? Do you not have notes from a lecture at least? Those are materials. Did your instructor walk in the first day and exclaim "make a matrix in which a number moves some kind of snake"? If so, perhaps you should have left the class?

brother i am form albania that s how stuff works here they don t explain a thing and sak a lot
the project is about building a matrix (4*4) and in this matrix the first element will move like the form of the I I HOPE THAT YOU UNDERSTAND THIS


I 000
I I I I
000 I
I I I I

We still will not code it for you.

ok i am happy even with a way of how can i solve it
not the full code

Alright Jimmy, what is the goal here? Once you've built this 4x4 matrix, what do you have to do with it?

Here's a simple 4x4 matrix created with the pattern you just showed above.

int[][] matrix = {{1,0,0,0},{1,1,1,1},{0,0,0,1},{1,1,1,1}};

Now what are you trying to do with it?

that s a start thanks but the main purpose of the program is to show only the 1 not the 0 in that form i have show you

I
I I I I
. . . I
I I I I

Member Avatar for iamthwee

So print a single space instead of a 'O'. You know how to do that right?

import java.util.*;
public class Crap
{
  public static void main ( String[] args )
  {
    String[][] matrix = 
      {
       {"1", " ", " ", " "},
       {"1", "1", "1", "1"},
       {" ", " ", " ", "1"},
       {"1", "1", "1", "1"}
      };

    for ( int i = 0; i < 4; i++ )
    {
      for ( int j = 0; j < 4; j++ )
      {
        System.out.print ( matrix[i][j] );
      }
      System.out.println();
    }
  }
}

output

1
1111
   1
1111
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.