+ All Categories
Home > Documents > Assignment8:...

Assignment8:...

Date post: 03-Nov-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
15
Assignment 8: The egg-hoarder (Sokoban) Algorithmic Thinking and Structured Programming (in Greenfoot) c 2017 Renske Smetsers-Weeda & Sjaak Smetsers 1 Contents Introduction 1 Learning objectives 2 Instructions 2 Theory 2 8.1 Greenfoot feature: while loop in the Run ................................ 2 8.2 Calling a method in act .......................................... 4 8.3 Run while you can! ............................................. 4 8.4 Run or Act? ................................................. 5 8.5 The MovableActor class .......................................... 5 8.6 Nested if .. then .. else .. statements ........................... 6 Challenges 9 8.1 Find the egg using if .. then .. else .. (instead of while) ................. 9 8.2 Getting started with Sokoban ....................................... 10 8.3 Responding to arrow keys ......................................... 10 8.4 Mimi pushes eggs forward ........................................ 10 8.5 Scoreboard .................................................. 11 8.6 Level achieved ............................................... 11 8.7 Oops .. undo? ................................................ 12 8.8 New levels .................................................. 12 Reection 13 Saving and Handing in 14 1 Licensed under the Creative Commons Attribution 4.0 license: https://creativecommons.org/licenses/by/4.0/
Transcript
Page 1: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

Assignment 8: The egg-hoarder (Sokoban)

Algorithmic Thinking and Structured Programming (in Greenfoot)c© 2017 Renske Smetsers-Weeda & Sjaak Smetsers1

ContentsIntroduction 1Learning objectives 2Instructions 2Theory 28.1 Greenfoot feature: while loop in the Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28.2 Calling a method in act . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48.3 Run while you can! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48.4 Run or Act? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58.5 The MovableActor class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58.6 Nested if .. then .. else .. statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Challenges 98.1 Find the egg using if .. then .. else .. (instead of while) . . . . . . . . . . . . . . . . . 98.2 Getting started with Sokoban . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108.3 Responding to arrow keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108.4 Mimi pushes eggs forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108.5 Scoreboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118.6 Level achieved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118.7 Oops .. undo? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128.8 New levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Reflection 13Saving and Handing in 14

1Licensed under the Creative Commons Attribution 4.0 license: https://creativecommons.org/licenses/by/4.0/

Page 2: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

IntroductionIn this assignment youwill write a game in Greenfoot known as Sokoban. See http://sokoban.info/for an example. Our variation is called ’Mimi the egg-hoarder’. The original game takes place in awarehouse. The player is a warehouse employee whose task is to push crates to the correct location.

This game is played in the Madagaskarworld; the world in which Mimi lives. The goal is for Mimi topush all the eggs into the nests. The following rules apply:• Mimi can only push eggs forward, she can’t pull an egg;• Mimi cannot sit on an egg or step over it;• Mimi can only push one egg at a time. As a consequence, Mimi cannot push two (consecutive oradjacent) eggs simultaneously;• No two eggs can occupy one cell (not even in a nest);• A nest can hold only one egg;• An egg can be pushed out of a nest;• Neither Mimi nor an egg can be pushed through a fence;• Mimi can step over a nest (of course, very carefully so that she doesn’t destroy it). If the nest holdsan egg, she will push the egg out;• There are as many nests in the world as eggs;• The level is completed when each nest is filled with an egg.Contrary to the previous assignments, you will not implement an algorithm to make Mimi do some-thing. This time the user directs Mimi by pressing a key, and in the code we must explain what Mimimust do depending on which key is pressed.We start by explaining a particular use of if .. then .. else statements. This is needed to incor-porate user-interaction for the different keys in the Sokoban game.In addition, you will learn to use the Run which is built into Greenfoot. This is needed for user-interaction. With this, methods called in the act method will continuously be repeated. As a conse-quence, we don’t need a while loop to repeat the steps of our algorithm.

Algorithmic thinking and structured programming (in Greenfoot) 1

Page 3: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Learning objectivesAfter completing this assignment, you will be able to:

