Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <canvas id="c" width="768" height="768">
- <script>
- const context = c.getContext('2d');
- function test(x,y,t) {
- return ((x * y)^t) % 17;
- }
- const scale = 2;
- function draw(t) {
- for (let x = 0; x < c.width / scale; x++) {
- for (let y = 0; y < c.height / scale; y++) {
- if (test(x,y,t)) {
- context.fillStyle = '#000';
- } else {
- context.fillStyle = '#fff';
- }
- context.fillRect(x*scale, y*scale, scale, scale);
- }
- }
- }
- let t = 0;
- window.setInterval(() => { t = (t+1) % 256; draw(t); }, 20);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement