8.7.0.3

D — GUI

Due Wednesday, 21 September 2022, 11:59pm

Purpose to explore the GUI libraries of the chosen programming language; to deliver software as specified

Delivery You must deliver xgui in a directory called D in your repository.

All auxiliary files must be put into a sub-directory called D/Other/.

Task Develop xgui, a program that reads an arbitrarily long series of equally long JSON strings, each made up of ┘, ┐, └, ┌ characters. You may assume that your program receives well-formed and valid JSON strings.

The program interprets each character as a graphical square tile with a “road” on it that indicates a connection to two sides: one Vertical, one Horizontal. It paints these squares, in order and row by row, into a GUI canvas, waits for the first mouse click, and shuts down. The printed result (on STDIN STDOUT) of running xgui is a JSON array that contains the x and y coordinates of this first mouse click.

Suppose the input file series contains two lines JSON values, i.e., it may have this shape:

    "┌┌┐"

    "└└┘"

A simplistic rendering may look like this:

    image

It interprets “connects” in a loose but recognizable manner.

Here is a fancy one, where each tile is also decorated with precious gems:

    image

As long as the connector is interpreted correctly, enjoy some artistic freedom.

Evaluation The graders will run your program at the command line on some inputs, following exactly the above instructions and observing the relevant parts of the specification.

See Delivery for additional information on how to access a Linux desktop so that you can run GUI applications from there on your personal computer.