This site requires JavaScript, please enable it in your browser!
Greenfoot back
MarcoServetto
MarcoServetto wrote ...

2014/4/5

Using greenfoot for challenging problem solving

MarcoServetto MarcoServetto

2014/4/5

#
Hi, I'm new to greenfoot. I'm a lecturer and I like the way greenfoot allows to experiment with many variations and provide immediate feedback, on the other side. I would to use greenfoot to provide some marked exercises too, and I would like to understand if greenfoot can provide a "frozen" environment, when the student can only insert code in a certain point, and then if its code make the game entity "win" then I can "record it" as a successful exercise in some automatic way.
danpost danpost

2014/4/5

#
Can you give an example of an exercise that might be considered for the scenario?
MarcoServetto MarcoServetto

2014/4/6

#
In the current course setting, they have to solve a set of questions on line. Each question is just a piece of Java code containing a set of question mark somewhere. They have to insert a valid piece of code to replace the , so that the resulting composed code compiles and execute without error. --- I would like to use greenfoot so that the question encode a greenfoot game instead of any Java program, and then they can use greenfoot to have graphical feedback about what happen when they try to solve the puzzle. However greenfoot allows to modify the code freely (not just add code in a specific place) and to dynamically create objects and put them in the world; thus allowing them to step "out" of the exercise.
danpost danpost

2014/4/6

#
'game', 'puzzle', 'graphical feedback' -- I am a bit confused. Please explain. Also, I did not ask for a more detailed explanation, I asked for an example (also, that did help; but, only a little). I would need an actual example with a few different possible solutions and what type of feedback should be given.
MarcoServetto MarcoServetto

2014/4/7

#
Ok, so a concrete example: A game where there are tanks moving and shooting to each other, the student have to write the "act" method for the tank of his team, so that they win the game. Another exercise could be to provide the act method but left empty the implementation of an "aim(target)" method that compute the right angle to turn the turret in order to point to the target. In both cases, greenfoot could be runned over the student solution so that he can see what is going on during program execution.
danpost danpost

2014/4/7

#
I think what you are wanting is something like what the Greeps challenge does (except with team v. team). Are you familiar with it?
MarcoServetto MarcoServetto

2014/4/7

#
I have search for it right now, I have found http://www.greenfoot.org/competition/greeps/, and there is a set of "rules". How those rules are enforced? is there a framework to automatically enforce those kind of rules? Is something the lecturer/tutor is supposed to manually check for each submission? Is there a way to run greenfoot with limitations on what the user can do?
danpost danpost

2014/4/7

#
Unless you build a construct like the 'UserInfo Greeps' scenario does (which would be quite a task), there would be little one could do but check each submission. However, there may be a way to put all the submissions together so that you can check all of them at one time. The Find function may come in handy for some checks (I guess that would depend on what things you would be checking for, however). I will try to drum up a sample scenario that may be in line of what you are looking for.
danpost danpost

2014/4/8

#
I was thinking along the lines of each team being labeled; like Team A, Team B, etc. Numerically, team A would be team 0, B would be 1, etc. Then, pass the team number to each tank when created and have it save it in an instance field (call it 'teamNum'). Then, the 'act' method of the Tank class could be something like:
1
2
3
4
5
6
7
8
9
10
public void act()
{
    switch(teamNum)
    {
        case 0: teamA(); break;
        case 1: teamB(); break;
        case 2: teamC(); break;
        // etc.
    }
}
With this, each team will create their own method ('teamA', 'teamB', 'teamC' respective to their designation) to be like their 'act' method and the tanks will do as each team coded their methods. I have already tested something similar to this (with a little silliness; but, it was just for testing). I had it pair up each team with every other team and log the wins (which were not really wins, per se -- part of the silliness) and display final results. It actually turned out pretty good for what it was.
MarcoServetto MarcoServetto

2014/4/9

#
I fear I failed to explain myself. >I was thinking along the lines of each team being labeled; like Team A, Team B, etc. switch To run multiple AI at the same time, of course the best way is to use polymorphism, and to dynamically load the different AIs. Tanks of different teams can have a field of AI type, and then just use the strategy pattern. However, that is nothing to do with my issue. One of the things I'm trying to understand: how easy is for a piece of code that is supposed to simply control the behaviour of an object to use reflection and other metalinguistic features to hack to engine itself? is there any security manager preventing certain things? is the structure of the framework properly encapsulated so that you need the right permissions to alter the state of the framework? To make a simple example, can I easily prevent any piece of code that have access to the world to directly create a new world object in a certain location?
danpost danpost

2014/4/9

#
I believe that if you made that world class a private inner class of another world, actors and other worlds would not be able to create one directly. Only the class it is in will be able to directly create one. As far as reflection and other metalinguistic features, security managers and framework structure -- I must truthfully state that I know little about them in regards to how they can be manipulated (or hacked).
You need to login to post a reply.