-
Notifications
You must be signed in to change notification settings - Fork 0
Turtle graphics #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| this.maxX = 0; | ||
| return this; | ||
| } | ||
| forward(step) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try if and else if for the conditional block
| a = new Turtle(0, 0); | ||
| } | ||
| for (let i = 0; i < inputArr.length; i++) { | ||
| if (inputArr[i][0] == "f") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try if and else if for the conditional block
| // Function to split the script input into an array | ||
| // and run the script using the values | ||
| function runTurtleScript(input) { | ||
| let inputArr = input.split("-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let -> const
| //and run scripts accordingly | ||
| function scriptWithOption(input) { | ||
| // If there are no input | ||
| if (input == undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!input
| return; | ||
| } | ||
| // If the proper option were passed in | ||
| else if (input.slice(0, 9) == "--output=") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion if you don't want to rely on the position: input.includes("--output=")
|
|
||
| return fs.writeFile(input.slice(9), data, (err) => { | ||
| if (err) { | ||
| console.log(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.error
TURTLE GRAPHICS HOMEWORK 2SCORESHEET FOR STUDENT EricCreate a simple drawing program inspired by Turtle Graphics.It will be a much simpler implementation that will only acceptright angles (90 degrees).GRADING CRITERIA:Course Value: 5%Assignment Value: 100%GRADE:
LATE ASSIGNMENTS WILL BE DEDUCTED 5% OFF PER 24 HOURS, FOR A MAX OF 20% DEDUCTION OVERALL. Part 1: Submitted and on Time
Part 2: Features
Part 3: Stretches
ASSIGNMENT RUBRIC
|
No description provided.