procedural generation problem

Godot Version

Rextends TileMap

@export() var max_x = 200
@export() var max_y = 200

var noise: FastNoiseLite = FastNoiseLite.new()

var snap_size_x = 8

var snap_size_y = 8

func _ready() → void:
randomize()

noise.seed = randi()
noise.fractal_lacunarity = 2.0
noise.fractal_octaves = 5
noise.fractal_gain = 0.588
noise.frequency = 2.43


generate_world()

func generate_world():
for x in max_x:
for y in max_y:
var tile_id = generate_i(noise.get_noise_2d(x,y))
if (tile_id != -1):
set_cell(x,y,tile_id)

func generate_i(noise_level: float):
if(noise_level <= 0):
return -1
else:
return 0

hello I’m trying to figure out whats the problem with this code can anyone help?

Please check Posting guidelines in #Help channel