Skip to main content
Commonmark migration
Source Link

#JavaScript (E6) + Html 173 176 193

JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

173 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Nice


Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.66, [100,500, 500,100, 500,500, 100,100, 300,150, 150,300, 300,450, 450,300]) // Function call, not counted
</script>

#JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

173 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Nice


Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.66, [100,500, 500,100, 500,500, 100,100, 300,150, 150,300, 300,450, 450,300]) // Function call, not counted
</script>

JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

173 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Nice


Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.66, [100,500, 500,100, 500,500, 100,100, 300,150, 150,300, 300,450, 450,300]) // Function call, not counted
</script>
added 110 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

176173 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddleJSFiddle

Nice

 

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.566, [100,450500, 500,450100, 500,500, 100,100]100, 300,150, 150,300, 300,450, 450,300]) // Function call, not counted
</script>

#JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

176 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.5, [100,450, 500,450, 100,100]) // Function call, not counted
</script>

#JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

173 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Nice

 

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.66, [100,500, 500,100, 500,500, 100,100, 300,150, 150,300, 300,450, 450,300]) // Function call, not counted
</script>
added 33 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#JavaScript (E6) + Html 176173 193 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

176 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;
  forheight=600;n--;x-=(;nx-p[i])*r,y-;=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1),
  i=Math.random()*p.length&~1,
  x-=(x-p[i])*r,y-=(y-p[i+1])*r    
}
F(100000, 300, 300, 0.5, [100,450, 500,450, 100,100]) // Function call, not counted
</script>

#JavaScript (E6) + Html 176 193

Edit: big cut, thanks to William Barbosa

176 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  t=C.getContext("2d"),C.width=C.height=600;
  for(;n--;)
  t.fillRect(x,y,1,1),
  i=Math.random()*p.length&~1,
  x-=(x-p[i])*r,y-=(y-p[i+1])*r
}
F(100000, 300, 300, 0.5, [100,450, 500,450, 100,100]) // Function call, not counted
</script>

#JavaScript (E6) + Html 173 176 193

Edit: big cut, thanks to William Barbosa

Edit: 3 bytes less, thanks to DocMax

176 bytes counting the function and the canvas element needed to show the output.

Test save as html file and open in FireFox.

JSFiddle

Mask


Snow


Carpet


<canvas id=C>
<script>
F=(n,x,y,r,p)=>{
  for(t=C.getContext("2d"),C.width=C.height=600;n--;x-=(x-p[i])*r,y-=(y-p[i+1])*r)
    i=Math.random(t.fillRect(x,y,1,1))*p.length&~1      
}
F(100000, 300, 300, 0.5, [100,450, 500,450, 100,100]) // Function call, not counted
</script>
deleted 17 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
deleted 2 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
added 69 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
added 76 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
added 71 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading