jango464
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
|
| 04 Jan 2012 08:05 AM |
I have this code;
function allwords() local line = io.read() local pos = 1 return function() whlie line do local s, e = string.find(line, "%w+", pos) if s then pos = e + 1 return string.sub(line, s, e) else line = io.read() pos = 1 end end return nil end end
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2012 08:09 AM |
You can get a lua interpreter.
But seriously, though, it's completely and entirely useless using Lua until you can code in C++ to actually give Lua some stuff to do other than talk to command prompt and stuff.
C# and a few other languages also have decent implementations of Lua, such as LuaInterface. |
|
|
| Report Abuse |
|
|
jango464
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
| |
|
|
| 04 Jan 2012 08:10 AM |
| There's an online Lua interpreter, if I remember, on the official Lua site. You should be able to run that code there. |
|
|
| Report Abuse |
|
|
jango464
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
|
| 04 Jan 2012 08:20 AM |
| Bump, I need to know how to run a program from notpad. Your not helping me that much by telling me something that doesn't even show me my final creation. It just says "Your program ran correctly!" |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2012 08:50 AM |
| Download a Lua command line, then open up your script with it. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2012 03:08 PM |
| Link to Lua site please... |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
| |
|
jango464
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
| |
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
| |
|
LocalChum
|
  |
| Joined: 04 Mar 2011 |
| Total Posts: 6906 |
|
|
| 04 Jan 2012 04:10 PM |
@aboy
Yeah, we're certainly popular. Either that or we get a lot of F5's. :3 |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 04 Jan 2012 04:19 PM |
@OP: Your question has been answered over 3 times. Install lua. lua luafile.lua |
|
|
| Report Abuse |
|
|
jango464
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 4913 |
|
| |
|
| |
|