Program that allows users to draw shapes, built with Haskell
This project was created during my university studies at ANU in 2019 and has been transferred from the ANU GitLab server.
Read the technical report »
Table of Contents
Using the functional programming language Haskell I created a program that draws shapes (line, polygon, rectangle, circle and ellipse). Find the core algorithm in src/view.hs. To find out how the algorithm has been implemented, read the report.
- To run requires the Global Haskell Compiler and Cabal: https://www.haskell.org/platform/
- To develop use IntelliJ IDEA
- Clone the repo
git clone https://github.com/Tim-W-James/Sushi-Go-AI.git
- Navigate into the root directory and run
cabal build cabal run shapes
- Follow the local host link to a browser
Available shapes:
- line
- polygon
- rectangle
- circle
- ellipse
Action | Effect |
---|---|
Esc (key) |
Clear the canvas |
M (key) |
Display a mystery image |
C (key) |
Cycle colour (of shape to draw) |
T (key) |
Cycle tool (type of shape to draw) |
Backspace /Delete (key) |
Remove the last added shape |
D (key) |
Print the current Model to the terminal (useful for testing) |
Click-drag-release (mouse) | When not drawing polygons, draw a shape between the click-point and release-point |
Click (mouse) | When drawing polygons, add a point to the polygon |
Spacebar (key) |
Finish drawing a polygon, adding it to the canvas. |
Email: [email protected]
Project Link: https://github.com/Tim-W-James/Shape-Drawer
- Australian National University for project skeleton and CodeWorld API implementation