【MCD4710】Introduction to Algorithms and Programming

You are likely already familiar with a plethora of prehistoric paint programs. These all have a simple premise: you draw a colour on the canvas, and this overwrites, or sits on-top of, the existing canvas colours.
Some applications support transparency, allowing you to blend colours. Some allow you to draw
shapes, and others allow you to click and drag certain elements. None of them have the liveliness that
the FoA Admin team is looking for however. We want to be able to paint sparkles, or a rainbow, on
top of our images. Rather than painting with colours, we want to paint with Eff ects !
Throughout this assignment, you'll be working on a paint application, with the following features:
Multiple diff erent ways to combine eff ects, and paint with such eff ects
Undo/Redo
A painting replay
A special action
In doing this, you'll need to demonstrate knowledge on the following topics:
Stacks, Queues, Lists
Applications of the Data Structures above
Before you get working on the application, please read these tips & tricks to ensure you don't get lost,
or lose any silly marks!
Common Mistakes
You are marked on correctness in Ed . It doesn't matter if your code passes locally, it needs to
pass in Ed. Contact a TA if you are having trouble achieving parity. Be careful of the specifi c
Python version used, and don't import any other third party modules excluding those already
in requirements.txt .
Follow the rules regarding ban on lists, other collections and use the given data_structures
almost always. Check the task speciff c page to see what collections are banned for that feature.
Write clear and concise docstrings for methods you introduce, and type-hint all methods /
variables. If introducing new classes, consider using dataclasses to simplify this deff nition.
Separate your code into small methods of at most 20 lines, and try to abstract logic if you ff nd
lots of duplicated work. Almost all methods in the sample solution are 10 lines or less. (Please
ignore the mess that is main.py :} )
Initial Setup + Running Tests
To get up and running you want to do a few things:
Import the template repository into your own - Follow the instructions in the Getting Started
with Git page.

Optional\] Make a virtual environment for the project: python3 -m pip install virtualenv \&\& python3 -m venv venv (And then activate the virtual environment) (You may need to change python3 to python or py depending on your Operating System and Python version) Install the required packages: python3 -m pip install -r requirements.txt (Same deal here with python3 ) Test it is working by running python3 main.py or python3 -m visuals.basic (These will probably raise NotImplemented errors if you haven't implemented anything, but if your setup didn't work you'll get errors complaining packages aren't installed.) To run tests, call python run_tests.py . Note that you can restrict which tests are run using a second argument. You can always assume there at most 20 Layers in the application, but design the time complexity of your solution around an unbounded amount. dataclasses are used in some of the scaff old code. In short, they do a lot of the initialisation boilerplate for you by inspecting the type hinting for class variables. You can read more about it here . This project also uses abstraction with the abc module. You can read more about it here . Since this is a paint app, here's some recommend listening while you knock these tasks out of the park!

相关推荐
Swift社区3 分钟前
从 0 到 1 构建一个完整的 AGUI 前端项目的流程在 ESP32 上运行
前端·算法·职场和发展
RTC老炮7 分钟前
webrtc弱网-BitrateEstimator类源码分析与算法原理
网络·人工智能·算法·机器学习·webrtc
程序员烧烤11 分钟前
【leetcode刷题007】leetcode116、117
算法·leetcode
ghie90901 小时前
基于libsvm的支持向量机在MATLAB中的实现
算法·支持向量机·matlab
Rubisco..3 小时前
牛客周赛 Round 111
数据结构·c++·算法
兮山与3 小时前
算法8.0
算法
高山上有一只小老虎3 小时前
杨辉三角的变形
java·算法
Swift社区3 小时前
LeetCode 395 - 至少有 K 个重复字符的最长子串
算法·leetcode·职场和发展
hz_zhangrl3 小时前
CCF-GESP 等级考试 2025年9月认证C++四级真题解析
开发语言·c++·算法·程序设计·gesp·c++四级·gesp2025年9月
少许极端3 小时前
算法奇妙屋(六)-哈希表
java·数据结构·算法·哈希算法·散列表·排序