[Lazarus] Feeback wanted: Tutoring kids with Pascal project idea

Anthony Walter sysrpl at gmail.com
Fri Apr 26 17:15:07 CEST 2019


I've been tutoring a few kids aged 9-13 on the topic of computer
programming for about two months and want to give a few of them a fun
project to play with starting this Monday. So that would mean I need to
write this project between now and then. I'd like to get some feedback on
this project idea from you guys as I implement the final version, if your
willing to give it consideration.

Education goal:

Give more concrete examples of how to write functions in Pascal and
demonstrate that they can be both fun and useful. This will hopefully
further increase students attention and interest in the area of computer
programming.

Project description:

I will design a node based image manipulation program where users can place
on a canvas using the mouse and interactively connect them together with
source images and other node to generate a final image.

The program will pick up on the procedures a student writes and resulting
in new node types becoming available in a toolbox. The user can then select
that node and place it on a node canvas and connect the nodes together
visually. Every node has a slider to mix the value it uses in a range from
0.0 to 1.0.

Nodes fall into two types, a manipulation node or combination node.

A manipulation node accepts a single source image and outputs changed
pixels to one image. Manipulation nodes might do things like change image
brightness, saturation, creating a negative image, or converting the image
to a mosaic and so on.

A combination node accepts two source images and outputs changed pixels to
one image. Combination nodes might include multiplying the pixels of two
images, alpha blending two images, doing a screen blend of two images.
Essentially combination nodes act like layers in image editing programs
like Photoshop or Gimp.

>From the perspective of the student he is writing Pascal functions that
look like the following:

procedure BlackOrWhite(var Pixel: TPixel; Mix: Single; var Done: Boolean);
var
  B: Byte;
begin
  if Pixel.Red + Pixel.Green + Pixel.Blue > Mix * High(Byte) * 3 then
    B := High(Byte)
  else
    B := Low(Byte);
  Pixel.Red := B;
  Pixel.Green := B;
  Pixel.Blue := B;
end;

This then shows up in the user interface as an manipulation node named
"Black or White" and is available in the toolbox. The user can then place
the node on the node canvas and hook its input up to either a picture node
or another node, and route its output either to the display node or another
node. The user can drag the slider value effecting the mix value of the
node.

Multiple node types can be programmed to create varying image effects and
multiple nodes can be combined on the node canvas to change what images and
what node effects are applied along with mixing values to generate output
for the display node.

There are of course a few other features such as global X Y coordinates and
image size that is available to the node procedures. They can also use
multiple passes to generate node effects that require information from
neighboring pixels.

Does anyone are to provide feedback on my project idea for students? Thank
you for considering what I've written.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190426/3d0bf2a4/attachment.html>


More information about the lazarus mailing list