• explain in your own words how the Greenfoot Run works (as repeating the code in act( ));• stop a Greenfoot program;• handle user interaction in the code;• apply nested if..then..else statements;• apply the knowledge from previous assignments to implement a game on your own.

InstructionsFor this assignment you will need:

• scenario ’DodoScenario8’: to be downloaded from the course website2.Throughout the assignment you will also need to answer some questions. The following must behanded in:

• All flowcharts: use pencil and paper, or go to https://www.draw.io/;• Your code: the file MyDodo.jav and Egg.java contain all your code and must be handed in;• The reflection sheet: complete and hand it in.You must discuss all other answers with a programming partner. Jot down a short answer on (theassignment) paper.

There are three types of challenges:Recommended. Students who need more practice or with limited programming experi-ence should complete all of these.Mandatory. Everyone must complete these.Excelling. More inquisitive tasks, designed for students who completed 2 star tasks andare ready for a bigger challenge.Students who skip 1-star challenges should complete all 3-star challenges.

A note in advance:• In this assignment you may only make changes to the MyDodo class and the Egg;• You may use methods from the Dodo, Egg and MovableActor class, not from the Actor class;

TheoryTheory 8.1: Greenfoot feature: while loop in the RunGreenfoot has a built-in Run command feature. If you press the Run button, then the act method willcalled repeatedly. This is great for programming games and things with user interaction because wewant the game to continue even after the user has given a first input.2http://course.cs.ru.nl/greenfoot/

Algorithmic thinking and structured programming (in Greenfoot) 2

Page 4: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Using the Run is only useful if the algorithm consists of repeating the same steps over and overagain, like checking for user-input. The step that must be repeated must then be placed in the act( )method. The code in the act( )method is called repeatedly in the while loop of the Run.

Consequences for your codeHowever, if you want to use the Run you have to change the way you specify your algorithm. In theprevious assignments you described algorithms which make use of a while to repeat certain steps. Anexample is the ’find-the-egg’ algorithm (Challenge 2.6)which used: ”While not egg found, take a step.”Figure 1 shows the corresponding flowchart.

Figure 1: Flowchart for ’find-the-egg’ algorithm using a while (Challenge 2.6)Using the Run, the while-construct in the algorithm will be replaced with a if..then..else con-struct as follows:

Algorithmic thinking and structured programming (in Greenfoot) 3

Page 5: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Figure 2: Flowchart for ’find-the-egg’ algorithm in the act( )methodFrom now on we will set-up the program so that each step of the algorithm is placed in the actmethod. Then, when the Run button is pressed, the entire program is executed.The Run, with it’s while-loop always remains the same. From now on we will therefore not drawthe while loop anymore. You won’t find the loop anywhere in the code either: it is built-in Greenfoot.

Stopping the programUse Greenfoot.stop( ) to interrupt the Run and stop the program. Alternatively, you can press the’Pause’ or ’Reset’ button.Theory 8.2: Calling a method in actBy calling a method in act( ) it will be run once when the Act button is pressed, or repeatedly whenthe Run button is pressed. Call a method in the act as follows:

public void act( ) {methodName( );

}

Theory 8.3: Run while you can!If you press the Run button in Greenfoot, then the whole scenario is executed. That means that foreach actor the actmethod is continuously executed. This repeats, for each actor, over and over againuntil you press the Pause button, or until Greenfoot.stop( ) is called somewhere in the code.FlowchartThe flowchart in figure 3 describes the Run behaviour.

Algorithmic thinking and structured programming (in Greenfoot) 4

Page 6: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Figure 3: Flowchart for RunThe flowchart explained:When the user presses Run, then:

• First the condition expression in the diamond ’NOT stop’ is checked;• If the condition expression is ’False’ (that is, Greenfoot.stop( ) has been called in the code), thenthe Runmethod ends.• If the conditional expression is ’True’, then for each actor the actmethod is called.After the act method is executed for each actor, the method jumps back to the diamond andchecks the conditional expression again. Is ’NOT stop’ still true? Then the ’True’ path is followedagain and the act method is called again (loop). This continues to happen until the conditionbecomes ’False’.

