Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

2 Visitor Messages

  1. Pls what is wrong with my codes

    public class Chessboard{
    public static void main(String args[]){
    //read the numbers of square from command-line
    int n = Integer.parseInt(args[0]);

    // double x0,x1,y0,y1,;

    //Reset the scales on both axis
    StdDraw.setXscale(0.0 , 8.0);
    StdDraw.setYscale(8.0, 0.0);

    //Draw the (boundary of) chess board.
    // StdDraw.line....
    StdDraw.line(0.0,0.0,1.0,0.0);
    StdDraw.line(0.0,1.0,1.0,1.0);
    StdDraw.line(0.0,0.0,0.0,1.0);
    StdDraw.line(1.0,0.0,1.0,1.0);

    //Draw sqaures on the chess board
    StdDraw.square(0.0, 0.5 ,0.0 );
    StdDraw.square(0.5, 0.5 ,0.5 );

    StdDraw.filledSquare(1.5, 0.5, 0.5);
    StdDraw.text(0.5 , 0.5 , "W");
    StdDraw.setPenColor(StdDraw.WHITE);
    StdDraw.text(1.5 , 0.5, "B");

    for(int i = 0; i<n ; i++) {
    for(int j =0; j<n ; j++) {

    // Draw squares based on whether the sum of
    // their row and colomn is even or odd.


    if(( i % == 1) && (j % == 1)){

    //draw odd sqaure
    }
    else {
    //draw even sqaure
    }
    }
    }


    //send output to screen and file
    StdDraw.show();
    StdDraw.save("chessboard.png");

    }
    }
  2. Thanks for checking my profile
Showing Visitor Messages 1 to 2 of 2
About Topiloe

Basic Information

About Topiloe
Java Skill Level:
Beginner

Statistics


Total Posts
Total Posts
2
Posts Per Day
0.00
Visitor Messages
Total Messages
2
Most Recent Message
October 26th, 2012 10:15 AM
Total Thanks
Total Thanks
0
  • Thanked 0 Times in 0 Posts
General Information
Last Activity
October 26th, 2012 10:20 AM
Join Date
September 25th, 2012