Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coffeescript unmatched outdent error

Tags:

coffeescript

I'm getting the error SyntaxError: Unmatched OUTDENT on line 9 when I try to compile the following coffeescript code. I'm not sure what I'm doing wrong. the indentation seems to be right, and I have everything where I want it.

row_possibilities = (grid) ->   for rows in [0..8] by 1     for columns in [0..8] by 1       if(Array.isArray(grid[rows][columns])         for possible_val in grid[rows][columns] by 1           grid = unique_row_possibility(grid, rows, columns, possible_val)           if(Array.isArray(grid[rows][columns]) == false)             break   return grid 

What the code is supposed to do is run the three for loops and breaks the innermost for loop if a certain condition happens.

After all the for loops run. I want to return the variable grid. I've double checked the spacing, and I tried it out on repl.it, but I can't figure it out.

like image 393
NielMalhotra Avatar asked Jan 11 '13 00:01

NielMalhotra


1 Answers

A bit tough to see but it appears that you are missing a closing parenthesis on line 4:

if(Array.isArray(grid[rows][columns]) 

In general, for this particular error, the problem will almost always lie with indention or unbalanced parenthesis or brackets/braces.

like image 188
Jesse Vogt Avatar answered Oct 04 '22 06:10

Jesse Vogt