Skip to main content
Commonmark migration
Source Link

#HTML + JavaScript (ES6), 351 374 384

HTML + JavaScript (ES6), 351 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,124,222,162,184,253,104,213,162,164,244,191,224,182,133,191,64,104,222,93,164,253,122,224,284,151,284]
  .map((v,i)=>(
    a = i % 3,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a],
    c.beginPath(),
    --a,
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

#HTML + JavaScript (ES6), 351 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,124,222,162,184,253,104,213,162,164,244,191,224,182,133,191,64,104,222,93,164,253,122,224,284,151,284]
  .map((v,i)=>(
    a = i % 3,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a],
    c.beginPath(),
    --a,
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

HTML + JavaScript (ES6), 351 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,124,222,162,184,253,104,213,162,164,244,191,224,182,133,191,64,104,222,93,164,253,122,224,284,151,284]
  .map((v,i)=>(
    a = i % 3,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a],
    c.beginPath(),
    --a,
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

deleted 64 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#HTML + JavaScript (ES6), 374351 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284';`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--]'#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,162,184,253,104,164,213,244,162,191164,224244,191,222224,253182,284133,182191,64,93104,122222,15193,133164,104253,164122,224,284,151,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--]'#0a8'][a],
    c.beginPath(),
    --a,
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284';`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--]'#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

#HTML + JavaScript (ES6), 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,253,104,164,213,244,162,191,224,191,222,253,284,182,64,93,122,151,133,104,164,224,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--],
    c.beginPath(),
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

#HTML + JavaScript (ES6), 351 374 384

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

Less golfed

<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,124,222,162,184,253,104,213,162,164,244,191,224,182,133,191,64,104,222,93,164,253,122,224,284,151,284]
  .map((v,i)=>(
    a = i % 3,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a],
    c.beginPath(),
    --a,
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>

Test

<canvas id=C></canvas><script>c=C.getContext("2d");`133124222162184253104213162164244191224182133191064104222093164253122224284151284`.match(/.../g).map((v,i)=>(c.fillStyle=['#fc0','#f04','#08a'][a=i%3],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(--a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>

<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>
<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>
<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,253,104,164,213,244,162,191,224,191,222,253,284,182,64,93,122,151,133,104,164,224,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--],
    c.beginPath(),
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>
<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,253,104,164,213,244,162,191,224,191,222,253,284,182,64,93,122,151,133,104,164,224,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--],
    c.beginPath(),
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>
<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>
<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,253,104,164,213,244,162,191,224,191,222,253,284,182,64,93,122,151,133,104,164,224,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--],
    c.beginPath(),
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>
<canvas id=C></canvas><script>c=C.getContext("2d");'133162124184222253104164213244162191224191222253284182064093122151133104164224284'.match(/.../g).map((v,i)=>(a=i<12?(i>>1)%3:(i-12)/5|0,c.fillStyle=['#fc0','#f04','#0a8'][a--],c.beginPath(),c[l='lineTo'](x=5*~~v/10,y=v%10*25),c[l](x-10,y+(a+!a)*17),a&&c[l](x-30,y+a*17),c[l](x-20,y),!a&&c[l](x-10,y-17),c.fill()))</script>
<canvas id=C></canvas>
<script>
  c=C.getContext("2d");
  [133,162,124,184,222,253,104,164,213,244,162,191,224,191,222,253,284,182,64,93,122,151,133,104,164,224,284]
  .map((v,i)=>(
    a = i < 12 ? (i>>1) % 3 : (i-12) / 5 | 0,
    x = 5 * ~~ v / 10,
    y = v % 10 * 25,
    c.fillStyle = ['#fc0','#f04','#0a8'][a--],
    c.beginPath(),
    c[l='lineTo'](x, y),
    c[l]( x -10, y + (a+!a) * 17),
    a&&c[l](x - 30, y + a * 17),
    c[l](x - 20, y),
    !a&&c[l](x - 10, y - 17),
    c.fill()
  ))
</script>
deleted 20 characters in body
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90
Loading