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.

Results 1 to 6 of 6

Thread: GridWorld

  1. #1
    Member
    Join Date
    May 2013
    Posts
    165
    Thanks
    58
    Thanked 1 Time in 1 Post

    Default GridWorld

    I'm reading the book 'Thinking in Java' and I'm at the first gridworld stage, I've installed gridworld though my version is different to the books, mainly there is no Rock.
    What do you guys think I should do?

    --- Update ---

     
    /* 
     * AP(r) Computer Science GridWorld Case Study:
     * Copyright(c) 2005-2006 Cay S. Horstmann ([url=http://horstmann.com]Cay Horstmann's Home Page[/url])
     *
     * This code is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation.
     *
     * This code is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     * 
     * @author Cay Horstmann
     * @author Chris Nevison
     * @author Barbara Cloud Wells
     */
     
    import info.gridworld.actor.ActorWorld;
    import info.gridworld.grid.Location;
     
    import java.awt.Color;
     
    /**
     * This class runs a world that contains box bugs. <br />
     * This class is not tested on the AP CS A and AB exams.
     */
    public class BoxBugRunner
    {
        public static void main(String[] args)
        {
            ActorWorld world = new ActorWorld();
            BoxBug alice = new BoxBug(6);
            alice.setColor(Color.ORANGE);
            BoxBug bob = new BoxBug(3);
            world.add(new Location(7, 8), alice);
            world.add(new Location(5, 5), bob);
            world.show();
        }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: GridWorld

    What do you guys think I should do?
    What specific questions do you have about your project?

    Please edit your post and wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    May 2013
    Posts
    165
    Thanks
    58
    Thanked 1 Time in 1 Post

    Default Re: GridWorld

    thank you for replying, well what I have downloaded is different from all the exercises in the book so do you know of any tutorials on gridworld that take into account changes the case study has gone through?
    Feel free to recommend anything other than gridworld that may help me as a beginner.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: GridWorld

    Did you have any specific problems or questions about java programming? I don't know anything about gridworld.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    May 2013
    Posts
    165
    Thanks
    58
    Thanked 1 Time in 1 Post

    Default Re: GridWorld

    no.

  6. #6
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: GridWorld

    Quote Originally Posted by keepStriving View Post
    though my version is different to the books, mainly there is no Rock.
    What do you guys think I should do?
    Find a matching version of the book or software.
    Perhaps design your own Rock to substitute.
    I do not know anything about gridworld either but that does not mean you can't find help here.
    You never say what is wrong with the code. You say there is no rock, but to people unfamiliar with gridworld, what is a rock? Is it a class? Or a variable? Perhaps a package?
    Is there a compiler error or runtime error? Always post the full text of errors with your question and code.
    What we need to be able to help you is a description of the problem, what works and what does not. What did you expect the code to do as you have written it, and what does it actually do?
    If you can not explain better what is wrong, then my final suggestion would be to not play with broken toys just yet, and find an educational tool without internal errors

Similar Threads

  1. GridWorld Code - Need Help
    By prodigytoast in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 3rd, 2010, 09:02 PM