History of Idiom 43 > diff from v34 to v35
Edit summary for version 35 by dromer:
[Lua] fault, line 8 is needed and cannot be removed.
[Lua] fault, line 8 is needed and cannot be removed.
↷
Version 34
2017-10-09, 15:51:56
Version 35
2017-10-20, 22:53:11
Idiom #43 Break outer loop
Look for a negative value v in 2D integer matrix m. Print it and stop searching.
Idiom #43 Break outer loop
Look for a negative value v in 2D integer matrix m. Print it and stop searching.
Comments bubble
2) Simplifying is possible. Change line 11 in if (state == "found") then break end and remove lines 1, 7 and 8.
3) No goto-statement.
4) As Nepta wrote: using a function might be another solution, as an example see http://www.programming-idioms.org/idiom/20/return-two-values/1661/lua
Comments bubble
2) Simplifying is possible. Change line 11 in if (state == "found") then break end and remove lines 1 and 7.
3) No goto-statement.
4) As Nepta wrote: using a function might be another solution, as an example see http://www.programming-idioms.org/idiom/20/return-two-values/1661/lua