Note: In Greenfoot you can execute a method in several ways:• By calling themethod directly. Right-click on the object (for example, Mimi) and select themethod.• Press the Act button. For this to work, the method must be called in the void act( ) code.• Press the Run button. Here too, for this to work, the method must be called in the void act( )code. In this case, the method is called repeatedly.

Theory 8.4: Run or Act?You maybe wondering ”Why on Earth did they add a Run button?”. There are several reasons for this:

• Too respond to user-input (mouse or keyboard). Using the Run functionality you’re not forced todo everything at once in the act. If youwould place all the code in the everything in the act, it maytake a long time before the program responds to any user-input, if it responds at all. Obviouslythat’s not the intention, and very frustrating for the user. By using the Run, your program canquickly responds to user-input.• To involvemultiple actors, each with their own actmethod. For example: if you place two MyDodoinstances in the world, then each will have their own act. Try it out. What you usually want isthat all these objects do something (more or less) simultaneously. You won’t be able to do that ifyou have the entire task in the act method, but you will if you break the task down into smallersteps.

Theory 8.5: The MovableActor class

Algorithmic thinking and structured programming (in Greenfoot) 5

Page 7: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

New to the Sokoban scenario is the MovableActor class. Each Dodo can be moved(and is thus movable), and now belongs to the MovableActor class. Contrary to theprevious assignments, Eggs can now be moved too. Both Eggs and Dodos belong tothe MovableActor class. The class diagram shows both Dodo and Egg as sub-classesof MovableActor.The MovableActor has several ’move’-related methods such asvoid step (int direction) and boolean borderAhead (int direction) (bothhave been moved from the Dodo class to the MovableActor class). Mimi now in-herits these methods from MovableActor. See figure 4:

Figure 4: Methods which Dodo inherits from MovableActor

Egg classEggs now belong to the MovableActor class. They too can use the step andborderAhead methods. In addition, several new methods have been added to theEgg class. The most important are:

• void push ( int direction): which allows an egg to be pushed in a partic-ular direction. This direction is passed as a parameter.• boolean canBePushed ( int direction ): which can be used to test if an eggcan be moved in the specified direction.

Theory 8.6: Nested if .. then .. else .. statementsTo test multiple cases simultaneously, nested if .. then .. else statements can be used. We usenesting to handle keyboard input. When the user presses one of the arrow keys on the keyboard, Mimimust face in that direction.Code using nested if .. then .. else .. statementsThe Greenfoot method boolean isKeyDown (String key) tests whether the user has pressed a partic-ular key. The following method checks the ”up-arrow” button has pressed:

Greenfoot.isKeyDown ("up");

In the handleKeyPress method this test is used to determine which key has been pressed andchanges the direction in which Mimi is facing accordingly:public void handleKeyPress() {

// check if the left-arrow key has been pressedif ( Greenfoot.isKeyDown( "left" ) ) {

setDirection ( WEST );} else {

// check if the right-arrow key has been pressed

Algorithmic thinking and structured programming (in Greenfoot) 6

Page 8: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

if ( Greenfoot.isKeyDown( "right" ) ) {setDirection ( EAST );

} else {// check if the up-arrow key has been pressedif ( Greenfoot.isKeyDown( "up" ) ) {

setDirection ( NORTH );} else {

// check if the down-arrow key has been pressedif ( Greenfoot.isKeyDown( "down" ) ) {

setDirection ( SOUTH );}

}}

}}

Flowchart using nested conditional statements:The corresponding flowchart looks like this:

Figure 5: Flowchart for handleKeyPressNote: As a result of the numerous accolades and the fact that the code stretches further and furtherto the right, the code becomes hard to oversee and furthermore error-prone. We will now explainanother construct which leads to clearer code.Simpler code using else .. if.. statementsIn Java, there is an simpler way for writing these types of nested conditional statements. Most pro-grammers combine the else and the if into one code-line using an else .. if.. statement. Themethod handleKeyPress then becomes:public void handleKeyPress() {

if ( Greenfoot.isKeyDown( "left" ) ) {setDirection ( WEST );

} else if ( Greenfoot.isKeyDown( "right" ) ) {

Algorithmic thinking and structured programming (in Greenfoot) 7

Page 9: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

setDirection ( EAST );} else if ( Greenfoot.isKeyDown( "up" ) ) {

setDirection ( NORTH );} else if ( Greenfoot.isKeyDown( "down" ) ) {

setDirection ( DOWN );}

}

