CSC207H: Assignment 3
A3
Reading Code, Plugging into and Architecture, FileIO, File Parsing, Regex, Using AI, Using a Design Pattern.
Getting started
Starter code has been placed in
git clone
https://[email protected]:9999/git/207/24f/repo_a3_UTORID.git
under the a3 IntelliJ project.
Inside the repo, you will find important documents and directories
Package ca.utm.utoronto.paint
- the Paint program
scrum - the directory to store scrum artefacts.
- please review and maintain the documents here. You will be adding to
- dailyScrumMeeting.txt
- productBacklog.txt : implement the user stories in here
- sprintBacklog.txt
- Please make sure to follow good Scrum procedures.
Part 1: Add New Features
You should modify the given application to add USER STORY 3.1, 3.2 and 3.3 IN THAT ORDER! You must add the USER STORIES and BUGS in the specified order. You must conform. exactly to the paintSaveFileFormat.txt. This document also appears in your repo.
BUG 3.4 and BUG 3.5 are not required, they are just additional exercises. For full marks YOU DO NOT have to complete BUG3.4 and BUG3.5.
1. [10 marks: Medium] USER STORY 3.1 Polyline
Hint: Understand Squiggle.
Objectives:
Practice reading and understanding a large code base.
See and understand the use of design patterns in code.
Extend existing code by plugging into design patterns.
2. [5 marks: Easy] USER STORY 3.2 Save
Objectives:
Practice file writing
Some understanding of an existing design pattern is needed here.
The result of Saving a file should be a completely correct Paint Save file. My parser should be able to read your files.
3. [10 marks: Medium] USER STORY 3.3 Load
Your parser should pass all of my PaintFileParserTest test cases. DO NOT BREAK THE PaintFileParser public interface!! Hint: Since spaces don't matter, strip them out of the line immediately aft er you read them from the file. This simplifies your regular expressions! That is, in PaintFileParser.parse, add
l = l.replaceAll("\\s+",""); // right at the start of the while loop
Objectives:
Practice file reading
Regular Expressions
File parsing via a finite state machine
4. [0 marks: Hard] BUG 3.4, Visitor1 Drawing
Objectives:
Demonstrate understanding of an advanced design pattern, refactoring existing code to take advantage of the design pattern.
Since we won't help you apply the design pattern, this requires that you search resources, understand them, understand how to map the pattern onto existing code and then modify the existing code. Our notes do have a good collection of examples though.
5. [0 marks: Easy] BUG 3.5, Visitor2 Save
Objectives:
Once the architecture is in place, this exercise gives you a chance to see how this simplifies and localizes concepts.
Note: We will not answer questions about Visitor above. Why? Because part of being a developer is understanding the literature and applying it to your code. These are intended as a challenge.
Part 2: AI Features (ollama/llama3)
[25 marks: Medium]
We would like to add AI into the actual paint application, but we will be satisfied with using AI to generate and modify Paint File Format files. This is inches away from having a feature in Paint, but this will be easier for you to implement and for us to mark.
Reference Files:
Ollama, OllamaNumberedFile, OllamaPaint
samples1.zip and samples2.zip
The output of my incomplete solution at samples1.zip and samples2.zip. These were generated strictly from newFile and modifyFile as implemented in my solution. See if you can do better!
See the resources folder.
Your job is to
Login to the UTM VPN
FIND YOUR 3 Ollama Servers from this list, and use only your servers!! You only need 1.
Understand class Ollama You do not have to complete anything here!
Understand class OllamaNumberedFile. You do not have to complete anything here, but you should check that everything works. Plug in your server (in place of dh2010pcXX) and run OllamaNumberedFile.main() Then check your home directory for the newly created files.
Complete class OllamaPaint, so that it runs completely, generating an interesting collection of files in your home directory when OllamaPaint.main() is executed. This means you have to complete
newFile
newFile1
newFile2
newFile3
modifyFile
modifyFile1
modifyFile2
modifyFile3
Marks for modifyFileX and newFileX come from creating interesting files and modifications which work eff ectively. Is it an interesting idea? Does it execute well? Does it sometimes, most times or always produce parsable files?
Question:
Aft er I merge my userstory/bug fix, can I delete my branch?
Question:
Do I have to name the branches as described in the repo? Do I have to add my name to user stories/bugs?
Question:
Can I see the branches in the git log (command line?)
Question:
If there are platform. issues where should our final project run?
Question:
Do we get marked for scrum on this?
Question:
Can I add classes and methods to the Paint starter code.
Question:
Can I change the signature of the given starter code methods?
Question:
How will the version number change?
Question:
How many states is reasonable?
Question:
What if my parser can parse a file that the solution parser can't.
Question:
I want to ask about the PaintFileParser, should our code work in a manner that if an error occurs, it just returns either true or false and causes the code to stop at that point?
Question:
I do have another question though. When I load a file, should all the shapes in the panel that existed before the load be erased?
Question:
Also, should the parser be case-insensitive?
For example,
In the assignment page we have:
Paint Save File Version 1.0
Circle
Should my parser also parse:
Paint Save File Version 1.0
CIRCLE
note: circle is capitalized
Question:
What about negative coordinates?
Question:
How do I go about understanding all of the Paint code?
Question:
Someone posted on reddit:
"@CSC207 profs: I really appreiciate how much you care about us not falling behind, but...
...not all of us can start the assignment as soon as it's released lol."
Responces include things like:
"Suck it up like the rest of us that did this before."
What gives? Why are you pressuring us?
Question:
I go to off ice hours asking how to implement a solution to Polyline, and the TA starts asking me questions about how paint works.
Question:
How do I prevent my branch from flattening out into master when I merge on the command line?
版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。