lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




From: Peter Hickman <peterhickman386@googlemail.com>
Subject: Re: n-queens -> save the solutions
To: Lua mailing list <lua-l@lists.lua.org>
Message-ID:
       <CALxYQy5L_tXd4VHG2evwGH3a_KXvQcJQtPpOHqxS5Y1WMGaeVQ@mail.gmail.com">CALxYQy5L_tXd4VHG2evwGH3a_KXvQcJQtPpOHqxS5Y1WMGaeVQ@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Alternatively store the results on line 14 as

solutions[#solutions+1] = char

and display the results as

for s=1,#solutions do
  print(solutions[s])
end

Yes, but it is not a real nice way (then I have to split the solutions[s] to use the result)… why my previous code does not work?

Thank you for your help.

--
Maxime Chupin
http://mc.notezik.com