Note: This results in less lines of code, and furthermore, the code-structure becomes much clearer.

Algorithmic thinking and structured programming (in Greenfoot) 8

Page 10: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

ChallengesPlease read Theory 8.1: Greenfoot feature: while loop in the Run.Please read Theory 8.2: Calling a method in act.Please read Theory 8.3: Run while you can!.

Challenge 8.1: Find the egg using if .. then .. else .. (instead of while)Now that the Run has been introduced, we will practice using it. Because the code in the act( )methodis called repeatedly, you don’t need to use a while in your code anymore. Instead, use an if..then..else.a) Write code for the method shown in the following flowchart.

Figure 6: Flowchart for searching the egg using if instead of whileTip: Use Greenfoot.stop( ) to stop the program.

b) Test your method using the right-mouse-button (very often!!!). After calling the method manytimes, Mimi eventually finds an egg and the program stops.c) The act( ) method can continuously call a method (instead of you having to right-click on themethod):

i) Find the act( )method inMyDodo.ii) Call your method in act( ).

Algorithmic thinking and structured programming (in Greenfoot) 9

Page 11: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

iii) Test your program using the Act button. Does the program do the same as a right-click onthe method call?iv) Test your program using the Run button.

The Run command ensures the repetition by continuously executing the act( ) method. Methodscalled in the act( ) use an if..then..else statement instead of a while.Please read Theory 8.4: Run or Act?.Please read Theory 8.5: The MovableActor class.

Challenge 8.2: Getting started with Sokobana) Download and open the DodoScenario8 scenario.b) Open the code and see which method is called in the act( )method.c) Run the scenario, by pressing the Run button.

i) Describe what happens.ii) Press the arrow keys on your keyboard. As you can see the handleKeyPress method is notcomplete yet.iii) Which key(s) does Mimi respond to? Which doesn’t Mimi respond to?

d) By right-clicking on an egg, test the new Eggmethods push and canBePushed. Do this several times,each time with the egg in a different position in the world. Do these methods work as expected?As you have seen, lots of things don’t work properly yet. Mimi walks through fences and over eggs,and does not adequately respond to the arrow keys pressed. In the next challenge youwill create orderin Mimi’s world.

Please read Theory 8.6: Nested if .. then .. else .. statements.

Challenge 8.3: Responding to arrow keysWe must create order in Mimi’s world, by fixing all the things that don’t work properly. We start byfixing Mimi’s behavior to the user’s input:a) Open the MyDodo class in the editor and find handleKeyPress.b) Have a look at the body of the handleKeyPressmethod. Here, a sub-method called getNewDirectionis used. Describe what getNewDirection does.c) Adjust the code so thatMimi adequately responds to all the arrow keys. Tip: Have a look at Theory8.6 about ’Nested if .. then .. else .. statements’ in which the Greenfoot method isKeyDownis discussed. In each case, return the desired direction.d) Run the scenario and ensure that Mimi indeed responds to each arrow key adequately. Tip: don’tforget to call handleKeyPress from act.Mimi now takes a step in the direction of the arrow-key pressed.

Algorithmic thinking and structured programming (in Greenfoot) 10

Page 12: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Challenge 8.4: Mimi pushes eggs forwardMimi has to learn how to push eggs forward. If Mimi is in front of an egg, we must ensure that shedoesn’t just step over an egg, but that she actually pushes it forward. Wewill now adjust handleKeyPressto work as expected. To do so, follow the next tips:

• First decide which specific cases should be distinguished and adjusted;• The Dodo class contains all the methods which you need to distinguish these cases;• Obviously, the new Eggmethods will be useful;• Mimi can check whether there is an egg laying directly in front of by calling eggAhead;• Mimi can get a hold of the egg using getEggAhead;• Using the existing methods, she can ask the egg whether or not it can be pushed, and if so, pushit forwards and then (in the same direction), take a step herself.Run and test your changes. Try a few cases systematically. Make sure that the rules described inthe introduction are complied to.

