It looks like this is a web page, not a feed. I looked for a feed associated with this page, but couldn't find one. Please enter the address of your feed to validate.

Source: https://desabeji.com/

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  <title>OM JA JA JANGAN OM!!!!</title>
  5.  <meta charset="UTF-8">
  6.  <style>
  7.  html, body {
  8.    height: 100%;
  9.    margin: 0;
  10.  }
  11.  
  12.  body {
  13.    background: black;
  14.    display: flex;
  15.    align-items: center;
  16.    justify-content: center;
  17.  }
  18.  canvas {
  19.    border: 1px solid white;
  20.  }
  21.  </style>
  22. </head>
  23. <body>
  24. <canvas width="400" height="400" id="game"></canvas>
  25. <script>
  26. var canvas = document.getElementById('game');
  27. var context = canvas.getContext('2d');
  28.  
  29. // the canvas width & height, snake x & y, and the apple x & y, all need to be a multiples of the grid size in order for collision detection to work
  30. // (e.g. 16 * 25 = 400)
  31. var grid = 16;
  32. var count = 0;
  33.  
  34. var snake = {
  35.  x: 160,
  36.  y: 160,
  37.  
  38.  // snake velocity. moves one grid length every frame in either the x or y direction
  39.  dx: grid,
  40.  dy: 0,
  41.  
  42.  // keep track of all grids the snake body occupies
  43.  cells: [],
  44.  
  45.  // length of the snake. grows when eating an apple
  46.  maxCells: 4
  47. };
  48. var apple = {
  49.  x: 320,
  50.  y: 320
  51. };
  52.  
  53. // get random whole numbers in a specific range
  54. // @see https://stackoverflow.com/a/1527820/2124254
  55. function getRandomInt(min, max) {
  56.  return Math.floor(Math.random() * (max - min)) + min;
  57. }
  58.  
  59. // game loop
  60. function loop() {
  61.  requestAnimationFrame(loop);
  62.  
  63.  // slow game loop to 15 fps instead of 60 (60/15 = 4)
  64.  if (++count < 4) {
  65.    return;
  66.  }
  67.  
  68.  count = 0;
  69.  context.clearRect(0,0,canvas.width,canvas.height);
  70.  
  71.  // move snake by it's velocity
  72.  snake.x += snake.dx;
  73.  snake.y += snake.dy;
  74.  
  75.  // wrap snake position horizontally on edge of screen
  76.  if (snake.x < 0) {
  77.    snake.x = canvas.width - grid;
  78.  }
  79.  else if (snake.x >= canvas.width) {
  80.    snake.x = 0;
  81.  }
  82.  
  83.  // wrap snake position vertically on edge of screen
  84.  if (snake.y < 0) {
  85.    snake.y = canvas.height - grid;
  86.  }
  87.  else if (snake.y >= canvas.height) {
  88.    snake.y = 0;
  89.  }
  90.  
  91.  // keep track of where snake has been. front of the array is always the head
  92.  snake.cells.unshift({x: snake.x, y: snake.y});
  93.  
  94.  // remove cells as we move away from them
  95.  if (snake.cells.length > snake.maxCells) {
  96.    snake.cells.pop();
  97.  }
  98.  
  99.  // draw apple
  100.  context.fillStyle = 'red';
  101.  context.fillRect(apple.x, apple.y, grid-1, grid-1);
  102.  
  103.  // draw snake one cell at a time
  104.  context.fillStyle = 'green';
  105.  snake.cells.forEach(function(cell, index) {
  106.  
  107.    // drawing 1 px smaller than the grid creates a grid effect in the snake body so you can see how long it is
  108.    context.fillRect(cell.x, cell.y, grid-1, grid-1);
  109.  
  110.    // snake ate apple
  111.    if (cell.x === apple.x && cell.y === apple.y) {
  112.      snake.maxCells++;
  113.  
  114.      // canvas is 400x400 which is 25x25 grids
  115.      apple.x = getRandomInt(0, 25) * grid;
  116.      apple.y = getRandomInt(0, 25) * grid;
  117.    }
  118.  
  119.    // check collision with all cells after this one (modified bubble sort)
  120.    for (var i = index + 1; i < snake.cells.length; i++) {
  121.  
  122.      // snake occupies same space as a body part. reset game
  123.      if (cell.x === snake.cells[i].x && cell.y === snake.cells[i].y) {
  124.        snake.x = 160;
  125.        snake.y = 160;
  126.        snake.cells = [];
  127.        snake.maxCells = 4;
  128.        snake.dx = grid;
  129.        snake.dy = 0;
  130.  
  131.        apple.x = getRandomInt(0, 25) * grid;
  132.        apple.y = getRandomInt(0, 25) * grid;
  133.      }
  134.    }
  135.  });
  136. }
  137.  
  138. // listen to keyboard events to move the snake
  139. document.addEventListener('keydown', function(e) {
  140.  // prevent snake from backtracking on itself by checking that it's
  141.  // not already moving on the same axis (pressing left while moving
  142.  // left won't do anything, and pressing right while moving left
  143.  // shouldn't let you collide with your own body)
  144.  
  145.  // left arrow key
  146.  if (e.which === 37 && snake.dx === 0) {
  147.    snake.dx = -grid;
  148.    snake.dy = 0;
  149.  }
  150.  // up arrow key
  151.  else if (e.which === 38 && snake.dy === 0) {
  152.    snake.dy = -grid;
  153.    snake.dx = 0;
  154.  }
  155.  // right arrow key
  156.  else if (e.which === 39 && snake.dx === 0) {
  157.    snake.dx = grid;
  158.    snake.dy = 0;
  159.  }
  160.  // down arrow key
  161.  else if (e.which === 40 && snake.dy === 0) {
  162.    snake.dy = grid;
  163.    snake.dx = 0;
  164.  }
  165. });
  166.  
  167. // start the game
  168. requestAnimationFrame(loop);
  169. </script>
  170. </body>
  171. </html>
Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda