Need help with greenfoot project

Hi I am new to java and having trouble with a project I am doing.

I'm not sure how to go about doing this problem.

These are the commands Clara can use.

turnLeft(); - Clara turns 90 degrees to the left
• move();+++++++++++++++++++++++++ - Clara moves one step forward in the direction she is currently facing
• putLeaf();++++++++++++++++++++++ - Clara puts one leaf at her current position
• removeLeaf();++++++++++++++ - Clara removes a leaf at her current position
•
• turnRight();++++++++++++++ - Clara turns 90 degrees to the right
• onLeaf();+++++++++++++++++++++++++++ - Returns true if Clara is positioned on top of a leaf or false otherwise
• treeFront();++++++++++++++ - Returns true if there is a tree one step ahead in the direction Clara faces or false otherwise
• treeLeft();+++++++++++++++++++++++++++ - Returns true if there is a tree to the left from Clara or false otherwise
• treeRight();+++++++++++++++++++++++++++ - Returns true if there is a tree to the right from Clara or false otherwise
• mushroomFront();+++++++++++++++++++++++++++ - Returns true if there is a tree to the right from Clara or false otherwise
• readInt(String+text);+++++++++++++++++++++++++++ - Allows user to enter an integer number from keyboard, returns the entered number
• readDouble(String+text);++++++++++++++++++++++++++ + - Allows user to enter a real number from keyboard, returns the entered number

Re: Need help with greenfoot project

Surely you know how to at least start? The assignment also seems to want you to actually draw that screen, so you must have learned how to do such things? I'd say step one is to get at least as far as to produce that 'initial screen', at that point you don't even have to implement any of the 'commands' listed there yet. Then start implementing everything one at a time.

Re: Need help with greenfoot project

I wouldn't know where to begin, I'm not trained to help people who just dump their homework and then say "help me" without explaining anything about what they know already and what they have done so far themselves to work on the problem.

Re: Need help with greenfoot project

gimbal, just to let you know that Greenfoot (Greenfoot) is a programming learning framework aimed at 14yrs+ age group. So I think you get a lot of the initial setup and 'hard' graphics stuff for free, which leaves the learner to play around with the programming steps required to move an avatar around the screen, do things, and respond to events such as collisions with other items on the canvas. I saw a demo by one of the Greenfoot developers from the University of Kent last year, it's pretty cool.

I wanted to mention that so we don't get caught up with trying to create the initial canvas from nothing.

Re: Need help with greenfoot project

That at least explains something. So basically you're trying to do something cool you found on the net that is part of a training program, without actually being in the training program?

No I'm not tryna do something cool, I'm trying to finish this project and I am part of the training program.

In the first part the user has to enter the length and width with which to create the basket, I've done that part by using a for loop, I was just wondering how I would go about placing the leaves in that position no matter the length and width of the basket.

Re: Need help with greenfoot project

Well that's a little bit more information again, apparently you already have done something and you know how to use a for loop.

Drawing a cake that "scales" with the size of the basket is the ultimately end result. As a simpler step in between I would first try to write some code which produces the cake exactly as it is in the picture and worry about the variable width and height later. So try to draw a cake that is 20 cells wide and 7 cells high.

If you look at the picture you can see that the cake basically consists of four individual components;

- it has a solid edge on the left side
- it has an edge on the right side
- it has an edge on the bottom
- it has a checkered pattern in the center

As an even simpler first step, could you write code to produce only the checkered pattern without the edges? If you have that start, you may find it easier to do the rest of the cake too.