Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

SnowFlake #8

wants to merge 3 commits into from

Conversation

Apforviolet
Copy link

No description provided.

var sky = canvas.getContext('2d');
var len = 15;

function inRad(num) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toRadians(degree)

canvas.width = document.body.offsetWidth;
canvas.height = window.innerHeight;
var sky = canvas.getContext('2d');
var len = 15;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length

}
var axiome = "FX";
var sentence = axiome;
var rules = [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эффективнее использовать для правил ассоциативный массив (словарь): rules["X"] = "X+YF+";
Немного быстрее и код подстановки красивее.

sky.strokeStyle = "green";
for (var i = 0; i < sentence.length; i++) {
var current = sentence.charAt(i);
if (current == "F") {
Copy link

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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

radiansPerDegrees

@disturm
Copy link

disturm commented May 8, 2018

Кто же ты?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants