【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!

相关推荐
程序员-King.6 分钟前
day134—快慢指针—环形链表(LeetCode-141)
算法·leetcode·链表·快慢指针
Swift社区8 分钟前
LeetCode 376 摆动序列
算法·leetcode·职场和发展
高洁0114 分钟前
AIGC技术与进展(1)
深度学习·算法·机器学习·transformer·知识图谱
未来之窗软件服务15 分钟前
计算机等级考试——二叉树考点和坑——东方仙盟
算法·二叉树·计算机软考·仙盟创梦ide·东方仙盟
张张努力变强27 分钟前
C++类和对象(一):inline函数、nullptr、类的定义深度解析
开发语言·前端·jvm·数据结构·c++·算法
且去填词1 小时前
深入理解 GMP 模型:Go 高并发的基石
开发语言·后端·学习·算法·面试·golang·go
Hcoco_me1 小时前
大模型面试题76:强化学习中on-policy和off-policy的区别是什么?
人工智能·深度学习·算法·transformer·vllm
企业对冲系统官1 小时前
大宗商品风险对冲系统统计分析功能的技术实现
运维·python·算法·区块链·github·pygame
ValhallaCoder1 小时前
Day48-单调栈
数据结构·python·算法·单调栈
Sylvia-girl1 小时前
数组题目之移除元素
算法