How do you translate this: if(!visited[j]&&G[i][j]==1) into lua? [solved]

Thanks in advance :wink:

@quezadav

if not visited[j] and G[i][j] ==1 then

@Ignatz, thanks, I’m trying to code a Depth First Search algorithm in Codea based on some C implementations (because I haven’t found a similar one for Lua). I’m obviously stuck right now because I don’t “speak” C or Java, etc. :wink: but I try hard anyway.

if you see ||, it means or

Here is one that I found

http://algorithm.zone/implementation/308/iterative-deepening-depth-first-search/yonaba/lua/

The Lua form is so much more readable than C.

Thanks, I’ll check it out.