original_docstring: Move snake forward one segment.
docstring: Move snake forward one segment.
docstring_tokens: Move snake forward one segment .
code: def move():
      "Move snake forward one segment."
      head = snake[-1].copy()
      head.move(aim)
  
      if not inside(head) or head in snake:
          square(head.x, head.y, 9, 'red')
          update()
          return
  
      snake.append(head)
  
      if head == food:
          print('Snake:', len(snake))
          food.x = randrange(-15, 15) * 10
          food.y = randrange(-15, 15) * 10
      else:
          snake.pop(0)
  
      # Se crea una nueva coordenada donde la comida
      # corre +-1 en todas direcciones mientras la cabeza
      # no toque la coordernada de la comida
      k = int(food.x/10)
      c = int(food.y/10)
      food.x = randrange(-1+k, 2+k) * 10
      food.y = randrange(-1+c, 2+c) * 10
  
      clear()
  
      for body in snake:
          square(body.x, body.y, 9, color[0])
  
      square(food.x, food.y, 9, color[1])
      update()
      ontimer(move, 250)
code_tokens: def move ( ) : head = snake [ - 1 ] . copy ( ) head . move ( aim ) if not inside ( head ) or head in snake : square ( head . x , head . y , 9 , 'red' ) update ( ) return snake . append ( head ) if head == food : print ( 'Snake:' , len ( snake ) ) food . x = randrange ( - 15 , 15 ) * 10 food . y = randrange ( - 15 , 15 ) * 10 else : snake . pop ( 0 ) k = int ( food . x / 10 ) c = int ( food . y / 10 ) food . x = randrange ( - 1 + k , 2 + k ) * 10 food . y = randrange ( - 1 + c , 2 + c ) * 10 clear ( ) for body in snake : square ( body . x , body . y , 9 , color [ 0 ] ) square ( food . x , food . y , 9 , color [ 1 ] ) update ( ) ontimer ( move , 250 )
short_docstring: Move snake forward one segment.
short_docstring_tokens: Move snake forward one segment .
comment: "Move snake forward one segment."$SEP$# Se crea una nueva coordenada donde la comida$SEP$# corre +-1 en todas direcciones mientras la cabeza$SEP$# no toque la coordernada de la comida