Skip to content

[Task] Grid Solver #117

@mikebarkmin

Description

@mikebarkmin

In some scenarios in schools, a grid is used to ease the problem-solving process. Instead of a single pixel, you only have to worry about a cell, which is the same size as every other object in this world. This is famously used in most introductory Greenfoot books and tutorials. For example, in the official Greenfoot Book. Therefore, I think, that it would be a great idea to implement a "Grid Solver" task.

The task creator should be able to create a grid and fill it with a set of objects. The interface could look similar to this one: https://www.reddit.com/r/reactjs/comments/k9cdbp/codedemo_links_included_built_a_maze_builder_app/.

Based on the grid based scenarios I know, I would propose the following objects:

  • Player (an object, which is controlled by the written algorithm)
  • Pickup 1 (an object, which can be picked up by the player)
  • Pickup 2 (an object, which can be picked up by the player)
  • Wall (an object, which a player can not pass)
  • Start (an object, where the player starts)
  • Finish (an object, where the player finishes)

To mark the solution as correct, there should be a set of objectives, which can be set by the task creator.

  • Number of Pickups: The player needs to collect a certain amount of pickups or all.
  • Finish: The player reaches the finish.
  • Steps: A maximum number of steps which can be used.

When a user submits a solution and the show feedback is enabled, the player should move through the grid. To make this language independent, we need to come up with a protocol, which can be parsed in JavaScript and then executed. I think the best way would be to use actions, which could be dispatched on the frontend. For example, this set of actions:

  • MOVE_LEFT(steps)
  • MOVE_UP(steps)
  • MOVE_RIGHT(steps)
  • MOVE_DOWN(steps)
  • PICK_UP()
    The actions are basically the public methods, which can be called on a player object.

Optional: The task creator should be able to choose from different texture packs. For example, Crab-Beach, Mars-Rover, Hamster, …

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions