Snake Ws2812b 16x16

If someone could help me with the food generator part, and the Arduino actually understanding the food function, that'd be awesome

#include "FastLED.h"

#define NUM_LEDS 256

#define DATA_PIN 8

CRGB leds[NUM_LEDS];
int led = 0;

int szechuan(int);
int columns(int);





  
void setup() { 
FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS);
pinMode(A3, INPUT);

  
}


void loop() { 

food();
int valx = analogRead(1);
int valy = analogRead(2);




if (valx < 330) {

if ((led+1)/16 == led/16){
led++;
}
led = led % 256;


delay(200);
int morty = szechuan(led);
leds[morty] = CRGB::Green;
}


//RED

if (valx > 700) {

if ((led-1)/16 == led/16){
led--;
}
led = led % 256;


delay(200);
int morty = szechuan(led);
leds[morty] = CRGB::Green;
}

/////////////////////////

if (valy > 500) {  //down

if (led + 16 <= 255){
 led = led + 16;
}
led = led % 256;

delay(200);
int morty = szechuan(led);
leds[morty] = CRGB::Green;
}

if (valy < 300) {  //down

if (led - 16 >= 0){
led = led - 16;
}
led = led % 256;

delay(200);
int morty = szechuan(led);
leds[morty] = CRGB::Green;


///////////////////////////////




}


FastLED.setBrightness(15);
FastLED.show();
FastLED.clear();
}

 int szechuan(int n){
  int output;
 if ((n/16) % 2 == 1) {
  output = (2 * (n/16)+1)* 16-1-n;
  } 
 else {
  output = n;
  }
  return output;
  } 

 int columns(int n){
  int output = (16*led)%255;
  return output;
 }


void food() {
int x = random(255);
leds[x] = CRGB::Red;
  }

New user using code tags to post code. Karma++

When you are in the editor, auto format the code. CTRL-T on a PC. This makes it much easier to read. And get rid of the excessive white space.

A single blank line to separate functions? Sure.
An occasional blank line to separate major blocks? Maybe.
But beyond that, keep the lines together. Much easier to read.

Now, your code.
You really need to read through examples of using millis() rather than delay()
Blink without delay can be googled.
Robin2's Several things at the same time is very good.