Challenge 8.5: ScoreboardWe need a scoreboard show how many steps Mimi has taken and how many eggs have been placed ina nest. We will let Mimi keep track of these scores herself and have a scoreboard display the values.Do this as follows:a) First, add two instance variables to MyDodo for storing this information (one for number of stepstaken, the other for the number of eggs in a nest), see Theory ??. Consider meaningful names,appropriate types and a suitable initial value.b) As soon as Mimi takes a step, change the value of the instance variable for the number of stepstaken.c) After each step, call updateScores to ensure that the changed situation is actually displayed onthe scoreboard.d) To ensure you haven’t made any mistakes thus far, compile and test your changes before pro-ceeding.e) Now adjust the second variable to keep track of how many eggs have been placed in a nest. Tip:The Dodomethod boolean nestAhead()may be useful.f) Again, call updateScore after an egg is placed in a nest.g) Run and test your program.You know have a working scoreboard!

Challenge 8.6: Level achievedThe program must now decide whether the level has been completed or not.a) Add a booleanmethod that checks whether the level has been completed. Tips:

• The level is completed as soon as the egg-score is equal to the number of eggs in the world.• The best place to do this is where the egg-score changes.

Algorithmic thinking and structured programming (in Greenfoot) 11

Page 13: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

• Use the Worldmethod getObjects to determine how many eggs the world contains.b) If the level is completed, call the method levelFinished. Have a look at the Java documentationabout what the method does and consider how you can use the result of this method after youdetermined if the level has been completed or not.

Challenge 8.7: Oops .. undo?Finally, it is still a bit unsatisfying that when the user accidentally presses the wrong key he may not beable to complete the level anymore (he gets into a situation in which the level cannot longer be solved).An undo function would be helpful.This can be achieved with some code adjustments to the myDodo class. We will only give somegeneral indications on how to do this; its up to you to come up with and implement the details.a) Determine a suitable undo-key. Add a method to handle the user-interaction.b) Determine which information must be remembered/stored in order to undo a move.c) Besides having Mimi take a step back, sometimes an egg’s position must be restored (or undone)too.d) Consider what should happen if the user wants to undo multiple steps.e) Does the correct value appear on the scoreboard after an undo?

Challenge 8.8: New levelsAdd your own new challenging levels to the scenario. Let a fellow student test whether they can besolved or not. Also have them decide what the level’s difficulty is.

Algorithmic thinking and structured programming (in Greenfoot) 12

Page 14: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

ReflectionIn this assignment you practiced using list to store values. You also learned about the for-each-loop totraverse lists and how to use a list to store (Egg) objects. One of the most important steps in becominggood at anything is to evaluate and reflect on what you did and how it went:ResultI know my solution works because . . .I am proud of my solution because . . .I could improve my solution by . . .

MethodMy approach was good because . . .What I could do better next time is . . .

Fill the following table with smileysindicating how things went. I can do it

I did it a bit but didn’t fully get it

I didn’t get it at all

I can express formulas in code;

I can simulate complex Physics laws in a program which I wrote on myown.

Algorithmic thinking and structured programming (in Greenfoot) 13

Page 15: Assignment8: Theegg-hoarder(Sokoban)course.cs.ru.nl/greenfoot/docs/Opdrachten3.0/DodoAssignment8-student.pdf · Theegg-hoarder(Sokoban) Assignment8 NewtotheSokobanscenarioisthe MovableActor

The egg-hoarder (Sokoban) Assignment 8

Saving and Handing inYou have just finished the assignment. Save your work! You will need this for future assignments. Inthe Greenfoot menu at the top of the screen, select ’Scenario’ and then ’Save’. You now have all thescenario components in one folder. The folder has the name you chose when you selected ’Save As ...’.Handing inHand in your code: The java file MyDodo.jav.

Algorithmic thinking and structured programming (in Greenfoot) 14


Recommended