# Snowflakes On The Ice-Help (Java Script)

**URL:** https://discourse.codecombat.com/t/snowflakes-on-the-ice-help-java-script/5279
**Category:** Uncategorized
**Created:** [October 16, 2015, 11:17pm UTC](https://discourse.codecombat.com/t/snowflakes-on-the-ice-help-java-script/5279 "2015-10-16T23:17:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Paul\_Lum](https://avatars.discourse-cdn.com/v4/letter/p/ea5d25/32.png) [@Paul\_Lum](https://discourse.codecombat.com/u/Paul_Lum)
#### Post date: [October 16, 2015, 11:17pm UTC](https://discourse.codecombat.com/t/snowflakes-on-the-ice-help-java-script/5279/1 "2015-10-16T23:17:51Z")

</div>

I have been struggling with this mission. I got the line fractal, but when I get to the hexagonal flake, it has a problem. I do the top side, then I rotate my vector by 60 degrees (like it says), but my next side doesn’t stop. the fractal continues all the way to the edge of the area, until I run into the side. can anyone help? Here’s my code for the flake function:

```python
this.flake = function(start, end) {
    var a = start;
    var b = end;
    for (var i=0;i<6;++i){
        var side = Vector.subtract(b,a);
        this.line(a, b);
            var rotate = Vector.rotate(side,degreesToRadians(60));
            var magnitude = rotate.magnitude();
            a=this.pos;
            b=Vector.limit(rotate,12);
    }
};

```
