-
Notifications
You must be signed in to change notification settings - Fork 13
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
SnowFlake #8
base: master
Are you sure you want to change the base?
SnowFlake #8
Conversation
Dragon Curve/DragonCurve.js
Outdated
var sky = canvas.getContext('2d'); | ||
var len = 15; | ||
|
||
function inRad(num) { |
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.
toRadians(degree)
Dragon Curve/DragonCurve.js
Outdated
canvas.width = document.body.offsetWidth; | ||
canvas.height = window.innerHeight; | ||
var sky = canvas.getContext('2d'); | ||
var len = 15; |
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.
length
Dragon Curve/DragonCurve.js
Outdated
} | ||
var axiome = "FX"; | ||
var sentence = axiome; | ||
var rules = []; |
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.
Эффективнее использовать для правил ассоциативный массив (словарь): rules["X"] = "X+YF+";
Немного быстрее и код подстановки красивее.
Dragon Curve/DragonCurve.js
Outdated
sky.strokeStyle = "green"; | ||
for (var i = 0; i < sentence.length; i++) { | ||
var current = sentence.charAt(i); | ||
if (current == "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.
В JS лучше сравнивать оператором эквивалентности ===
script.js
Outdated
canvas.width = document.body.offsetWidth; | ||
canvas.height = window.innerHeight; | ||
var sky = canvas.getContext('2d'); | ||
var deg = Math.PI / 180; |
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.
radiansPerDegrees
Кто же ты? |
No description provided.